COMPLEX ANALYSIS: Maple Worksheets, 2001
(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/


CHAPTER 8 RESIDUE THEORY

Section 8.4 Improper Integrals of Rational Functions

An important application of the theory of residues is the evaluation of certain types of improper integrals. Let f be a continuous function of the real variable x on the interval 0 <= x ` < `*infinity . Recall from calculus that the improper integral f over `[0`*`,`*infinity*`)` is defined by

 

Int(f(x),x = 0 .. infinity) = Limit(int(f(x),x = 0 ... , provided that the limit exists.

 

If f is defined for all real x , then the integral of f over `(-`*infinity*`,`*infinity*`)` is defined by

 

Int(f(x),x = -infinity .. infinity) = Limit(int(f(x),x = a .. 0),a = -infinity) + Limit(int(f(x),x = 0 .. b),b = infinity) , provided that the limit exists.

 

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

> readlib(residue):

Example 8.13, Page 323. Evaluate limit(int(x,x = -R .. R),R = infinity) .

> f:='f': F:='F': x:='x':
f := x -> x:
g := int(f(x),x):
`F(x) ` = f(x);
`G(x) = `, int(F(x),x) = int(f(x),x);

`F(x) ` = x

`G(x) = `, int(F(x),x) = 1/2*x^2

> limit(int(F(x),x=-R..R), R=infinity) = int(f(x),x=-infinity..infinity);
int(F(x),x) = int(f(x),x);
lim := limit(int(f(x),x=-R..R),R=infinity):
limit(int(F(x),x=-R..R), R=infinity) = lim;

limit(int(F(x),x = -R .. R),R = infinity) = undefin...

int(F(x),x) = 1/2*x^2

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

 

 

Definition 8.2: Cauchy principal value

 

Let f be a continuous real valued function for all x .

The Cauchy principal value (P.V.) of the integral Int(f(x),x = -infinity .. infinity) is defined by

 

`P.V. `*Int(f(x),x = -infinity .. infinity) = Limit...

 

provided that the limit exists.

 

Example 8.14, Page 323. Evaluate the integral int(1/(1+x^2),x = -infinity .. infinity) .

> f:='f': F:='F': z:='z':
f := z -> 1/(z^2 + 1):
`f(z) ` = f(z);

`f(z) ` = 1/(z^2+1)

Find the singularities of f(z) = 1/(z^2+1) .

> 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;

`For  f(z) ` = 1/(z^2+1)

`The singularities are:`

z[1] = I

z[2] = -I

 

Which poles lie in the upper half plane ?

> 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));

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

`0 < `, Im(z[2]), `  `, 0 < -1, 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] .

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

`Res[f`, I, `] ` = -1/2*I

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

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

`F(x)` = 1/(x^2+1)

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

 

Or, we can evaluate the integral with anti-derivatives:

> F:='F': g:='g': G:='G':
g := z -> subs(Z=z,int(f(Z),Z)):
`F(x) ` = f(x);
`G(x) = `, int(F(x),x) = g(x);
`G(-oo)` = simplify(g(-infinity)),` and `,
`G(oo)` = simplify(g(infinity));
`G(oo) - G(-oo)` = g(infinity) - g(-infinity);
`G(oo) - G(-oo)` = simplify(g(infinity) - g(-infinity));
val := int(f(x),x=-infinity..infinity):
print(int(F(x),x=-infinity..infinity) = val);

`F(x) ` = 1/(x^2+1)

`G(x) =  `, int(F(x),x) = arctan(x)

