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
is continuous on the interval
, then the improper integral of
over
is defined by
=
, provided that the limit exists.
Similarly, if
is continuous on the interval
, then the improper integral of
over
is defined by
=
, provided that the limit exists.
Theorem 8.5
Let
where
and
are polynomials with real
coefficients, of degree
and
,
respectively, where
.
If
has simple zeros at the points
,
, ...,
on the
axis, then
P. V.
,
,
, ...,
are the poles of
that lie in the upper half plane.
Theorem 8.6
Let
and
be polynomials of degree
and
,
respectively, where
, and let
have simple zeros at the
points
,
, ...,
on the
-
axis. If
is a positive real number and if
, then
,
and
,
,
, ...,
are the poles of
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
on the
-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:
.
> f:='f': F:='F':
z:='z':
f := z -> z/(z^3 - 8):
`f(z) ` = f(z);
Find the singularities of
.
> 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;
![]()
![]()
![]()
![]()
Which poles lie on the
-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));
![]()
![]()
![]()
![]()
![]()
![]()
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
on the real axis and
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
or
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;
![]()
![]()
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);


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));
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()

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

Find the singularities of
.
> 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;
![]()
![]()
![]()
![]()
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));
![]()
![]()
![]()
![]()
![]()
![]()
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
on the real axis and
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;
![]()
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);

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 !`);
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()
![]()

![]()
>
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
!`);

![]()
End of Section 8.6.