COMPLEX ANALYSIS: Maple Worksheets, 2009
(c) John H. Mathews Russell W. Howell
mathews@fullerton.edu howell@westmont.edu

Complimentary software to accompany the textbook:

COMPLEX ANALYSIS: for Mathematics & Engineering, 4th Ed, 2001, ISBN: 0-7637-1425-9
Jones and Bartlett Publishers, Inc., 40 Tall Pine Drive, Sudbury, MA 01776
Tele. (800) 832-0034; FAX: (508) 443-8000, E-mail: mkt@jbpub.com, http://www.jbpub.com/

Check out the new Complex Analysis Projects page.


CHAPTER 8 RESIDUE THEORY

Section 8.6 Indented Contour Integrals

If f is continuous on the interval `b<x` <= c , then the improper integral of f over `[`*b*`,`*c*`]` is defined by

Int(f(x),x = b .. c) = Limit(int(f(x),x = r .. c),r = b^`+`) , provided that the limit exists.

Similarly, if f is continuous on the interval a <= `x<b` , then the improper integral of f over `[`*a*`,`*b*`]` is defined by

Int(f(x),x = a .. b) = Limit(int(f(x),x = a .. R),R = b^`-`) , provided that the limit exists.

 

 

Theorem 8.5 Let f(z) = P(z)/Q(z) where P(z) and Q(z) are polynomials with real coefficients, of degree m and n , respectively, where m+2 <= n . If Q(z) has simple zeros at the points t[1] , t[2] , ..., t[l] on the x axis, then

P. V. Int(P(x)/Q(x),x = -infinity .. infinity) = 2*pi*i*s... ,

z[1] , z[2] , ..., z[k] are the poles of f(z) that lie in the upper half plane.

 

Theorem 8.6 Let P(z) and Q(z) be polynomials of degree m and n , respectively, where m+1 <= n , and let Q(z) have simple zeros at the points t[1] , t[2] , ..., t[l] on the x - axis. If alpha is a positive real number and if f(z) = exp(i*alpha*z)*P(z)/Q(z) , then

