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.2 Calculation of Residues

The calculation of a Laurent series expansion is tedious in most circumstances. Since the residue at z[0] involves only the coefficient a[-1] in the Laurent expansion, we seek a method to calculate the residue from special information about the nature of the singularity at z[0] .

If
f has a removable singularity at z[0] , then a[-1] = 0 for n = 1, 2, `...` . Therefore if z[0] is a removable singularity, then `Res[`*f*`,`*z[0]*`]` = 0 . The following theorem gives methods for evaluating residues at poles.

 

Theorem 8.2 (Residues at Poles)

 

(i) If f has a simple pole at z[0] , then Res[f, z[0] ] = Limit((z-z[0])*f(z),z = z[0]) .

(ii) If f has a pole of order 2 at z[0] , then Res[f, z[0] ] = Limit(Diff((z-z[0])^2*f(z),z),z = z[0]) .

(iii) If f has a pole of order 3 at z[0] , then Res[f, z[0] ] = 1/`2!` Limit(Diff((z-z[0])^3*f(z),z,z),z = z[0]) .

 

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

> readlib(residue):


Example 8.4, Page 311. Find the residue of f(z) = pi*cot(pi*z)/(z^2) at z[0] = 0 .

> f:='f': z:='z':
f := z -> Pi*cot(Pi*z)/z^2:
`f(z) ` = f(z);

`f(z) ` = Pi*cot(Pi*z)/z^2

 

The function f(z) has a pole of order 3 at z[0] = 0 .
Next, the residue at
z[0] = 0 is determined using derivatives:

> `z^3 f(z) ` = z^3 * f(z);
D1 := diff(z^3 * f(z), z):
D2 := factor(diff(z^3 * f(z), z$2)):
L := 1/2! * limit(D2, z=0):
Diff(z^3*`f(z)`,z) = D1;
Diff(z^3*`f(z)`,z$2) = D2;
Limit(Diff(z^3*`f(z)`,z$2),z=0)/2! = L;

`z^3 f(z) ` = z*Pi*cot(Pi*z)

