Professional Documents
Culture Documents
8. Contour Integration
Contour integration is a powerful technique, based on complex analysis, that allows
us to calculate certain integrals that are otherwise difficult or impossible to do. Contour
integrals have important applications in many areas of physics, particularly in the study
of waves and oscillations. We will see these applications later, when discussing Fourier
transforms and Green’s functions.
However, since f takes complex inputs, the values of zn need not lie along the real line. In
general, the complex numbers zn form a set of points in the two-dimensional complex plane.
We can imagine chaining together a sequence of points z1 , z2 , . . . , zN , which are separated
by displacements ∆z1 , ∆z2 , ∆z3 , . . . , ∆zN −1 , such that
z2 = z1 + ∆z1 ,
z3 = z2 + ∆z2 ,
z4 = z3 + ∆z3 , (3)
.. ..
.=.
zN = zN −1 + ∆zN −1 .
This is shown in the figure below:
55
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
Suppose we fix the end-points z1 and zN , and take the limit N → ∞, so that each displace-
ment ∆zn becomes infinitesimal. Then the sequence of points {z1 , z2 , . . . , zN } turns into
a continuous trajectory in the complex plane, with a certain starting point and end-point.
Such a trajectory is called a contour, and can be denoted by an abstract symbol, such as
Γ. Now we can define a contour integral over Γ, like this:
Z N
X −1
f (z) dz = lim ∆zn f (zn ). (5)
Γ N →∞
n=1
The symbol Γ in the subscript of the integral sign indicates that the integral is to take place
over the contour Γ. It is always necessary, when defining a contour integral, to specify the
contour to integrate over. This is roughly analogous to how we need to specify the ends of
the integration range, in order to properly define a real definite integral. In the complex
case, we must specify an entire trajectory.
It is important to note that the contour Γ specifies a direction. In fact, if we integrate
along the curve in the opposite direction, the value of the contour integral switches sign.
The real numbers t1 and t2 specify two complex numbers, z(t1 ) and z(t2 ), which correspond
to the end-points of the contour. The rest of the contour is given by the values of z(t)
between these two end-points. Assuming we are able to parameterize Γ in this way, we can
express the complex displacement dz in the contour integral by
dz
dz → dt . (8)
dt
This allows us to express the contour integral over Γ as a definite integral over t:
Z Z t2
dz
dz f (z) = dt f z(t) . (9)
Γ t1 dt
The resulting definite integral can then be evaluated using standard integration techniques.
A simple example is given in the following section.
where the trajectory Γ[θ1 , θ2 ] is shown in the figure below. It consists of a counter-clockwise
arc of radius R > 0, from a starting point z1 = Reiθ1 to endpoint z2 = Reiθ2 .
56
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
Then the contour integral can be converted into an integral over the real parameter θ:
Z Z θ2
dz
dz z n = dθ z n (12)
Γ[θ1 ,θ2 ] θ1 dθ
Z θ2
dθ Rn einθ iR eiθ
= (13)
θ1
Z θ2
= iRn+1 dθ ei(n+1)θ (14)
θ1
To proceed, there are two distinct cases that we need to handle separately. Firstly, if n 6= −1,
then we can evaluate the integral on the last line as follows:
θ2 θ2
ei(n+1)θ
Z
i(n+1)θ
dθ e = (15)
θ1 i(n + 1) θ1
ei(n+1)θ2 − ei(n+1)θ1
= (16)
i(n + 1)
However, this doesn’t apply if n = −1, since the factor of n + 1 in the denominator would
vanish. Instead, in this case, the integrand is identically one, so we do the integral in a
different way:
Z θ2 Z θ2
i(n+1)θ
dθ e = dθ (17)
θ1 θ1
= θ2 − θ1 (18)
57
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
R > 0). It is zero for all values of n except n = −1. For the special case n = −1, the contour
integral takes the value 2πi. This is an important result that we’ll use again later.
In this example, we have assumed that n ∈ Z. How about non-integer values of n?
As we previously discussed in Chapter 7, the integrand z n is a multi-valued operation if
n∈/ Z. The concept of a contour integral only makes sense if the integrand is a well-defined
function, which means that we need to specify a branch cut and only take values of z n along
a given branch. So long as the branch cut avoids intersecting with the contour Γ, the results
obtained above remain mathematically valid. However, we cannot take Γ to be a complete
loop, because then there would be no way to avoid crossing a branch cut. Such an integral
would not be well-defined.
Theorem I
If f (z) is analytic everywhere inside the 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 will only need the 2D version of Stokes’ theorem, in which the loop Γ, as well as
~ y) has no z
the surface S(Γ), are restricted to the x−y plane. We also assume that A(x,
component, so that it too lies in the x−y plane. In that case, Stokes’ theorem reduces to
the simplified form I ZZ
~ ~ ∂Ay ∂Ax
d` · A = dx dy − . (22)
Γ S(Γ) ∂x ∂y
To prove Cauchy’s integral theorem, consider the contour integral
I
dz f (z), (23)
Γ
where Γ is a loop trajectory and f (z) is some analytic function that is analytic in the domain
S(Γ). We can decompose f into its real and imaginary parts,
58
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
where u and v are real functions of x and y. The analyticity of f implies that the functions
u and v are real-differentiable and obey the Cauchy-Riemann equations (see Chapter 6):
∂u ∂v ∂u ∂v
= , =− . (25)
∂x ∂y ∂y ∂x
With this in mind, we can manipulate the contour integral as follows:
I I
dz f (z) = (dx + idy) (u + iv) (26)
Γ
IΓ
= dx (u + iv) + dy (iu − v) (27)
IΓ
dx u + iv
= · (28)
dy iu − v
IΓ
= ~ · A.
d` ~ (29)
Γ
The last expression is a line integral involving the complex vector field
~ u(x, y) + iv(x, y)
A(x, y) = . (30)
iu(x, y) − v(x, y)
Using Stokes’ theorem in 2D, we can convert this into an area integral:
ZZ ZZ
∂Ay ∂Ax ∂u ∂v ∂u ∂v
dx dy − = dx dy i − − +i (31)
S(Γ) ∂x ∂y S(Γ) ∂x ∂x ∂y ∂y
ZZ
∂v ∂u ∂u ∂v
= dx dy − + +i − . (32)
S(Γ) ∂x ∂y ∂x ∂y
Applying the Cauchy-Riemann equations, we find that the integrand vanishes. Hence, the
loop integral of f (z) is zero; QED.
59
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
The red loop, Γ, is the contour we want to integrate over. The integrand is non-analytic
at several points inside Γ. We can define a new loop contour, Γ0 , which mostly follows the
same path as Γ except for the following features: (i) it circles in the opposite direction from
Γ, and (ii) it has “tendrils” that snake in towards each point of non-analyticity, and (iii)
each tendril is attached to an infinitesimal loop that encircles the point of non-analyticity.
The loop contour integral over Γ0 encloses no points of non-analyticity, so Cauchy’s
integral theorem says that its total value is zero. But we can also break up this loop contour
integral into three distinct pieces: (i) the part that follows the loop Γ, but going in the
opposite direction, (ii) the “tendrils” that connect the big loop to the inner loops, and (iii)
the infinitesimal inner loops encircling each point of non-analyticity:
I
dz f (z) = 0 (by Cauchy0 s Integral Theorem)
Γ0
Z Z XI (34)
= dz f (z) + dz f (z) + dz f (z)
big loop tendrils 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 out. Thus, Eq. (34) reduces to
I XI
dz f (z) = dz f (z). (35)
Γ n zn
This says that the loop contour integral over Γ is equal to the sum of infinitesimal loop
contour integrals encircling each point of non-analyticity. Moreover, each of these infinitesi-
mal loops circles in the same direction as the loop contour Γ (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 “shrink” a
loop down across any region of the complex plane where f (z) is analytic, until the contour
becomes as small as it can get. This replaces Γ with a discrete set of infinitesimal loops
enclosing the points of non-analyticity. Similarly, if f (z) doesn’t just have isolated points of
non-analyticity but also possesses branch cuts, then the loop integral can be “shrunk down”
into infinitesimal loops surrounding each branch cut.
8.3 Poles
In the previous section, we referred to situations where f (z) becomes non-analytic at discrete
points. “Discrete”, in this context, means that each point is isolated from other points of
non-analyticity. In other words, the point is surrounded by a domain in which f (z) is
analytic.
The most common situation in which this occurs is with a function like
A
f (z) ≈ , where n ∈ {1, 2, 3, . . . }. (36)
(z − z0 )n
For z = z0 , the function is non-analytic because its value is singular. Such a function is said
to have a pole at z0 . The integer n is called the order of the pole.
60
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
In this case, the complex numerator A is called the residue of the pole (so-called because
it’s what’s left-over if we take away the singular factor corresponding to the pole.) The
residue of a function at a point z0 is commonly denoted Res[f (z0 )]. Note that if a function
is analytic at z0 , then Res[f (z0 )] = 0.
Example
The function
5
f (z) = (38)
i − 3z
has a simple pole at z = i/3. The residue at that point is −5/3 (and not 5, which is a
common mistake). To extract the residue, we need to separate out the pre-factor of z
in the denominator:
5 −(5/3)
f (z) = = (39)
i − 3z z − i/3
⇒ Res f (z) z=−i/3 = −5/3. (40)
Example
The function
z z
f (z) = = (41)
z2 + 1 (z + i)(z − i)
has two simple poles, at z = ±i. Consider the pole at z = i. To calculate its residue, we
separate the divergent part from the rest of the expression:
z
z+i
f (z) = (42)
z−i
z
⇒ Res f (z) z=i = = 1/2. (43)
z + i z=i
Theorem
For any analytic function f (z) with a simple pole at z0 ,
I
dz f (z) = ±2πi Res f (z) z=z , (45)
0
Γ[z0 ]
where Γ[z0 ] denotes an infinitesimal loop around z0 . The + sign holds for a counter-
clockwise loop, and the − sign for a clockwise loop.
By combining the residue theorem with the results of the last few sections, we arrive at
a technique known as the calculus of residues, which prescribes the following method for
61
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
• Check that these are all simple poles, and that f (z) has no other non-analytic behaviors
(e.g. branch cuts) in the enclosed region.
• Calculate the residue, Res[f (zn )], at each pole zn .
• The value of the loop integral is
I X
dz f (z) = ±2πi Res f (z) z=zn , (46)
Γ n
On the other hand, suppose we integrate around a contour Γ2 that encloses both poles. Then
the result is I
1 1
dz f (z) = 2πi · − = 0. (52)
Γ2 2i 2i
62
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
This integral is taken over real values of x, and we have previously solved it using a change
of variables (see Chapter 2). Now let’s solve it using contour integration. The first step is to
generalize the integrand from a function of x to an analytic function of z. This procedure is
called analytic continuation. Usually, we choose the new (complex) integrand so that it
reduces to the old integrand for z ∈ R, and is analytic over a broad domain. In this specific
example, we let
1 1
→ 2 , (54)
x2 + 1 z +1
which is the complex integrand we just studied in the previous section. Hence, we will be
interested in the contour integral Z
dz
2
. (55)
z +1
We now have to determine the contour to take this integral over. The usual procedure
is to define a closed (loop) contour, such that one segment of the loop is the real line (from
−∞ to +∞), and the other segment of the loop “doubles back” in the complex plane to
close the loop. This is called closing the contour.
Here, we choose to close the contour along an anticlockwise semicircular arc in the upper
half of the complex plane, as shown in the figure below:
(Note that the loop is counterclockwise, so we take the positive sign for the residue theorem.)
On the other hand, the loop integral can be written as a sum of two integrals:
I Z ∞ Z
dz dx dz
= + . (57)
z2 + 1 −∞ x2+1
arc z 2+1
The first term is the integral we’re interested in. The second term, the contour integral along
the arc, goes to zero. To see why, observe that along an arc of radius R, the magnitude
63
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
of the integrand is approximately 1/R2 , while the dz gives another factor of R (for more
details, see the example in Section 8.1.2 of parameterizing a contour integral over an arc).
Hence, the integral over the arc goes as 1/R, which vanishes as R → ∞.
We thus obtain Z ∞
dx
2+1
=π (58)
−∞ x
As an exercise, try showing for yourself that we could also have closed the contour in the
lower half-plane, and that this leads to exactly the same result.
taken over a contour C which is a semi-circular arc of radius R lying in the upper half-plane
and centered at the origin. Jordan’s lemma states that if f is non-infinite along C, i.e.
f (z) < Fmax for z ∈ C, (60)
then the integral I is a finite number that goes to zero as Fmax → 0. The proof is straight-
forward but tedious, and we will not go into its details.
For integrands containing e−iz rather than eiz , Jordan’s lemma holds for contours in the
lower half-plane. A convenient way to remember this is to look at what happens along the
imaginary axis, at ±i∞:
64
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
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 goes to zero as the
arc radius goes to infinity, since the rest of the integrand goes to zero far from the origin:
1 1
4z 2 + 1 ∼ 4|z|2 → 0 as |z| → ∞. (65)
As for the loop contour on the left-hand side of Eq. (64), it can be evaluated using the
residue theorem:
eiz eiz
I
dz 2 = Res (66)
4z + 1 4z 2 + 1 enclosed poles
eiz
1
= 2πi Res (67)
4 (z + i/2)(z − i/2) z=i/2
e−1/2
= 2πi . (68)
4i
Hence,
π π
I = Re √ = √ . (69)
2 e 2 e
In solving the integral this way, we chose to close the contour in the upper half-plane because
our choice of complex integrand was bounded in the upper half-plane. However, there is
more than one way to write the complex integrand. We could equally well have chosen to
write Z ∞
e−ix
I = Re dx 2 , (70)
−∞ 4x + 1
i.e., putting 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 (which contributes an extra minus sign), and encloses
the lower pole:
e−iz
I −iz
e
dz 2 = −2πi Res (71)
4z + 1 4z 2 + 1 z=−i/2
e−1/2
= −2πi (72)
−4i
π
= √ . (73)
2 e
Taking the real part of this, we obtain exactly the same result as before.
65
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
numbers, via the arcane trick of differentiating under the integral sign (Chapter 2). As we’ll
now see, it’s much more straightforward to solve it by using contour integration.
We start by writing
Z ∞
0 0 eix
I = Im(I ), where I = dx . (75)
−∞ x
Our goal is to calculate I 0 using contour integral techniques. But there’s something strange
about I 0 : its complex integrand has a pole at z = 0, right on the contour! To handle it, we
need to tweak the definition of I 0 so that it is the sum of two integrals, where one goes over
−∞ < x < − (where is some positive infinitesimal), and the other goes over < x < ∞:
Z − Z ∞
eix eix
0
I = lim dx + dx (76)
→0 −∞ x x
Z ∞
eix
≡P dx . (77)
−∞ x
In the last line, the notation P[· · · ] is short-hand for this procedure of “chopping away” an
infinitesimal contour segment surrounding the pole. This is called “taking the principal
value” of the integral. (Note: even though this bears the same name as the “principal
values” for multi-valued complex operations, there is no conceptual connection, so don’t get
confused.)
Now, we can evaluate I 0 via the loop contour shown in the figure below:
The loop follows the principal-value contour along the real axis, skipping over the pole at
z = 0 and arcing back along the upper half-plane. Because it encloses no poles, the loop
integral vanishes by Cauchy’s integral theorem.
Moreover, the loop can be decomposed into several pieces: (i) the segments along the real
axis, which correspond to the principal-value contour, (ii) a large counter-clockwise semi-
circular arc, and (iii) an infinitesimal clockwise semi-circular arc skipping around z = 0.
The large arc vanishes by Jordan’s lemma. Thus, we only need to find piece (iii), the
infinitesimal semi-circular arc skipping over the pole. This can be done by parameterizing
the contour integral:
Z 0 i exp(iθ)
eiz
Z
e
ieiθ dθ
= lim iθ
(78)
(small arc) z →0 π e
Z 0
= lim i dθ (79)
→0 π
= −iπ. (80)
This is basically the same calculation we worked out in our first example of contour inte-
gration. And it’s also what we expect from the residue theorem: since encircling a pole
anticlockwise gives a factor of 2πi times the residue (which is 1 in this case), a semi-circular
clockwise arc ought to give a factor of −iπ.
Finally, putting everything together,
0 = I 0 − iπ + 0 ⇒ I 0 = iπ ⇒ I = Im(I 0 ) = π. (81)
66
Y. D. Chong (2016) MH2801: Complex Methods for the Sciences
This agrees with the result obtained by the method of differentiating under the integral sign
in Chapter 2.
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 outcome is the same.
8.5 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. Re-do the integral calculated in Section 8.3.3:
Z ∞
dx
2
. (82)
−∞ x + 1
This time, close the contour in the lower half-plane; show that the result is the same.
3. Calculate Z ∞
1
dx . (83)
−∞ x4 +1
4. Calculate 2
Z ∞
sin(x)
dx . (84)
−∞ x
5. Calculate
∞
xλ
Z
dx , where − 1 < λ < 0. (85)
0 x+1
Hint: place the integrand’s branch cut along the positive real axis.
67