09 Contour Integration
09 Contour Integration
9. Contour Integration
Contour integration is a powerful technique, based on complex analysis, that allows
us to solve certain integrals that are otherwise hard or impossible to solve. Contour inte-
grals also have important applications in physics, particularly in the study of waves and
oscillations.
But since f takes complex inputs, the zn ’s don’t have to be on the real line. So instead of
going from a to b along the real line, we can imagine chaining together a sequence of points
z1 , z2 , . . . , zN in the complex plane, separated by displacements ∆z1 , ∆z2 , ∆z3 , . . . , ∆zN −1 :
In the limit N → ∞, each displacement ∆zn becomes infinitesimal, and the sequence of
points {z1 , z2 , . . . , zN } becomes a continuous trajectory in the complex plane (see Section
3.6). Such a trajectory is called a contour.
Let us denote a given contour by an abstract symbol, such as Γ. Then the contour
integral over Γ is defined as
Z NX−1
f (z) dz ≡ lim ∆zn f (zn ). (9.3)
Γ N →∞
n=1
63
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
The symbol Γ in the subscript of the integral sign indicates that the integral takes place
over the contour Γ. When defining a contour integral, it is always necessary to specify which
contour we are integrating over. Whereas for definite real integrals we only needed to specify
the end-points, for a contour integral it is not enough to just state the end-points—we need
to specify the entire contour that starts and ends at those points!
Moreover, the specification of a contour must include the direction along which the curve
is traversed. If we integrate along the same curve in the opposite direction, the value of the
contour integral switches sign (this is similar to swapping the end-points of a definite real
integral).
Note—Unlike a definite real integral, a contour integral does not have a geometrical
interpretation in terms of an “area under a curve”. It should be thought of as a gener-
alization of the algebraic (as opposed to geometric) concept of an integral.
Note—The contour should not be mistaken for the graph of the integrand! In many
contour integration problems, the contour is sketched for you as a curve in the complex
plane. Students who are new to contour integration sometimes mistake this for the
graph of the integrand.
The real numbers t1 and t2 specify two complex numbers, z(t1 ) and z(t2 ), which are the
end-points of the contour. The rest of the contour consists of the values of z(t) between those
end-points. Provided we can parameterize Γ in such a manner, the complex displacement
dz in the contour integral can be written as
dz
dz → dt . (9.5)
dt
Then we can express the contour integral over Γ as a definite integral over t:
Z Z t2
dz
dz f (z) = dt f z(t) . (9.6)
Γ t1 dt
This can then be calculated using standard integration techniques such as those discussed
in Chapter 3. A simple example is given in the next section.
64
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
where the contour Γ[R, θ1 , θ2 ] is a counter-clockwise arc of radius R > 0, from z1 = Reiθ1
to z2 = Reiθ2 :
Then the contour integral can be converted into a definite integral over the real variable θ:
Z Z θ2
n dz
dz z = dθ z n (9.9)
Γ[R,θ1 ,θ2 ] θ1 dθ
Z θ2 n
dθ Reiθ iR eiθ
= (9.10)
θ1
Z θ2
= iRn+1 dθ ei(n+1)θ . (9.11)
θ1
To proceed, there are two cases that we must treat separately. First, for n ̸= −1,
θ2 θ2
ei(n+1)θ ei(n+1)θ2 − ei(n+1)θ1
Z
i(n+1)θ
dθ e = = . (9.12)
θ1 i(n + 1) θ1 i(n + 1)
Second, we have the case n = −1. This cannot be handled by the above equations, since
the factor of n + 1 in the denominator would vanish. Instead,
Z θ2 h i Z θ2
dθ ei(n+1)θ = dθ = θ2 − θ1 . (9.13)
θ1 n=−1 θ1
which isHindependent of R as well as the choice of θ1 and θ2 . (Here, the special integration
symbol is used to indicate that the contour integral is taken over a loop.) This is a very
important result that we will make ample use of later.
65
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
By the way, what if n is not an integer? In that case, the integrand z n is multi-valued (as
we saw in Chapter 8). This is problematic, since the definition of a contour integral assumes
the integrand is a well-defined function. To get around this, we can specify a branch cut and
perform the contour integral with any of the branch functions of z n . So long as the branch
cut avoids intersecting with the contour Γ, the result obtained above by parametrizing the
contour integral remain valid. However, Γ cannot properly be taken along a complete loop,
as that would entail crossing the branch cut.
I
If f (z) is analytic everywhere inside a loop Γ, then dz f (z) = 0.
Γ
where S(Γ) denotes a two-dimensional surface enclosed by the loop Γ, and n̂ denotes a
normal vector sticking out of the surface at each integration point.
We only need the 2D version of Stokes’ theorem, in which both the loop Γ and the en-
⃗ y) likewise has no z component.
closed surface S(Γ) are restricted to the x−y plane, and A(x,
Then Stokes’ theorem simplifies to
I ZZ
⃗ ⃗ ∂Ay ∂Ax
dℓ · A = dx dy − . (9.17)
Γ S(Γ) ∂x ∂y
where Γ is a loop trajectory and f (z) is some analytic function that is analytic in the two-
dimensional domain S(Γ) enclosed by Γ. Let us decompose f into its real and imaginary
parts,
The analyticity of f implies that the real functions u and v are differentiable and obey the
Cauchy-Riemann equations (see Section 6.3).
66
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
The last expression is a line integral involving the complex vector field
⃗ y) = u(x, y) + iv(x, y) .
A(x, (9.23)
iu(x, y) − v(x, y)
Using Stokes’ theorem in 2D, we convert this into the area integral
ZZ ZZ
∂Ay ∂Ax ∂u ∂v ∂u ∂v
dx dy − = dx dy i − − +i (9.24)
S(Γ) ∂x ∂y S(Γ) ∂x ∂x ∂y ∂y
ZZ
∂v ∂u ∂u ∂v
= dx dy − + +i − . (9.25)
S(Γ) ∂x ∂y ∂x ∂y
On the last line, the two terms in parenthesis are both zero because, according to the
Cauchy-Riemann equations,
∂u ∂v ∂u ∂v
= and =− . (9.26)
∂x ∂y ∂y ∂x
Hence, the loop integral is zero. Q.E.D.
H
where zn denotes an integral over a loop of infinitesimal radius around the n-th point of
non-analyticity, in the same direction (i.e., clockwise or counter-clockwise) as Γ.
The proof is based on the figure below. The red loop, Γ, is the contour we want to
integrate over. The integrand is analytic throughout the enclosed area except at several
discrete points, say {z1 , z2 , z3 }. Let us define a new loop contour, Γ′ , shown by the blue
loop. It follows the same curve as Γ but with the following differences: (i) it circles in the
opposite direction from Γ, (ii) it contains tendrils that extend from the outer curve to each
point of non-analyticity, and (iii) each tendril is attached to an infinitesimal loop encircling
a point of non-analyticity.
67
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
The loop Γ′ encloses no points of non-analyticity, so Cauchy’s integral theorem says that
the integral over it is zero. But the contour integral over Γ′ can be broken up into three
pieces: (i) the part that follows Γ but in the opposite direction, (ii) the tendrils, and (iii)
the infinitesimal inner loops:
I
dz f (z) = 0 (by Cauchy′ s Integral Theorem) (9.28)
Γ′
Z Z X I
= dz f (z) + dz f (z) + dz f (z) (9.29)
big loop tendrils small loop n zn
H
The first term is equal to the negative of Γ dz f (z), since it follows a contour that is just
like Γ except going the other way. The second term is zero, because each tendril consists of
two contours taken in opposite directions, which cancel. Thus, the above equation reduces
to
I XI
dz f (z) = dz f (z). (9.30)
Γ n zn
The loop contour integral over Γ is equal to the sum of infinitesimal loop contour integrals
encircling each point of non-analyticity. Notably, each of the infinitesimal loops circles in
the same direction as Γ (e.g., counter-clockwise in the above figure).
Another way of thinking about this is that Cauchy’s integral theorem says regions of
analyticity don’t count towards the value of a loop integral. Hence, we can contract a loop
across any domain in which f (z) is analytic, until the contour becomes as small as possible.
This contraction replaces Γ with a discrete set of infinitesimal loops enclosing the points of
non-analyticity.
9.3 Poles
In the previous section, we referred to situations where f (z) is non-analytic at discrete
points. “Discrete”, in this context, means that each point of non-analyticity is surrounded
by a finite region over which f (z) is analytic, isolating it from other points of non-analyticity.
Such situations commonly arise from functions like
1
f (z) = , where n ∈ {1, 2, 3, . . . }. (9.31)
(z − z0 )n
For z = z0 , this function is non-analytic because its value is singular. We say that there is
a pole at z0 . The integer n is called the order of the pole.
68
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
Note that if f is analytic at z0 (i.e., there is no pole there), then Res[f (z), z = z0 ] = 0.
−5/3
f (z) = . (9.35)
z − i/3
69
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
where Γ is a counter-clockwise circular loop centered on the origin. This holds for any (non-
zero) loop radius. Combining this result with Eq. (9.27), we obtain the residue theorem:
where Γ[z0 ] denotes an infinitesimal loop around z0 . The + sign holds for a counter-
clockwise loop, and the − sign for a clockwise loop.
The plus sign holds if Γ is counter-clockwise, and the minus sign if it is clockwise.
By inspection, we can identify two poles: one at +i, with residue 1/2i, and the other at −i,
with residue −1/2i. The function is analytic everywhere else.
Suppose we integrate f (z) around a counter-clockwise contour Γ1 that encloses only the
pole at +i, as indicated by the blue curve in the figure below:
70
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
This loop integral can be decomposed into a sum of two contour integrals:
I Z ∞ Z
dz dx dz
= + . (9.52)
z2 + 1 −∞ x 2+1
arc z 2+1
71
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
The first term is equal to the integral we’re interested in. The second term is a contour
integral along the big arc, and we can show that it goes to zero. To see why, observe that
along an arc of radius R, the magnitude of the integrand goes as 1/R2 , while the dz gives
another factor of R (see the earlier example of parameterizing a contour integral over an arc
in Section 9.1.2), so the overall integral goes as 1/R, which vanishes as R → ∞.
Now to evaluate the loop contour integral. Since the loop encloses the pole at z = +i,
I
dz 1
= 2πi Res 2 , z = i = π. (9.53)
z2 + 1 z +1
The loop is counterclockwise, so we take the positive sign for the residue theorem. Hence,
Z ∞
dx
2
= π. (9.54)
−∞ x + 1
As an exercise, you can verify that closing the contour in the lower half-plane gives the same
result.
Let
Z
I= dz eiqz g(z), (9.55)
C
where q is any positive real constant, and the contour C which is a semi-circular arc of
radius R in the upper half-plane, centered at the origin. Then
In other words, if the factor of g(z) in the integrand does not blow up along the arc contour
(i.e., its value is bounded), then in the limit where the bounding value goes to zero, the
value of the entire integral vanishes.
Usually, the limit of interest is when the radius of the arc goes to infinity. Even if the
integrand vanishes in that limit, it may not be obvious that the integral I vanishes, as the
integration is taken along an arc of infinite length (so we have a 0 × ∞ sort of situation).
Jordan’s lemma then proves useful, because it provides a rigorous criterion for us to conclude
that I should vanish.
The proof for Jordan’s lemma is tedious, and we will not go into its details.
For integrands containing a prefactor of e−iqz rather than eiqz (again, where q ∈ R+ ),
a different version of Jordan’s lemma holds, referring to an arc contour C ′ in the lower
half-plane:
Let
Z
I= dz e−iqz g(z), (9.57)
C
where q is any positive real constant, and the contour C which is a semi-circular arc of
radius R in the lower half-plane, centered at the origin. Then
If g(z) < gmax for all z ∈ C ⇒ I → 0 as gmax → 0. (9.58)
72
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
This is easily seen by doing the change of variable z → −z on the original form of Jordan’s
lemma.
As a convenient way to remember which variant of Jordan’s lemma to use, think about
which end of imaginary axis causes the exponential factor to vanish:
eiqz z=i∞
= e−∞ = 0 ⇒ eiqz vanishes far above the origin. (9.59)
−iqz −∞ −iqz
e z=−i∞
=e =0 ⇒ e vanishes far below the origin. (9.60)
Hence, for eiqz (where q is any positive real number), the suppression occurs in the upper-
half-plane. For e−iqz , the suppression occurs in the lower-half-plane.
One possible approach is to break the cosine up into (eix + e−ix )/2, and do the contour
integral on each piece separately. Another approach, which saves a bit of effort, is to write
Z ∞
eix
I = Re dx 2 . (9.62)
−∞ 4x + 1
To do the integral, close the contour in the upper half-plane:
Then
∞
eiz eix eiz
I Z Z
dz 2 = dx 2 + dz . (9.63)
4z + 1 −∞ 4x + 1 arc 4z 2 + 1
On the right-hand side, the first term is what we want. The second term is a counter-
clockwise arc in the upper half-plane. According to Jordan’s lemma, this term goes to zero
as the arc radius goes to infinity, since the rest of the integrand goes to zero for large |z|:
1 1
∼ →0 as |z| → ∞. (9.64)
4z 2 + 1 4|z|2
As for the loop contour, it can be evaluated using the residue theorem:
eiz eiz
I
1 i
dz 2 = 2πi Res , z= (9.65)
4z + 1 4 (z + i/2)(z − i/2) 2
e−1/2
= 2πi . (9.66)
4i
73
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
Hence,
π π
I = Re √ = √ . (9.67)
2 e 2 e
In solving the integral this way, we must close the contour in the upper half-plane because
our choice of complex integrand was bounded in the upper half-plane. Alternatively, we
could have chosen to write
Z ∞
e−ix
I = Re dx 2 , (9.68)
−∞ 4x + 1
i.e., with e−ix rather than eix in the numerator. In that case, Jordan’s lemma tells us to
close the contour in the lower half-plane. The arc in the lower half-plane vanishes, as before,
while the loop contour is clockwise (contributing an extra minus sign) and encloses the lower
pole:
e−iz
I −iz
e i
dz 2 = −2πi Res , z = − (9.69)
4z + 1 4z 2 + 1 2
e−1/2
= −2πi (9.70)
−4i
π
= √ . (9.71)
2 e
Taking the real part, we obtain the same result as before.
Because of the series expansion of the sine function (see Section 1.2), the integrand does not
diverge at x = 0, and the integral is in fact convergent. The integral can be solved without
using complex numbers by using the arcane trick of differentiating under the integral sign
(see Section 2.6). But it can also be solved via contour integration.
We start by writing
Z ∞
eix
I = Im[I ′ ], where I ′ = dx . (9.73)
−∞ x
We want to calculate I ′ with the help of contour integration. But there’s something strange
about I ′ : the complex integrand has a pole at z = 0, right on the real line!
To handle this, we split I ′ into two integrals, one going over −∞ < x < −ϵ (where ϵ is
some positive infinitesimal), and the other over ϵ < x < ∞:
Z −ϵ Z ∞
eix eix
I ′ = lim dx + dx (9.74)
ϵ→0 −∞ x ϵ x
Z ∞
eix
≡P dx . (9.75)
−∞ x
In the last line, the notation P[· · · ] is short-hand for this procedure of “chopping away”
an infinitesimal segment surrounding the pole. This is called taking the principal value
of the integral. (Note: even though this bears the same name as the previously-discussed
74
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
“principal values” for multi-valued complex operations from Chapter 8, the two concepts
are unrelated.)
Now consider the loop contour shown in the figure below. The loop follows the principal-
value contour along the real axis, skips over the pole at z = 0 and arcs back along the
upper half-plane. Since it encloses no poles, the loop integral vanishes by Cauchy’s integral
theorem.
Intutively, since encircling a pole anticlockwise gives a factor of 2πi times the residue (which
is 1 in this case), a clockwise semi-circle is associated with a factor of −iπ. Finally, putting
everything together,
Z Z Z Z
f (z)dz = f (z)dz + f (z)dz + f (z)dz. (9.79)
Γ +Γ +Γ Γ Γ Γ
| 1 2 {z3 } | 1 {z } | 2 {z } | 3 {z }
= 0 (Cauchy’s integral theorem) = I′ = 0 (Jordan’s lemma) = −iπ
Hence,
This agrees with the result obtained by the method of differentiating under the integral sign
from Section 2.6.
Alternatively, we could have chosen the loop contour so that it skips below the pole at
z = 0. In that case, the loop integral would be non-zero, and can be evaluated using the
residue theorem. The final result is the same.
75
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
9.6 Exercises
1. Is the concept of a contour integral well-defined if the integrand f (z) is non-differentiable
along the contour? Why or why not?
2. In Section 9.4, we dealt with the integral
Z ∞
dx
. (9.81)
−∞ x2+1
Redo this calculation, but this time close the contour in the lower half-plane. Show
that the result is the same. [solution available]
3. Calculate Z ∞
1
dx . (9.82)
−∞ x4 +1
4. Calculate 2
Z ∞
sin(x)
dx . (9.83)
−∞ x
5. Calculate
∞
xλ
Z
dx , where − 1 < λ < 0. (9.84)
0 x+1
Hint: place the integrand’s branch cut along the positive real axis.
6. Solve the definite integral Z 2π
dϕ
I= , (9.85)
0 cos ϕ + 3
via the following steps. First, show that along a unit circle in the complex plane
centered at the origin,
1 1
cos ϕ = z+ , (9.86)
2 z
where
H z(ϕ) = exp(iϕ). Then define a complex function f (z) such that the loop integral
f (z) dz, taken over the circular contour, is equal to I. Hence, calculate I.
[solution available]
7. Suppose f (z) is analytic everywhere in the upper half-plane, including the real line,
and that its magnitude vanishes as 1/|z| or faster as |z| → ∞. Find the value of the
principal-value integral Z ∞
f (x)
P dx , (9.87)
−∞ x − a
where a is some real constant. Hence, prove that the real and imaginary parts of f
along the real line are related by
Z ∞
1 Im[f (w)]
Re f (x) = P dw (9.88)
π −∞ w − x
Z ∞
1 Re[f (w)]
Im f (x) = − P dw . (9.89)
π −∞ w − x
These are called the Kramers-Kronig relations. In physics, these relations impose
important constraints on the frequency dependence of the real and imaginary parts of
the dielectric function (the square of the complex refractive index).
[solution available]
76