`P.V. `*Int(P(x)/Q(x)*cos(alpha*x),x = -infinity ..... ,
and

`P.V. `*Int(P(x)/Q(x)*sin(alpha*x),x = -infinity ..... ,

 

z[1] , z[2] , ..., z[k] are the poles of f(z) that lie in the upper half plane.

 

 

Remark The formulas in these theorems give the Cauchy principal value of the integral, which pays special attention to the manner in which any limits are taken. They are similar to those in Sections 8.4 and 8.5, except here we add one-half of the value of each residue at the points t[1], t[2], `...`, t[l] on the x -axis.

 

Load Maple's "residue" procedure.
Make sure this is done only ONCE during a Maple session.

> readlib(residue):


Example 8.20, Page 334. Use the residue calculus to evaluate the integral:
int(x/(x^3-8),x = -infinity .. infinity) = pi*sqrt(... .

> f:='f': F:='F': z:='z':
f := z -> z/(z^3 - 8):
`f(z) ` = f(z);

`f(z) ` = z/(z^3-8)

Find the singularities of f(z) = z/(z^3-8) .

> Zn := sort([solve(denom(f(z))=0, z)]):
`For f(z) ` = f(z);
`The singularities are:`;
z1 := subs(z=Zn[1],z): z[1] = z1;
z2 := subs(z=Zn[2],z): z[2] = z2;
z3 := subs(z=Zn[3],z): z[3] = z3;

`For  f(z) ` = z/(z^3-8)

`The singularities are:`

z[1] = 2

z[2] = -1+I*sqrt(3)

z[3] = -1-I*sqrt(3)

Which poles lie on the x -axis and which poles lie in the upper half plane ?

> print(`0 =`,Im(z[1]),` `,0=Im(z1), evalb(evalf(Im(z1))=0));
print(`0 =`,Im(z[2]),` `,0=Im(z2), evalb(evalf(Im(z2))=0));
print(`0 =`,Im(z[3]),` `,0=Im(z3), evalb(evalf(Im(z3))=0));
print(` `);
print(`0 <`,Im(z[1]),` `,Im(z1)>0, evalb(evalf(Im(z1))>0));
print(`0 <`,Im(z[2]),` `,Im(z2)>0, evalb(evalf(Im(z2))>0));
print(`0 <`,Im(z[3]),` `,Im(z3)>0, evalb(evalf(Im(z3))>0));

`0 =`, Im(z[1]), `  `, 0 = 0, true

`0 =`, Im(z[2]), `  `, 0 = sqrt(3), false

`0 =`, Im(z[3]), `  `, 0 = -sqrt(3), false

` `

`0 <`, Im(z[1]), `  `, 0 < 0, false

`0 <`, Im(z[2]), `  `, 0 < sqrt(3), true

`0 <`, Im(z[3]), `  `, 0 < -sqrt(3), false

Remark. Sometimes Maple will form the list of values in a different order.

It is always necessary to visually inspect the above results before proceeding.


Compute the residue at
z[1] on the real axis and z[2] in the upper half plane.

Remark. Maple does not seem to sor things the same each time it is run.

Be sure to use either z[3] or z[2] for this example, depending on the sort.

> r1 := residue(f(z), z=z1): `Res[f`,z1,`] ` = r1;
r2 := residue(f(z), z=z2): `Res[f`,z2,`] ` = r2;
r3 := residue(f(z), z=z3): `Res[f`,z3,`] ` = r3;

`Res[f`, 2, `] ` = 1/6

`Res[f`, -1+I*sqrt(3), `] ` = (-1+I*sqrt(3))/(-6*I*...

`Res[f`, -1-I*sqrt(3), `] ` = (I*sqrt(3)+1)/(-6*I*s...

 

The value of the integral is computed by the residue calculus:

> `F(x)` = f(x);
val := Pi*I*r1 + 2*Pi*I*r3:
print(int(F(x),x=-infinity..infinity) = val);
val := evalc(Pi*I*r1 + 2*Pi*I*r3):
print(int(F(x),x=-infinity..infinity) = val);

`F(x)` = x/(x^3-8)

int(F(x),x = -infinity .. infinity) = 1/6*I*Pi+2*I*...

int(F(x),x = -infinity .. infinity) = -1/6*Pi*sqrt(...

Remark. Was the answer positive, if not, Maple did not sort things as expected.

Go back and use the other point if necessary.

 

Let's see if Maple can do it with anti-derivatives. It picks up an imaginary part in the anti-derivative !
It is necessary to take the real part to obtain the desired soultion !

> g := z -> subs(Z=z,int(f(Z),Z)):
`F(x) ` = f(x);
`G(x) = `, int(F(x),x) = g(x);
print(`Do the computation with limits!`);
L1 := limit(g(x),x=-infinity):
L2 := limit(g(x),x=infinity):
`L1 = limit G(x) as x->-oo ` = L2;
`L2 = limit G(x) as x->+oo ` = L2;
`G(-oo) ` = L1;
`G(oo) ` = L2;
`G(oo) - G(-oo) ` = L2 - L1;
`Re[G(oo) - G(-oo)]` = Re(L2 - L1);
print(int(F(x),x=-infinity..infinity) = Re(L2 - L1));

`F(x) ` = x/(x^3-8)

`G(x) = `, int(F(x),x) = 1/6*ln(x-2)-1/12*ln(x^2+2*...

`Do the computation with limits!`

`L1 = limit  G(x)  as  x->-oo ` = 1/12*Pi*sqrt(3)

`L2 = limit  G(x)  as  x->+oo ` = 1/12*Pi*sqrt(3)

`G(-oo) ` = 1/6*I*Pi-1/12*Pi*sqrt(3)

`G(oo)  ` = 1/12*Pi*sqrt(3)

`G(oo) - G(-oo) ` = 1/6*Pi*sqrt(3)-1/6*I*Pi

`Re[G(oo) - G(-oo)]` = 1/6*Pi*sqrt(3)

int(F(x),x = -infinity .. infinity) = 1/6*Pi*sqrt(3...

 

Although Maple can pull it out directly, taking the real part of a complex answer
leaves something to be desired. You are basically on your own if you trust the
computer to do this integral.


Example 8.22, Page 335. Use the residue calculus to evaluate the integral:
int(sin(x)/((x-1)*(x^2+4)),x = -infinity .. infinit... .

> f:='f': F:='F': g:='g': z:='z':
f := z -> exp(I*z)/((z-1)*(z^2 + 4)):
F0 := z -> sin(z)/((z-1)*(z^2 + 4)):
`F(z) ` = F0(z);
`f(z) ` = f(z);

`F(z) ` = sin(z)/(z-1)/(z^2+4)

`f(z) ` = exp(I*z)/(z-1)/(z^2+4)

Find the singularities of f(z) = exp(i*z)/((z-1)*(z^2+4)) .

> Zn := sort([solve(denom(f(z))=0, z)]):
`For f(z) ` = f(z);
`The singularities are:`;
z1 := subs(z=Zn[1],z): z[1] = z1;
z2 := subs(z=Zn[2],z): z[2] = z2;
z3 := subs(z=Zn[3],z): z[3] = z3;

`For  f(z) ` = exp(I*z)/(z-1)/(z^2+4)

`The singularities are:`

z[1] = 1

z[2] = 2*I

z[3] = -2*I

 

Which poles lie on the x-axis and which poles lie in the upper half plane ?

> print(`0 =`,Im(z[1]),` `,0=Im(z1), evalb(evalf(Im(z1))=0));
print(`0 =`,Im(z[2]),` `,0=Im(z2), evalb(evalf(Im(z2))=0));
print(`0 =`,Im(z[3]),` `,0=Im(z3), evalb(evalf(Im(z3))=0));
print(` `);
print(`0 <`,Im(z[1]),` `,Im(z1)>0, evalb(evalf(Im(z1))>0));
print(`0 <`,Im(z[2]),` `,Im(z2)>0, evalb(evalf(Im(z2))>0));
print(`0 <`,Im(z[3]),` `,Im(z3)>0, evalb(evalf(Im(z3))>0));

`0 =`, Im(z[1]), `  `, 0 = 0, true

`0 =`, Im(z[2]), `  `, 0 = 2, false

`0 =`, Im(z[3]), `  `, 0 = -2, false

` `

`0 <`, Im(z[1]), `  `, 0 < 0, false

`0 <`, Im(z[2]), `  `, 0 < 2, true

`0 <`, Im(z[3]), `  `, 0 < -2, false

 

Remark. Sometimes Maple will form the list of values in a different order.

It is always necessary to visually inspect the above results before proceeding.


Compute the residue at
z[1] on the real axis and z[2] in the upper half plane.

> r1 := residue(f(z), z=z1): `Res[f`,z1,`] ` = r1;
r2 := residue(f(z), z=z2): `Res[f`,z2,`] ` = r2;

`Res[f`, 1, `] ` = 1/5*exp(I)

`Res[f`, 2*I, `] ` = (-1/10+1/20*I)*exp(-2)

 

The value of the integral is computed by the residue calculus:

> `F(z) = ` = F0(z);
val := 2*Pi*Re(r2) + Pi*Re(r1):
print(int(F(x),x=-infinity..infinity) = val);

`F(z) = ` = sin(z)/(z-1)/(z^2+4)

int(F(x),x = -infinity .. infinity) = -1/5*Pi*exp(-...

Maple can find an anti-derivative, but unfortunately, the limiting values at infinity
do NOT produce the correct value.


g := z -> subs(Z=z,int(f(Z),Z)):
`F(x) ` = f0(x);
`g(x) = Integral of f(x) ` = g(x);
`G(oo) - G(-oo)` = g(infinity) - g(-infinity);
`G(oo) - G(-oo)` = simplify(g(infinity) - g(-infinity));
print(`Now do the above computation with limits!`);
L1 := limit(g(x),x=-infinity):
L2 := limit(g(x),x=infinity):
`L1 = limit G(x) as x->-oo ` = L1;
`L2 = limit G(x) as x->+oo ` = L2;
`G(-oo) ` = L1;
`G(oo) ` = L2;
`G(oo) - G(-oo) ` = L2 - L1;
`Re[G(oo) - G(-oo)]` = Re(L2 - L1);
print(int(F(x),x=-infinity..infinity) = Re(L2 - L1));
print(`Unfortunately this answer is wrong !`);

`F(x) ` = f0(x)

`g(x) = Integral of  f(x) ` = -I*((1/20+1/10*I)*exp...

`G(oo) - G(-oo)` = -I*((1/20+1/10*I)*exp(-2)*Ei(1,-...
`G(oo) - G(-oo)` = -I*((1/20+1/10*I)*exp(-2)*Ei(1,-...

`G(oo) - G(-oo)` = 0

`Now do the above computation with limits!`

`L1 = limit  G(x)  as  x->-oo ` = 0

`L2 = limit  G(x)  as  x->+oo ` = 0

`G(-oo) ` = 0

`G(oo)  ` = 0

`G(oo) - G(-oo) ` = 0

`Re[G(oo) - G(-oo)]` = 0

int(F(x),x = -infinity .. infinity) = 0

`Unfortunately this answer is wrong !`

>

This does NOT agree with the computation obtained with the residue calculus.

> `F(z) = ` = F0(z);
val := 2*Pi*Re(r2) + Pi*Re(r1):
print(int(F(x),x=-infinity..infinity) = val);
print(`This answer obtained with residues is correct !`);

`F(z) = ` = sin(z)/(z-1)/(z^2+4)

int(F(x),x = -infinity .. infinity) = -1/5*Pi*exp(-...

`This answer obtained with residues is correct !`

 

End of Section 8.6.