`G(-oo)` = -1/2*Pi, `  and  `, `G(oo)` = arctan(inf...

`G(oo) - G(-oo)` = arctan(infinity)-arctan(-infinit...

`G(oo) - G(-oo)` = Pi

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

 

The above answer is correct too.

 

 

If f(z) = P(z)/Q(z) , where P and Q are polynomials, then f is called a rational function . You probably learned techniques in calculus to integrate certain types of rational functions. We now show how to use the residue theorem to obtain the Cauchy principal value of the integral of f over `(-`*infinity*`,`*infinity*`)` .

 

 

Theorem 8.3 Let f(z) = P(z)/Q(z) where P and Q are polynomials, of degree m and n , respectively.

If Q(x) <> 0 for all real x and m+2 <= n , then

 

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

where z[1] , z[2] , ..., z[k] are the poles of P/Q that lie in the upper half plane.

 


Example 8.15, Page 325. Use the residue calculus to evaluate the integral
int(1/((1+x^2)*(4+x^2)),x = -infinity .. infinity) ... .

 

> f:='f': F:='F': z:='z':
f := z -> 1/((z^2 + 1)*(z^2 + 4)):
`f(z) ` = f(z);

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

Find the singularities of f(z) = 1/((z^2+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;
z4 := subs(z=Zn[4],z): z[4] = z4;

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

`The singularities are:`

z[1] = I

z[2] = -2*I

z[3] = 2*I

z[4] = -I

 

Which poles lie in the upper half plane?

> 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));
print(`0 <`,Im(z[4]),` `, Im(z4)>0, evalb(evalf(Im(z4))>0));

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

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

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

`0 <`, Im(z[4]), `  `, 0 < -1, 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 residues at
z[1] and z[3] .

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

`Res[f`, I, `] ` = -1/6*I

`Res[f`, 2*I, `] ` = 1/12*I

 

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

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

`F(x)` = 1/((x^2+1)*(x^2+4))

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

 

Or, we can evaluate the integral with anti-derivatives:

> g := z -> subs(Z=z,int(f(Z),Z)):
`F(x) ` = f(x);
`G(x) =`, int(F(x),x) = g(x);
`G(-oo)` = simplify(g(-infinity)),` and `,
`G(oo)` = simplify(g(infinity));
`G(oo) - G(-oo)` = g(infinity) - g(-infinity);
`G(oo) - G(-oo)` = simplify(g(infinity) - g(-infinity));
val2 := int(f(x),x=-infinity..infinity):
print(int(F(x),x=-infinity..infinity) = val2);

`F(x) ` = 1/((x^2+1)*(x^2+4))

`G(x) =`, int(F(x),x) = 1/3*arctan(x)-1/6*arctan(1/...

`G(-oo)` = -1/12*Pi, `  and  `, `G(oo)` = 1/6*arcta...

`G(oo) - G(-oo)` = 1/6*arctan(infinity)-1/6*arctan(...

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

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

The above answer is correct too.

 


Example 8.16, Page 325. Use the residue calculus to evaluate the integral:
int(1/((x^2+4)^3),x = -infinity .. infinity) = 3*pi... .

> f:='f': F:='F': z:='z':
f := z -> 1/(z^2 + 4)^3:
`f(z) ` = f(z);

`f(z) ` = 1/((z^2+4)^3)

Find the singularities of f(z) = 1/((x^2+4)^3) .

> 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;
z4 := subs(z=Zn[4],z): z[4] = z4;
z5 := subs(z=Zn[5],z): z[5] = z5;
z6 := subs(z=Zn[6],z): z[6] = z6;

`For  f(z) ` = 1/((z^2+4)^3)

`The singularities are:`

z[1] = -2*I

z[2] = -2*I

z[3] = -2*I

z[4] = 2*I

z[5] = 2*I

z[6] = 2*I

 

Which poles lie in the upper half plane?

> 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));
print(`0 <`,Im(z[4]),` `,Im(z4)>0, evalb(evalf(Im(z4))>0));
print(`0 <`,Im(z[5]),` `,Im(z5)>0, evalb(evalf(Im(z5))>0));
print(`0 <`,Im(z[6]),` `,Im(z6)>0, evalb(evalf(Im(z6))>0));

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

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

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

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

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

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

 

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] .

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

`Res[f`, -2*I, `] ` = 3/512*I

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

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

`F(x)` = 1/((x^2+4)^3)

int(F(x),x = -infinity .. infinity) = -3/256*Pi

 

Or, we can evaluate the integral with anti-derivatives:

> G:='G':
g := z -> subs(Z=z,int(f(Z),Z)):
`F(x) ` = f(x);
`G(x) = `, int(F(x),x) = g(x);
print(`Now do the above computation with limits!`);
g1 := limit(g(z),z=-infinity):
g2 := limit(g(z),z= infinity):
Limit(G(x), x=-oo) = g1;
Limit(G(x), x=+oo) = g2;
`G(-oo) = ` = g1;
`G(oo) = ` = g2;
`G(oo) - G(-oo) = ` = g2 - g1;
val2 := int(f(x),x=-infinity..infinity):
print(int(F(x),x=-infinity..infinity) = val2);

`F(x) ` = 1/((x^2+4)^3)

`G(x) = `, int(F(x),x) = 1/16*x/(x^2+4)^2+3/128*x/(...

`Now do the above computation with limits!`

Limit(G(x),x = -oo) = -3/512*Pi

Limit(G(x),x = oo) = 3/512*Pi

`G(-oo) = ` = -3/512*Pi

`G(oo)  = ` = 3/512*Pi

`G(oo) - G(-oo) = ` = 3/256*Pi

int(F(x),x = -infinity .. infinity) = 3/256*Pi

 

The above answer is correct too.

 

End of Section 8.4.