MATLAB: What is the error in this code for integration? The image of the equation has been attached.

integralnumerical integrationsymbolic integration

a=3.8;
theta=5;
zu= 0.02;
zd= 0.05;
pd=zd/(zu+zd);
v =@(u)(theta.^(0.52)/(1+u.^(0.52)));
y1= integral(v, theta.^(-0.52),Inf);
mud= 1- ((E.*zd.*y1)/pd);

Best Answer

integral() always passes a vector of values in to be integrated. Your v function is expecting that u will be scalar. You need to change it to
v =@(u)(theta.^(0.52)./(1+u.^(0.52)));
However, look more carefully at your equation. It has 2/alpha in the exponent for the lower bound, and has 2/alpha as the exponent for theta, but has alpha/2 in the exponent for nu. Your code hard-codes 0.52 in all three of those cases, and defines an unused variable named "a". Perhaps you should re-code in terms of a.
If we suggest that a is your alpha and that it is exactly equal to the rational value 19/5, then there is a closed-form-like solution for the integral, but it involves the sum over all of the roots of four different polynomials, two of degree 18 and two of degree 72. There is no closed form for the roots of polynomials of that degree, but there are solid ways of computing them numerically. The y1 value comes out as approximately 2.932
Related Question