Symbolic Integration
~Example:
syms x
expr = -2*x/(1+x^2)^2;
% Find the indefinite integral of the univariate expression.
F = int(expr)
>> F =
1/(x^2 + 1)
% Find the finite integral of the univariate expression.
syms x
expr = x*log(1+x);
F = int(expr,[0 1])
>> F =
1/4syms x
f = cos(x)/sqrt(1 + x^2);
Fint = int(f,x,[0 10])
Fvpa = vpa(Fint)
>> Fvpa =
0.37570628299079723478493405557162To approximate integrals directly, use vpaintegral instead of vpa. The vpaintegral function is faster and provides control over integration tolerances.
Fvpaint = vpaintegral(f,x,[0 10])
>> Fvpaint =
0.375706