08 Contour Integrationvhdhd
08 Contour Integrationvhdhd
8 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 integrals also
have important applications in physics, particularly in the study of waves and oscillations.
But there’s a conceptual snag: 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
complex plane. To accomodate this, we can imagine chaining together a sequence of points
z1 , z2 , . . . , zN , 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 N
X −1
f (z) dz = lim ∆zn f (zn ). (4)
Γ N →∞
n=1
59
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. This is analogous to specifying the end-points of the interval
over which to perform a definite real integral. In the complex case, the integration variable
z lies in a two-dimensional plane (the complex plane), not a line; therefore we cannot just
specify two end-points, and must specify an entire contour.
Also, note that in defining a contour Γ we must specify not just a curve in the complex
plane, but also the direction along which to traverse the curve. 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).
Additional Notes—A contour integral generally cannot be interpreted as the area under
a curve, the way a definite real integral can. In particular, the contour should not be
mistakenly interpreted the graph of the integrand! Always remember that in a contour
integral, the integrand f (z) and the integration variable z are both complex numbers.
Moreover, the concept of an indefinite integral cannot be usefully generalized to the
complex case.
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 . (7)
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) . (8)
Γ t1 dt
This can then be calculated using standard integration techniques. A simple example is
given in the next section.
60
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
where the trajectory Γ[R, θ1 , θ2 ] consists of a counter-clockwise arc of radius R > 0, from
the point z1 = Reiθ1 to the point z2 = Reiθ2 , as shown in the figure below:
Then the contour integral can be converted into an integral over the real parameter θ:
Z Z θ2
dz
dz z n = dθ z n (11)
Γ[R,θ1 ,θ2 ] θ1 dθ
Z θ2
n
dθ Reiθ iR eiθ
= (12)
θ1
Z θ2
= iRn+1 dθ ei(n+1)θ . (13)
θ1
To proceed, there are two cases that we must treat separately. First, for n 6= −1,
θ2 θ2
ei(n+1)θ ei(n+1)θ2 − ei(n+1)θ1
Z
i(n+1)θ
dθ e = = . (14)
θ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 . (15)
θ1 n=−1 θ1
61
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
integrand is a well-defined function. To get around this problem, we can specify a branch
cut and perform the contour integral with any of the branches of z n (this is fine since the
branches are well-defined functions). So long as the branch cut avoids intersecting with
the contour Γ, the result (16) remains 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 − . (19)
Γ S(Γ) ∂x ∂y
where Γ is a loop trajectory and f (z) is some analytic function that is analytic in the domain
S(Γ). 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
62
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
The last expression is a line integral involving the complex vector field
~ u(x, y) + iv(x, y)
A(x, y) = . (26)
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 (27)
S(Γ) ∂x ∂y S(Γ) ∂x ∂x ∂y ∂y
ZZ
∂v ∂u ∂u ∂v
= dx dy − + +i − . (28)
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 =− . (29)
∂x ∂y ∂y ∂x
Hence, the loop integral is zero. Q.E.D.
63
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
Let us define a new loop contour, Γ0 , 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.
The loop Γ0 encloses no points of non-analyticity, so Cauchy’s integral theorem says that
the integral over it is zero. But the contour integral over Γ0 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 Cauchy0 s Integral Theorem) (31)
Γ0
Z Z X I
= dz f (z) + dz f (z) + dz f (z) (32)
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). (33)
Γ 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.
8.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 of the form
A
f (z) ≈ , where n ∈ {1, 2, 3, . . . }. (34)
(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.
64
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
−5/3
f (z) = . (37)
z − i/3
where Γ is a counter-clockwise circular loop centered on the origin. This holds for any (non-
zero) loop radius. By combining this with the results of Section 8.2.2, we can 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.
65
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
By combining the residue theorem with the results of the last few sections, we arrive at a
technique for integrating a function f (z) over a loop Γ, called the calculus of residues:
1. Identify the poles of f (z) in the domain enclosed by Γ.
2. 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.
3. Calculate the residue, Res[f (zn )], at each pole zn .
4. The value of the loop integral is
I X
dz f (z) = ±2πi Res f (z) z=zn . (45)
Γ n
The plus sign holds if Γ is counter-clockwise, and the minus sign if it is clockwise.
66
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
This integral is taken over real values of x, and in Chapter 2 we solved it using a change of
variables. Now let’s see how to solve it using contour integration.
First, 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) inte-
grand so that it reduces to the old integrand for z ∈ R, and is analytic over a broad domain.
In this case, let
1 1
2
→ 2 . (53)
x +1 z +1
This is just the integrand we dealt with in Section 8.3.3.
We now have to choose the contour. 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 below:
Note that the loop is counterclockwise, so we take the positive sign for the residue theorem.
The loop integral can also be written as a sum of two integrals:
I Z ∞ Z
dz dx dz
2
= 2
+ 2
. (55)
z +1 −∞ x + 1 arc z + 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 of
the integrand goes as 1/R2 , while the dz gives another factor of R (see Section 8.1.2), so
the overall integral goes as 1/R, which vanishes as R → ∞.
67
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
Let Z
I= dz eiqz g(z), (57)
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
If g(z) < gmax for all z ∈ C ⇒ I → 0 as gmax → 0. (58)
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 limiting case 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,
because the integration is taken along an arc of infinite length (so we have a 0 × ∞ sort of
situation). Jordan’s lemma then proves useful, as it provides a set of criteria that can let us
instantly 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 a contour C 0 in the lower half-plane:
Let Z
I= dz e−iqz g(z), (59)
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. (60)
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:
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.
68
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
Then ∞
eiz eix eiz
I Z Z
dz = dx + dz . (63)
4z 2 + 1 −∞ 4x2 + 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
4z 2 + 1 ∼ 4|z|2 → 0 as |z| → ∞. (64)
As for the loop contour, it can be evaluated using the residue theorem:
eiz eiz
I
dz 2 = Res (65)
4z + 1 4z 2 + 1 enclosed poles
eiz
1
= 2πi Res (66)
4 (z + i/2)(z − i/2) z=i/2
e−1/2
= 2πi . (67)
4i
Hence,
π π
I = Re √ = √ . (68)
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 , (69)
−∞ 4x + 1
69
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
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
dz 2 = −2πi Res (70)
4z + 1 4z 2 + 1 z=−i/2
e−1/2
= −2πi (71)
−4i
π
= √ . (72)
2 e
Taking the real part, we obtain the same result as before.
We want to calculate I 0 with the help of contour integration. But there’s something strange
about I 0 : the complex integrand has a pole at z = 0, right on the real line!
To handle this, we split I 0 into two integrals, one going over −∞ < x < − (where is
some positive infinitesimal), and the other over < x < ∞:
Z − Z ∞
eix eix
0
I = lim dx + dx (75)
→0 −∞ x x
Z ∞
eix
≡P dx . (76)
−∞ 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 “principal values” for multi-valued
complex operations discussed in Chapter 7, there is no connection between the two concepts.)
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. However, the loop can also be decomposed into several sub-contours:
70
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
The integral over Γ1 is the principal-value integral we are interested in. The integral over
Γ2 vanishes by Jordan’s lemma. The integral over Γ3 can be calculated by parameterization:
Z 0 i exp(iθ)
eiz
Z
e
ieiθ dθ
= lim iθ
(77)
Γ3 z →0 π e
Z 0
= lim i dθ (78)
→0 π
= −iπ. (79)
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. (80)
Γ1 +Γ2 +Γ3 Γ1 Γ2 Γ3
| {z } | {z } | {z } | {z }
= 0 (Cauchy’s integral theorem) = I0 = 0 (Jordan’s lemma) = −iπ
Hence,
I = Im(I 0 ) = Im(iπ) = π. (81)
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.
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. In Section 8.4, we dealt with the integral
Z ∞
dx
. (82)
−∞ 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 . (83)
−∞ x4 + 1
71
Y. D. Chong (2020) MH2801: Complex Methods for the Sciences
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.
6. Solve the definite integral Z 2π
dφ
I= , (86)
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+ , (87)
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 , (88)
−∞ 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 (89)
π −∞ w − x
Z ∞
1 Re[f (w)]
Im f (x) = − P dw . (90)
π −∞ 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]
72