In Matlab write a script to evaluate the following integral

In Matlab, write a script to evaluate the following integral: integral_c f(z)/z dz for the curve C parameterized by z = Re^i theta for R = 1 and 0 lessthanorequalto 0 lessthanorequalto 2 pi. (Note that dz = iRe^i theta d theta). Verify the Cauchy integral formula (i.e. integral_c f(z)dz/z-a = 2 pi i f(z)) for a. = 0 with f(z) = e^2 f(z)= sin^2 (z) Now. shift the curve C so that it is still a circle with radius R = 1. but now centered at -4 - 4 i. Does the integral in part (a) change?

Solution

Part a) matlab program


clc;clear all;
f = @(z) exp(z); %The part a function
F1 = @(z) f(z)./z; % define the function to be integrated
v = @(theta) exp(1i*theta); % the parameterized unit curve
vprime = @(theta) 1i*exp(1i*theta); % the derivative of v
La = integral(@(t) F1(v(t)).*vprime(t),0,2*pi);% Evaluating the integration
Lc = 1i*2*pi*f(0+0i); % evaluating the cauchy integral formula
% printing the results
fprintf(\'The result of integration = \');
disp(La);
fprintf(\'The result using Cauchy integral formula = \');
disp(Lc);

OUTPUT of the code

The result of integration =    0.0000 + 6.2832i

The result using Cauchy integral formula =    0.0000 + 6.2832i

Part b) matlab program

clc;clear all;
f = @(z) sin(z).^2; %The part b function
F1 = @(z) f(z)./z; % define the function to be integrated
v = @(theta) exp(1i*theta); % the parameterized unit curve
vprime = @(theta) 1i*exp(1i*theta); % the derivative of v
La = integral(@(t) F1(v(t)).*vprime(t),0,2*pi);% Evaluating the integration
Lc = 1i*2*pi*f(0+0i); % evaluating the cauchy integral formula
% printing the results
fprintf(\'The result of integration = \');
disp(La);
fprintf(\'The result using Cauchy integral formula = \');
disp(Lc);

OUTPUT of the code

The result of integration =    1.0755e-16 - 4.4409e-16i

The result using Cauchy integral formula =      0

Part c) matlab program

clc;clear all;
f = @(z) exp(z); %The part b function
F1 = @(z) f(z)./z; % define the function to be integrated
v = @(theta) (-4-4i)+exp(1i*theta); % the parameterized unit curve
vprime = @(theta) 1i*exp(1i*theta); % the derivative of v
La = integral(@(t) F1(v(t)).*vprime(t),0,2*pi);% Evaluating the integration
Lc = 1i*2*pi*f(0+0i); % evaluating the cauchy integral formula
% printing the results
fprintf(\'The result of integration = \');
disp(La);

OUTPUT of the code

The result of integration =   -3.2526e-18 + 3.1442e-18i

Remarks

From part a and part b we found that the result of integration and the result of Chausy integral formula are same. The result of integration for part b and c are almost zero only. For part c, If the center shifted to -4-4i the curve is no more contains any poles hence the result of integration will be zero. the result is different from the part a answer.

 In Matlab, write a script to evaluate the following integral: integral_c f(z)/z dz for the curve C parameterized by z = Re^i theta for R = 1 and 0 lessthanoreq
 In Matlab, write a script to evaluate the following integral: integral_c f(z)/z dz for the curve C parameterized by z = Re^i theta for R = 1 and 0 lessthanoreq

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site