Diff(z^3*`f(z)`,z) = Pi*cot(Pi*z)+z*Pi^2*(-1-cot(Pi...

Diff(z^3*`f(z)`,`$`(z,2)) = 2*Pi^2*(1+cot(Pi*z)^2)*...

1/2*Limit(Diff(z^3*`f(z)`,`$`(z,2)),z = 0) = -1/3*P...

 

We compare this with Maple's residue procedure for computing residues.

> `f(z) ` = f(z);
`Res[f,0] ` = residue(f(z), z=0);

`f(z) ` = Pi*cot(Pi*z)/z^2

`Res[f,0] ` = -1/3*Pi^2

 

Which is the coefficient of 1/z in the Laurent series expansion for f(z) .

> `f(z) ` = f(z);
`f(z) ` = series(f(z), z=0, 7);

`f(z) ` = Pi*cot(Pi*z)/z^2

`f(z) ` = series(1*z^(-3)+(-1/3*Pi^2)*z^(-1)+(-1/45...

 

Example 8.5, Page 312. Use residues to integrate int(1/(z^4+z^3-2*z^2),z = C .. `   `) around C : abs(z) = 3 .

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

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

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

> 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^4+z^3-2*z^2)

`The singularities are:`

z[1] = -2

z[2] = 0

z[3] = 0

z[4] = 1

 

Find out which singularities lie within a circle abs(z) < 3 .

> print(abs(z[1]) ,`< 3 `, abs(z1)<3, evalb(evalf(abs(z1))<3));
print(abs(z[2]) ,`< 3 `, abs(z2)<3, evalb(evalf(abs(z2))<3));
print(abs(z[3]) ,`< 3 `, abs(z3)<3, evalb(evalf(abs(z3))<3));
print(abs(z[4]) ,`< 3 `, abs(z4)<3, evalb(evalf(abs(z4))<3));

abs(z[1]), `< 3   `, 2 < 3, true

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

abs(z[3]), `< 3   `, 0 < 3, true

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

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

`Res[f`, -2, `] ` = -1/12

`Res[f`, 0, `] ` = -1/4

`Res[f`, 1, `] ` = 1/3

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

> `f(z)` = f(z);
val := 2*Pi*I*(r1 + r2 + r4):
Int(f(z),z=C..``) = val;

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

Int(1/(z^4+z^3-2*z^2),z = C .. ``) = 0

 

Example 8.6, Page 312. Use residues to integrate int(1/(z^4+4),z = C .. `   `) around C : abs(z-1) = 2 .

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

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

 

Find the singularities of f(z) = 1/(z^4+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^4+4)

`The singularities are:`

z[1] = 1+I

z[2] = 1-I

z[3] = -1-I

z[4] = -1+I

 

Find out which singularities lie within a circle abs(z-1) < 2 .

> print(abs(z[1]-1),`< 2 `,abs(z1-1)<2, evalb(evalf(abs(z1-1))<2));
print(abs(z[2]-1),`< 2 `,abs(z2-1)<2, evalb(evalf(abs(z2-1))<2));
print(abs(z[3]-1),`< 2 `,abs(z3-1)<2, evalb(evalf(abs(z3-1))<2));
print(abs(z[4]-1),`< 2 `,abs(z4-1)<2, evalb(evalf(abs(z4-1))<2));

abs(z[1]-1), `< 2   `, 1 < 2, true

abs(z[2]-1), `< 2   `, 1 < 2, true

abs(z[3]-1), `< 2   `, sqrt(5) < 2, false

abs(z[4]-1), `< 2   `, sqrt(5) < 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] and z[2] .

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

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

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

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

> val := 2*Pi*(r1 + r2):
Int(f(z),z=C..``) = val;

Int(1/(z^4+4),z = C .. ``) = -1/4*Pi

 

Example 8.8, Page 314. Find the partial fraction expansion of f(z) = (3*z+2)/(z*(z-1)*(z-2)) .

> f:='f': z:='z':
f := z -> (3*z + 2)/(z*(z - 1)*(z - 2)):
Zn := sort([solve(denom(f(z))=0, z)]):
Rn := array(1..nops(Zn)):
Sn := array(1..nops(Zn)):
F := 0:
for i from 1 to nops(Zn) do
if i=1 then p:=1 fi;
if 1<i and Zn[i-1]=Zn[i] then
p := p+1 else p := 1 fi;
Rn[i] := residue((z-Zn[i])^(p-1)*f(z), z=Zn[i]);
Sn[i] := Rn[i]/(z-Zn[i])^p;
F := F + Rn[i]/(z-Zn[i])^p;
od:
Z := array(1..nops(F)):
R := array(1..nops(F)):
S := array(1..nops(F)):
p := 1:
for i from 1 to nops(Zn) do
if Sn[i]<>0 then
Z[p]:=Zn[i]; R[p]:=Rn[i]; S[p]:=Sn[i]; p:=p+1 fi;
od:
`f(z) ` = f(z);
print(`Singularities of f(z)`, Z);
`f(z) ` = F;

`f(z) ` = (3*z+2)/z/(z-1)/(z-2)

`Singularities of f(z)`, vector([0, 1, 2])

`f(z) ` = 1/z-5/(z-1)+4/(z-2)

Compare this with Maple's "parfrac" procedure for the partial fraction expansion.

> `f(z) ` = f(z);
`f(z) ` = convert(f(z), parfrac, z);

`f(z) ` = (3*z+2)/z/(z-1)/(z-2)

`f(z) ` = 1/z-5/(z-1)+4/(z-2)

 

Example 8.9, Page 315. Find the partial fraction expansion of f(z) = (z^2+3*z+2)/(z^2*(z-1)) .

> f:='f': z:='z':
f := z -> (z^2 + 3*z + 2)/(z^2 *(z - 1)):
Zn := sort([solve(denom(f(z))=0, z)]):
Rn := array(1..nops(Zn)):
Sn := array(1..nops(Zn)):
F := 0:
for i from 1 to nops(Zn) do
if i=1 then p:=1 fi;
if 1<i and Zn[i-1]=Zn[i] then
p := p+1 else p := 1 fi;
Rn[i] := residue((z-Zn[i])^(p-1)*f(z), z=Zn[i]);
Sn[i] := Rn[i]/(z-Zn[i])^p;
F := F + Rn[i]/(z-Zn[i])^p;
od:
Z := array(1..nops(F)):
R := array(1..nops(F)):
S := array(1..nops(F)):
p := 1:
for i from 1 to nops(Zn) do
if Sn[i]<>0 then
Z[p]:=Zn[i]; R[p]:=Rn[i]; S[p]:=Sn[i]; p:=p+1 fi;
od:
`f(z) ` = f(z);
print(`Singularities of f(z)`, Z);
`f(z) ` = F;

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

`Singularities of f(z)`, vector([0, 0, 1])

`f(z) ` = -5*1/z-2/z^2+6/(z-1)

 

Compare this with Maple's "parfrac" procedure for the partial fraction expansion.

> `f(z) ` = f(z);
`f(z) ` = convert(f(z), parfrac, z);

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

`f(z) ` = -5*1/z-2/z^2+6/(z-1)

 

An Extra Example, Page 314. Find the partial fraction expansion of f(z) = 1/(z^4-1) .

> f:='f': z:='z':
f := z -> 1/(z^4 - 1):
Zn := sort([solve(denom(f(z))=0, z)]):
Rn := array(1..nops(Zn)):
Sn := array(1..nops(Zn)):
F := 0:
for i from 1 to nops(Zn) do
if i=1 then p:=1 fi;
if 1<i and Zn[i-1]=Zn[i] then
p := p+1 else p := 1 fi;
Rn[i] := residue((z-Zn[i])^(p-1)*f(z), z=Zn[i]);
Sn[i] := Rn[i]/(z-Zn[i])^p;
F := F + Rn[i]/(z-Zn[i])^p;
od:
Z := array(1..nops(F)):
R := array(1..nops(F)):
S := array(1..nops(F)):
p := 1:
for i from 1 to nops(Zn) do
if Sn[i]<>0 then
Z[p]:=Zn[i]; R[p]:=Rn[i]; S[p]:=Sn[i]; p:=p+1 fi;
od:
`f(z) ` = f(z);
print(`Singularities of f(z)`, Z);
`f(z) ` = F;

`f(z) ` = 1/(z^4-1)

`Singularities of f(z)`, vector([1, I, -I, -1])

`f(z) ` = 1/4*1/(z-1)+1/4*I/(z-I)-1/4*I/(z+I)-1/4*1...

 

Compare this with Maple's "parfrac" procedure for the partial fraction expansion.

> `f(z) ` = f(z);
`f(z) ` = convert(f(z), parfrac, z);

`f(z) ` = 1/(z^4-1)

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

 

Notice that Maple does not expand the quadratic term involving z^2+1 .

 

End of Section 8.2.