4The calculus of residues
IB Complex Methods
4.2 Applications of the residue theorem
We now use the residue theorem to evaluate lots of real integrals.
Example. We shall evaluate
I =
Z
∞
0
dx
1 + x
2
,
which we can already do so by trigonometric substitution. While it is silly
to integrate this with the residue theorem here, since integrating directly is
much easier, this technique is a much more general method, and can be used
to integrate many other things. On the other hand, our standard tricks easily
become useless when we change the integrand a bit, and we need to find a
completely different method.
Consider
I
γ
dz
1 + z
2
,
where
γ
is the contour shown: from
−R
to
R
along the real axis (
γ
0
), then
returning to
−R
via a semicircle of radius
R
in the upper half plane (
γ
R
). This
is known as “closing in the upper-half plane”.
γ
0
γ
R
−R R
×
i
Now we have
1
1 + z
2
=
1
(z + i)(z − i)
.
So the only singularity enclosed by
γ
is a simple pole at
z
=
i
, where the residue
is
lim
z→i
1
z + i
=
1
2i
.
Hence
Z
γ
0
dz
1 + z
2
+
Z
γ
R
dz
1 + z
2
=
Z
γ
dz
1 + z
2
= 2πi ·
1
2i
= π.
Let’s now look at the terms individually. We know
Z
γ
0
dz
1 + z
2
=
Z
R
−R
dx
1 + x
2
→ 2I
as R → ∞. Also,
Z
γ
R
dz
1 + z
2
→ 0
as R → ∞ (see below). So we obtain in the limit
2I + 0 = π.
So
I =
π
2
.
Finally, we need to show that the integral about
γ
R
vanishes as
R → ∞
. This is
usually a bit tricky. We can use a formal or informal argument. We first do it
formally: by the triangle inequality, we know
|1 + z
2
| ≥ |1 − |z|
2
|.
On γ
R
, we know |z| = R. So for large R, we get
|1 + z
2
| ≥ 1 − R
2
= R
2
− 1.
Hence
1
|1 + z
2
|
≤
1
R
2
− 1
.
Thus we can bound the integral by
Z
γ
R
dz
1 + z
2
≤ πR ·
1
R
2
− 1
→ 0
as R → ∞.
We can also do this informally, by writing
Z
γ
R
dz
1 + z
2
≤ πR sup
z∈γ
R
1
1 + z
2
= πR · O(R
−2
) = O(R
−1
) → 0.
This example is not in itself impressive, but the method adapts easily to
more difficult integrals. For example, the same argument would allow us to
integrate
1
1+x
8
with ease.
Note that we could have “closed in the lower half-plane” instead.
−R
R
×
−i
Most of the argument would be unchanged; the residue would now be
res
z=−i
1
1 + z
2
= −
1
2i
,
but the contour is now traversed clockwise. So we collect another minus sign,
and obtain the same result.
Let’s do more examples.
Example. To find the integral
I =
Z
∞
0
dx
(x
2
+ a
2
)
2
,
where a > 0 is a real constant, consider the contour integral
Z
γ
dz
(z
2
+ a
2
)
2
,
where
γ
is exactly as above. The only singularity within
γ
is a pole of order 2 at
z = ia, at which the residue is
lim
z→ia
d
dz
1
(z + ia)
2
= lim
z→ia
−2
(z + ia)
3
=
−2
−8ia
3
= −
1
4
ia
−3
.
We also have to do the integral around
γ
R
. This still vanishes as
R → ∞
, since
Z
γ
R
dz
(z
2
+ a
2
)
2
≤ πR ·O(R
−4
) = O(R
−3
) → 0.
Therefore
2I = 2πi
−
1
4
ia
−3
.
So
I =
π
4a
3
.
Example. Consider
I =
Z
∞
0
dx
1 + x
4
.
We use the same contour again. There are simple poles of
1
1+z
4
at
e
πi/4
, e
3πi/4
, e
−πi/4
, e
−3πi/4
,
but only the first two are enclosed by the contour.
γ
0
γ
R
−R R
××
The residues at these two poles are −
1
4
e
πi/4
and +
1
4
e
−πi/4
respectively. Hence
2I = 2πi
−
1
4
e
πi/4
+
1
4
e
−πi/4
.
Working out some algebra, we find
I =
π
2
√
2
.
Example.
There is another way of doing the previous integral. Instead, we use
this quarter-circle as shown:
γ
0
γ
1
γ
2
iR
R
×
In words,
γ
consists of the real axis from 0 to
R
(
γ
0
); the arc circle from
R
to
iR (γ
1
); and the imaginary axis from iR to 0 (γ
2
).
Now
Z
γ
0
dz
1 + z
4
→ I as R → ∞,
and along γ
2
we substitute z = iy to obtain
Z
γ
0
dz
1 + z
4
=
Z
0
R
i
dy
1 + y
4
→ −iI as R → ∞.
Finally, the integral over
γ
1
vanishes as before. We enclose only one pole, which
makes the calculation a bit easier than what we did last time. In the limit, we
get
I − iI = 2πi
−
1
4
e
πi/4
,
and we again obtain
I =
π
2
√
2
.
Example. We now look at trigonometric integrals of the form :
Z
2π
0
f(sin θ, cos θ) dθ.
We substitute
z = e
iθ
, cos θ =
1
2
(z + z
−1
), sin θ =
1
2i
(z − z
−1
).
We then end up with a closed contour integral.
For example, consider the integral
I =
Z
2π
0
dθ
a + cos θ
,
where
a >
1. We substitute
z
=
e
iθ
, so that d
z
=
iz
d
θ
and
cos θ
=
1
2
(
z
+
z
−1
).
As
θ
increases from 1 to 2
π
,
z
moves round the circle
γ
of radius 1 in the complex
plane. Hence
I =
I
γ
(iz)
−1
dz
a +
1
2
(z + z
−1
)
= −2i
I
γ
dz
z
2
+ 2az + 1
.
γ
×
z
−
×
z
+
We now solve the quadratic to obtain the poles, which happen to be
z
±
= −a ±
p
a
2
− 1.
With some careful thinking, we realize
z
+
is inside the circle, while
z
−
is outside.
To find the residue, we notice the integrand is equal to
1
(z − z
+
)(z − z
−
)
.
So the residue at z = z
+
is
1
z
+
− z
−
=
1
2
√
a
2
− 1
.
Hence
I = −2i
2πi
2
√
a
2
− 1
=
2π
√
a
2
− 1
.
Example.
Integrating a function with a branch cut is a bit more tricky, and
requires a “keyhole contour”. Suppose we want to integrate
I =
Z
∞
0
x
α
1 +
√
2x + x
2
dx,
with
−
1
< α <
1 so that the integral converges. We need a branch cut for
z
α
.
We take our branch cut to be along the positive real axis, and define
z
α
= r
α
e
iαθ
,
where z = re
iθ
and 0 ≤ θ < 2π. We use the following keyhole contour:
C
R
C
ε
×
e
5πi/4
×
e
3πi/4
This consists of a large circle
C
R
of radius
R
, a small circle
C
ε
of radius
ε
, and
the two lines just above and below the branch cut. The idea is to simultaneously
take the limit ε → 0 and R → ∞.
We have four integrals to work out. The first is
Z
γ
R
z
α
1 +
√
2z + z
2
dz = O(R
α−2
) · 2πR = O(R
α−1
) → 0
as
R → ∞
. To obtain the contribution from
γ
ε
, we substitute
z
=
εe
iθ
, and
obtain
Z
0
2π
ε
α
e
iαθ
1 +
√
2εe
iθ
+ ε
2
e
2iθ
iεe
iθ
dθ = O(ε
α+1
) → 0.
Finally, we look at the integrals above and below the branch cut. The contribution
from just above the branch cut is
Z
R
ε
x
α
1 +
√
2x + x
2
dx → I.
Similarly, the integral below is
Z
ε
R
x
α
e
2απi
1 +
√
2x + x
2
→ −e
2απi
I.
So we get
I
γ
z
α
1 +
√
2z + z
2
dz → (1 −e
2απi
)I.
All that remains is to compute the residues. We write the integrand as
z
α
(z − e
3eπi/4
)(z − e
5πi/4
)
.
So the poles are at z
0
= e
3πi/4
and z
1
= e
5πi/4
. The residues are
e
3απi/4
√
2i
,
e
5απi/4
−
√
2i
respectively. Hence we know
(1 − e
2απi
)I = 2πi
e
3απi/4
√
2i
+
e
5απi/4
−
√
2i
.
In other words, we get
e
απi
(e
−απi
− e
απi
)I =
√
2πe
απi
(e
−απi/4
− e
απi/4
).
Thus we have
I =
√
2π
sin(απ/4)
sin(απ)
.
Note that we we labeled the poles as
e
3πi/4
and
e
5πi/4
. The second point is the
same point as
e
−3πi/4
, but it would be wrong to label it like that. We have
decided at the beginning to pick the branch such that 0
≤ θ <
2
π
, and
−
3
πi/
4
is not in that range. If we wrote it as
e
−3πi/4
instead, we might have got the
residue as e
−3απi/4
/(−
√
2i), which is not the same as e
5απi/4
/(−
√
2i).
Note that the need of a branch cut does not mean we must use a keyhole
contour. Sometimes, we can get away with the branch cut and contour chosen
as follows:
−R
ε ε
R
×
i