Exercises — Complex integration — contour integrals
Before we start, one shared picture of the playground. A contour is a curve we walk along in the flat plane of complex numbers; a pole is a point where the function blows up (a "spike"). The whole game is: is the spike inside my loop or not?
Figure 1 — read it like this. The black circle is the contour with a counterclockwise arrow (the positive direction). The red cross at sits inside: a pole there contributes . The black cross at sits outside: it contributes . This single "inside vs outside" test drives every problem below.

L1 — Recognition
Goal: name the tool. No heavy computation.
Recall Solution 1.1
What tool? Tool 2, the -loop lemma: only when , else .
- has , so .
- has , so .
Why: on the unit circle , the integrand becomes . A full loop averages any wobbling exponential to zero — unless makes it the constant , which survives.
Recall Solution 1.2
What tool? Tool 3, Cauchy's Integral Theorem. The integrand is a polynomial, which is analytic everywhere — no spikes anywhere, let alone inside the loop. Why, spelled out via Green's theorem. Writing , , the real and imaginary parts of become the two line integrals and . Green's theorem turns each closed line integral into an area integral over the enclosed region : the "Green's-theorem integrands" are and . For an analytic the Cauchy–Riemann equations make both of these exactly zero, so both area integrals vanish and the loop is .
Recall Solution 1.3
What tool? "Is the spike inside?" The pole sits at . The contour is the circle of radius . Since , the pole is outside (like the black cross in Figure 1). Inside the loop the function is analytic, so
L2 — Application
Goal: run one tool cleanly, start to finish.
Recall Solution 2.1
Parametrise (Tool 1): a straight line is linear, for , so and . Now , so the answer is . Sanity check: is analytic, so the answer should equal the antiderivative evaluated at the endpoints: . ✔
Recall Solution 2.2
What tool? Tool 3, CIF: . Match: , . The pole satisfies , so it is inside , and is analytic there.
Recall Solution 2.3
Factor first: , giving simple poles at and ; both have modulus , so both are inside. Cover-up method (see the definition above): for cover , leaving at ; for cover , leaving at : Sum , so by the Residue Theorem
L3 — Analysis
Goal: pick the right tool and justify why the others fail.
Recall Solution 3.1
Locate poles: (modulus , inside) and (modulus , outside). Only counts (exactly the "inside vs outside" test of Figure 1). Cover-up at the simple pole : cover the factor , substitute into the rest:
Recall Solution 3.2
Why not residues? (the conjugate) is not analytic — it fails the Cauchy–Riemann equations — so no Cauchy/residue machinery applies. We must parametrise by hand (Tool 1). Parametrise: for ; then and . Path-dependence check: along the straight line from to , take (), which is real so and : Two paths, same endpoints, different answers ( vs ) — path-dependence confirmed, exactly because is not analytic.
Figure 2 — read it like this. Both paths start at and end at . The red upper semicircle gives ; the black straight segment along the real axis gives . Same endpoints, different answers — the visual proof that is path-dependent because is not analytic. (Contrast an analytic , where Figure 1's logic would force the two paths to agree.)

L4 — Synthesis
Goal: combine contour tricks to crack a real integral.

Recall Solution 4.1
Plan: replace by complex , integrate around the real axis closed by a big semicircle of radius in the upper half-plane (counterclockwise, the positive orientation), let . Arc check (degree test): here , , and , so the arc vanishes. Thus the closed loop equals the real-line integral. Poles: . Only is in the upper half-plane. Cover-up / derivative residue at (, ): Check: with gives . ✔
Edge case — closing in the LOWER half-plane. You may instead close with a semicircle below the real axis. That loop is traced clockwise, so it equals . The only lower pole is with , giving — the same answer, as it must be. Two orientations, one truth: the from reversing orientation cancels the sign flip of the other residue.
Recall Solution 4.2
Poles: roots of are . The two in the upper half-plane are and . Arc check (degree test): , , , so the arc contribution . Cover-up / derivative residues of , with , so :
\operatorname{Res}_{z_2}=\frac{1}{4e^{i3\pi/4}}=\tfrac14 e^{-i3\pi/4}.$$ Sum $=\tfrac14\big(e^{-i\pi/4}+e^{-i3\pi/4}\big)=\tfrac14\big(\cos\tfrac\pi4 - i\sin\tfrac\pi4 - \cos\tfrac\pi4 - i\sin\tfrac\pi4\big)=\tfrac14\big(-2i\sin\tfrac\pi4\big)=\tfrac14\left(-2i\cdot\tfrac{\sqrt2}{2}\right)=-\tfrac{i\sqrt2}{4}.$ $$\int_{-\infty}^{\infty}\frac{x^2}{x^4+1}\,dx = 2\pi i\left(-\frac{i\sqrt2}{4}\right)=\frac{\pi\sqrt2}{2}=\frac{\pi}{\sqrt2}.$$L5 — Mastery
Goal: higher-order poles, Laurent series, and full case-handling.
Recall Solution 5.1
Method A — Laurent series (read off ). Expand and divide by (every power drops by two): The coefficient of is . That single term is the only survivor of a loop (Tool 2), so Method B — order- formula (cross-check). Here , . Multiply by : . Differentiate once: . Take the limit and divide by : Both methods agree: , integral . ✔
Recall Solution 5.2
Poles: (, inside), (, inside), (, outside). Keep and . Cover-up method (cover the factor at each pole, plug in the rest): Sum , so by the Residue Theorem
Recall Solution 5.3
The substitution trick: set so as runs , traverses the unit circle once counterclockwise (the positive orientation). Then Why: , so ; this converts the trig integral into a rational contour integral. Full algebra of the substitution (shown step by step): So the integrand times is
= \frac{1}{iz\,(5+2z+2z^{-1})}\,dz = \frac{1}{i\,(5z+2z^{2}+2)}\,dz,$$ where the last step multiplied the $z$ from $iz$ into the bracket: $z(5+2z+2z^{-1})=5z+2z^2+2$. Hence $$\int_0^{2\pi}\frac{d\theta}{5+4\cos\theta}=\oint_{|z|=1}\frac{dz}{i\,(2z^2+5z+2)}.$$ **Factor the denominator:** $2z^2+5z+2=(2z+1)(z+2)$, so poles at $z=-\tfrac12$ (inside, $|{-\tfrac12}|<1$) and $z=-2$ (outside). Only $z=-\tfrac12$ counts. **Cover-up residue** of $\dfrac{1}{i(2z+1)(z+2)}$ at $z=-\tfrac12$ (write $2z+1=2(z+\tfrac12)$, cover $(z+\tfrac12)$): $$\operatorname{Res}_{-1/2}=\frac{1}{i\cdot 2\,(z+2)}\bigg|_{z=-1/2}=\frac{1}{i\cdot 2\cdot \tfrac32}=\frac{1}{3i}.$$ $$\int_0^{2\pi}\frac{d\theta}{5+4\cos\theta}=2\pi i\cdot\frac{1}{3i}=\frac{2\pi}{3}.$$Recall Master check — one-line reasons
Why did not contribute in Ex 3.1? ::: It lies outside , so it is not enclosed. Which tool handles and why? ::: Direct parametrisation, because is not analytic (no residues). How do you turn into a contour integral? ::: Set , , . Residue of at ? ::: , since . When does the order- formula reduce to plain cover-up? ::: When (simple pole): no derivative, just substitute. What does reversing a contour's orientation do? ::: Multiplies the integral by (clockwise = negative).
Connections
- Residue theorem applications — L4 and L5 are exactly these techniques.
- Laurent series — the double-pole residue in Ex 5.1 is a coefficient read-off.
- Cauchy–Riemann equations — why Ex 3.2's is path-dependent.
- Analytic functions — the dividing line between "loop " and "loop counts spikes".
- Green's theorem — the engine that made Cauchy's theorem true in the first place.
Concept Map
The flowchart below is the decision tree you should run on every contour integral: first ask whether is analytic inside; if yes the loop is ; if not, find the enclosed poles, compute each residue (simple cover-up; higher-order Laurent or order- formula), and sum them times . Real integrals feed in by closing a semicircle or substituting .