Problem with integration: there is a pole on a contour
Show older comments
I have a problem with calculation of the complex integral

The integrand has a pole in z=1 and z=-1 lying on the unit circle.
My code are as following:
t = @(theta) exp(1i*theta);
f = @(t) (t^2+3*t+2*1i)/(t+4)/(t-1)/(t+1);
integrand = @(theta) f(t(theta))*1i*exp(1i*theta);
integral_result = integral(integrand, 0, 2*pi, 'ArrayValued', true, 'AbsTol', 1e-12, 'RelTol', 1e-12);
result = (1/(2*pi*1i)) * integral_result;
I_num=result;
disp(['numerical solution=',num2str(I_num)])
How do i fix it...
Accepted Answer
More Answers (1)
In the usual sense, your integral does not exist. But you can compute its principal value:
syms z
syms t real
f = (z^2+3*z+2*1i)/((z+4)*(z-1)*(z+1));
f = partfrac(f)
f = subs(f,z,exp(1i*t))*1i*exp(1i*t)
1/(2*sym(pi)*1i)*int(f,0,2*sym(pi),PrincipalValue=true)
Categories
Find more on Numerical Integration and Differentiation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!