Contour integration of real integrals using residues
At a Glance
Frequency: 9 sub-parts across 9 of 13 years (2013, 2014, 2017, 2018, 2020, 2021, 2022, 2023, 2025)
Priority tier: T1
Marks (count): 15 (3), 20 (6)
Average solve time: ~15 min
Difficulty mix: medium 6, hard 3
Section: A | Dominant type: computation
Why This Chapter Matters
Contour integration is the single highest-mark topic in Paper 2 Complex Analysis — every question so far has been worth 15 or 20 marks, and the pattern holds year after year. There are exactly two question types and each has a four-step algorithm. The hard part is not the method (it is mechanical) but the residue calculation, especially for double poles or when two poles are enclosed simultaneously. A student who can reliably compute residues at simple and order-2 poles and correctly apply Jordan’s lemma will bank 20 marks on a predictable question.
Minimum Theory
Residue theorem. If f is analytic inside and on a simple closed contour C except at finitely many isolated singularities, then ∮Cf(z)dz=2πi∑kResz=zkf, where the sum is over all poles inside C, and C is traversed counterclockwise.
Computing residues. At a simple polez=a: Resaf=limz→a(z−a)f(z); if f=p/q with q(a)=0, p(a)=0, q′(a)=0 then Resaf=p(a)/q′(a). At an order-m pole: Resaf=(m−1)!1limz→adzm−1dm−1[(z−a)mf(z)].
Jordan’s lemma and arc estimates. For the upper semicircle ΓR: if g(z)→0 uniformly on ΓR as R→∞ and m>0, then ∫ΓRg(z)eimzdz→0 (Jordan’s lemma — valid for eimz even when ∣g∣∼C/R rather than C/R2). For integrands without an oscillatory factor, the cruder ML estimate suffices: if ∣f∣≤M/R1+ε on ΓR then ∣∫ΓRf∣≤πR⋅M/R1+ε→0. Indent around a simple pole on the real axis: a small upper semicircle of radius ε traversed clockwise (from −ε to +ε on the real axis) contributes −πi⋅Res0f in the limit ε→0.
Question Archetypes
Two patterns cover every question in the corpus. Classify in seconds by looking at the integration limits and the integrand type.
Setup.f(z)=z(z−ia)(z+ia)eiz. The real-axis pole z=0 forces an indented contour: standard CR but with a small upper semicircle of radius ε bypassing z=0.
Poles in upper half-plane:z=ia (simple). Pole at z=0 is on the real axis — indented around.
Apply contour theorem. Jordan kills ΓR; small CW semicircle at 0 contributes −πi⋅Res0f=−πi/a2:
∫−∞∞f(x)dx+(−a2πi)=2πi⋅−2a2e−a=−a2πie−a.∫−∞∞f(x)dx=a2πi−a2πie−a=a2πi(1−e−a).
Take Im:∫−∞∞x(x2+a2)sinxdx=a2π(1−e−a).
2022 Paper 2, 2022-P2-Q2c (20 marks)
Evaluate ∫−∞∞(x2+a2)(x2+b2)cosxdx (a>b>0).
Setup. Replace cosx with Re(eiz). f(z)=(z2+a2)(z2+b2)eiz. Upper-half-plane poles: z=ia and z=ib (both simple).
Residues (a>b>0 so a2>b2):
Resz=iaf=2ia(b2−a2)e−a=2ia(a2−b2)−e−a,Resz=ibf=2ib(a2−b2)e−b.
Sum and multiply by 2πi (Jordan kills arc):
∫−∞∞fdx=2πi⋅2i(a2−b2)1(be−b−ae−a)=a2−b2π(be−b−ae−a).
This is already real, so:
∫−∞∞(x2+a2)(x2+b2)cosxdx=a2−b2π(be−b−ae−a).
Upper-half-plane poles:z=i and z=3i (both simple). Use q′(z)=4z3+20z.
Residues via p(z0)/q′(z0):
At z=i: p(i)=i2−i+2=1−i; q′(i)=4i3+20i=−4i+20i=16i.
Resz=if=16i1−i=16(1−i)(−i)=16−i−1⋅−1−1=−161−16i.
At z=3i: p(3i)=(3i)2−3i+2=−7−3i; q′(3i)=4(−27i)+60i=−48i.
Resz=3if=−48i−7−3i=48(7+3i)(−i)=483−7i=161−487i.
Arc estimate.∣f∣≤CR2/R4=C/R2, so ∣∫ΓRf∣≤πC/R→0.
Sum residues and multiply by 2πi:Sum=(−161+161)+i(−161−487)=i(−483+7)=−4810i=−245i.∫−∞∞fdx=2πi⋅(−245i)=2410π=125π.■
Common Traps
Use eimz, not sinmz or cosmz directly: sinmz blows up in the upper half-plane (imaginary part of mz is positive there), while eimz=eim(x+iy)=e−myeimx decays. Take Im or Re only after evaluating the contour integral.
Double poles need one derivative: (z−ia)2f must be differentiated once (not the simple-pole formula). Track i3=−i and (2ia)3=−8ia3 carefully — sign errors here are common and costly.
Halve for 0 to ∞: the contour gives −∞ to ∞; use evenness to write I=21∫−∞∞. Only the 2021 question already runs to ±∞ and needs no halving.
Indented contour sign: the small CW semicircle around a simple real-axis pole contributes −πi⋅Res0 (minus, not plus) because it is traversed clockwise while the full-circle contribution would be +2πi⋅Res.
Include only upper-half-plane poles: z=−ia,−ib,−i,−3i etc. are in the lower half-plane; they lie outside the contour and contribute zero to the sum.
Integration limits [0,π] or [0,2π]; integrand is a rational function of cosθ and/or sinθ.
For [0,π]: use the symmetry cos(2π−θ)=cosθ or sinn(θ+π)=sinnθ to double to [0,2π] first.
If the integrand involves cosnθ or sinnθ (as in 2023), express those via zn+z−n or zn−z−n — not via (z±z−1)n.
Solution Template
Extend to [0,2π] if necessary, using a symmetry of the integrand. Record the factor (often 1/2).
Substitute z=eiθ: cosθ=2z+z−1, sinθ=2iz−z−1, dθ=izdz. Clear all z−n by multiplying numerator and denominator by zn.
Factor the denominator of the resulting rational integrand in z. Find the poles.
Check which poles lie inside ∣z∣=1 (if ∣z0∣<1 it is inside; ∣z0∣>1 outside).
Compute residues at interior poles (simple or order-2).
Apply residue theorem: ∮∣z∣=1g(z)dz=2πi∑Res.
Undo the extension (divide by 2 if step 1 doubled the range). Box the answer.
Worked Example(s)
2013 Paper 2, 2013-P2-Q4b (15 marks)
Evaluate ∫0πsin4θdθ using Cauchy’s residue theorem.
1 — Extend.sin4(θ+π)=sin4θ, so ∫02πsin4θdθ=2I.
2 — Substitute.sinθ=2iz−z−1, dθ=izdz. Then sin4θ=16(z−z−1)4.
Expand by binomial: (z−z−1)4=z4−4z2+6−4z−2+z−4. After multiplying by dz/(iz):
2I=16i1∮∣z∣=1(z3−4z+z6−z34+z51)dz.
3–4 — Pole and residue. Only z=0 is inside ∣z∣=1. The only z−1 term has coefficient 6, so Resz=0(integrand)=6.
5–7.2I=16i1⋅2πi⋅6=1612π=43π.
I=∫0πsin4θdθ=83π.
2014 Paper 2, 2014-P2-Q3c (20 marks)
Evaluate ∫0π(1+21cosθ)2dθ using residues.
1.cosθ is even, so ∫02π=2∫0π.
2.1+21cosθ=4zz2+4z+1, giving the contour integral
∫02π(⋯)dθ=i16∮∣z∣=1(z2+4z+1)2zdz.
3–4. Roots of z2+4z+1: z1,2=−2±3. ∣z1∣=2−3≈0.27<1 (inside); ∣z2∣=2+3>1 (outside). Factor: (z2+4z+1)2=(z−z1)2(z−z2)2. Order-2 pole at z1.
5. Order-2 residue of z/(z−z1)2(z−z2)2 at z1:
Resz1=dzd[(z−z2)2z]z=z1=(z1−z2)3−z1−z2=(23)34=2434=183.
(Used z1+z2=−4 and z1−z2=23.)
6–7.i16⋅2πi⋅183=916π3⟹∫0π=98π3.
∫0π(1+21cosθ)2dθ=98π3.
Standard-formula check: ∫02π(a+bcosθ)2dθ=(a2−b2)3/22πa gives 916π3, halved is 98π3 ✓.
2020 Paper 2, 2020-P2-Q2c (20 marks)
Evaluate ∫02π3+2sinθdθ by contour integration.
1. Limits already [0,2π]. 2.sinθ=(z−z−1)/(2i); after simplification:
3+2sinθ=3−i(z−z−1)⟹I=∮∣z∣=1iz2−3z−idz⋅(−1).
5. Simple-pole residue at z1 (leading coeff i):
Resz1=i(z1−z2)1=i⋅i51=−51.
Accounting for the overall factor, the residue of the integrand is −i/5.
6–7.I=2πi⋅(−5i)=52π=52π5.
Check: standard formula 2π/a2−b2 with a=3,b=2 gives 2π/5 ✓.
2023 Paper 2, 2023-P2-Q2c (20 marks)
Evaluate ∫02π5+4cosθcos2θdθ by contour integration.
2. Use cosθ=2z+z−1 and cos2θ=2z2+z−2. After clearing denominators:
I=∮∣z∣=12iz2(2z+1)(z+2)z4+1dz.
Extend to [0,2π] before applying the method: the z=eiθ substitution requires a full period. Use an appropriate symmetry (e.g., cos(2π−θ)=cosθ, or sin4(θ+π)=sin4θ) and record the halving factor.
Only the z−1 coefficient is the residue: when the integrand at z=0 is a Laurent series ∑anzn, only a−1 contributes. The terms z−2,z−3,… have well-defined primitives and integrate to zero round a closed curve.
(2z+1) has leading coefficient 2: for the simple-pole residue at z=−21, the denominator has an implicit factor of 2 from d(2z+1)/dz=2 — equivalently, use p(z0)/q′(z0) where q is the full denominator polynomial.
The extension factor must be applied at the end: if you wrote ∫02π=2∫0π in step 1, remember to divide the contour-integral result by 2 when reporting the original integral.
Marks-Aware Writing
15-mark questions (2017, 2018, 2013): Five numbered steps are sufficient — symmetrize, complexify, state the pole(s) and their location, compute the residue explicitly, apply the theorem and halve. The arc-vanishing argument must be stated in one sentence (Jordan’s lemma / ML estimate) — omitting it loses method marks.
20-mark questions (2021, 2022, 2023, 2025, 2014, 2020): Identical structure but expect to compute two or more residues (2022, 2025), handle a double pole (2018 if it were 20 marks, 2014, 2023), or manage an indented contour (2021). Each residue computation should be a labelled sub-step. Show the i cancellation explicitly: writing 2πi⋅(k/i)=2πk is worth a mark.
For both mark levels: box the numerical answer; verify by the standard formula if one exists (2π/a2−b2 for ∫02πdθ/(a+bcosθ), etc.).
Practice Set
Year
Paper/Q
Marks
Archetype
One-line hint
2025
P2-Q2c
20
real-line-integral-contour
Factor z4+10z2+9=(z2+1)(z2+9); use p(z0)/q′(z0) at z=i and z=3i; imaginary parts cancel
2023
P2-Q2c
20
trig-integral-contour
cos2θ=(z2+z−2)/2; double pole at z=0 needs one derivative; simple pole at z=−1/2
2022
P2-Q2c
20
real-line-integral-contour
Replace cosx with Re(eiz); two simple poles ia,ib; i‘s cancel to leave a real answer
2021
P2-Q4b
20
real-line-integral-contour
Pole at z=0 on real axis: indent; small CW semicircle gives −πi⋅Res0
2020
P2-Q2c
20
trig-integral-contour
3+2sinθ→iz2−3z−i; roots −i(3±5)/2; pick ∥z∥<1
2018
P2-Q3b
15
real-line-integral-contour
Pole of order 2 at z=ia: differentiate (z+ia)−2; i3=−i in (2ia)3
2017
P2-Q2b
15
real-line-integral-contour
Even integrand, halve; replace sinmx by Im(eimz); simple pole at z=ia
2014
P2-Q3c
20
trig-integral-contour
Double root inside: z1=−2+3; residue of z/(z−z1)2(z−z2)2 via quotient derivative
2013
P2-Q4b
15
trig-integral-contour
Extend to [0,2π] via sin4 periodicity; only z−1 term (coefficient 6) contributes
We've mapped all 13 years of this exam. Get new chapters, tools, and solutions as we release them — free.