Complex Analysis

Residue Theorem

A contour integral around a region equals 2πi times the sum of residues at the poles inside — turning hard real integrals into algebra

Cauchy's residue theorem says the integral of a meromorphic function around a closed contour is 2πi times the sum of the residues at the poles enclosed. The contour integral collapses to algebra at a finite set of isolated points. The theorem turns hard real integrals — like ∫dx/(1+x²) — into one-line evaluations, and powers the inverse Laplace transform, Fresnel integrals, and Zeta-function functional equations.

  • DiscoveredAugustin-Louis Cauchy, 1826
  • Statement∮ f dz = 2πi · Σ Res(f, zⱼ)
  • FoundationCauchy-Goursat theorem
  • Simple pole residuelim_{z→a} (z−a) f(z)
  • Killer application∫ dx/(1+x²) = π

Watch the 60-second explainer

A condensed visual walkthrough — narrated, captioned, under a minute.

The theorem

Let γ be a positively-oriented (counter-clockwise) simple closed curve in the complex plane, and let f be a meromorphic function — analytic everywhere except for a finite collection of isolated poles z₁, z₂, …, zₖ — inside and on γ, with no poles on γ itself. Then

      ⌠
      ⎮ f(z) dz = 2πi · ( Res(f, z₁) + Res(f, z₂) + ⋯ + Res(f, zₖ) ).
      ⌡γ

The residue Res(f, zⱼ) is the coefficient c_{−1} in the Laurent expansion f(z) = Σ_{n=−∞}^{∞} cₙ (z − zⱼ)ⁿ valid in a punctured neighbourhood of zⱼ. Only the c_{−1} term survives the contour integration; everything else integrates to zero around a closed curve.

The theorem is a corollary of Cauchy's theorem ∮ f dz = 0 for analytic f. To see why, surround each pole with a tiny circle, connect each circle to γ by a back-and-forth slit, and let the slits cancel pairwise. What remains is γ minus the small circles, on which f is analytic, so the contour integrals over γ and the small circles agree. On a small circle around zⱼ the integral picks out exactly 2πi times the (z − zⱼ)⁻¹ coefficient of f, which is the residue.

Computing residues

The residue is the c_{−1} of the Laurent series, but you rarely need to compute the whole series — there are direct formulas for poles of specific order.

Simple pole (order 1). If f has a simple pole at z = a, then

Res(f, a) = lim_{z→a} (z − a) f(z).

For f(z) = g(z)/h(z) with g analytic and non-zero at a, and h having a simple zero at a (so h(a) = 0, h′(a) ≠ 0):

Res(f, a) = g(a) / h′(a).

This is the workhorse formula for rational functions and meromorphic functions with simple poles.

Pole of order n. If f has a pole of order n at z = a, then

Res(f, a) = (1/(n−1)!) · lim_{z→a} d^{n−1}/dz^{n−1} [(z−a)ⁿ f(z)].

The factor (z − a)ⁿ kills the singularity, leaving a function analytic at a; the (n − 1)st derivative pulls out the correct Taylor coefficient.

Laurent series, when nothing else works. Expand f(z) directly as a Laurent series around z = a and read off c_{−1}. This is unavoidable for essential singularities and useful when an algebraic shortcut isn't apparent.

Worked example 1: ∫_{−∞}^{∞} dx/(1+x²)

The real integral ∫_{−∞}^{∞} dx/(1+x²) is elementary by arctan: the answer is [arctan(x)]_{−∞}^{∞} = π/2 − (−π/2) = π. We re-derive it via residues to see the method.

Step 1: Choose the contour.
        Let γ_R = (the real segment [−R, R]) ∪ (the upper semicircle Cᴿ
        from R to −R parameterised z = R e^{iθ}, 0 ≤ θ ≤ π).
        γ_R is a closed contour, positively oriented.

Step 2: Identify the poles inside γ_R.
        f(z) = 1/(1 + z²) = 1/((z − i)(z + i)).
        Poles at z = i (inside, in upper half plane) and z = −i (outside).
        Only z = i contributes.

Step 3: Compute the residue at z = i.
        Simple pole; use g/h′ formula:
            g(z) = 1, h(z) = 1 + z², h′(z) = 2z.
            Res(f, i) = 1 / (2i) = −i/2.

Step 4: Apply the residue theorem.
        ∮_{γ_R} f(z) dz = 2πi · Res(f, i) = 2πi · (−i/2) = π.

Step 5: Decompose into real-axis and semicircle pieces.
        ∮_{γ_R} f dz = ∫_{−R}^{R} f(x) dx + ∫_{Cᴿ} f(z) dz.

Step 6: Show the semicircle integral vanishes as R → ∞.
        On Cᴿ, |f(z)| = 1/|1 + z²| ≤ 1/(R² − 1) for R > 1.
        Length of Cᴿ is πR. So |∫_{Cᴿ} f dz| ≤ πR/(R² − 1) → 0.

Step 7: Take R → ∞.
        ∫_{−∞}^{∞} dx/(1+x²) = π. ✓

Same answer the antiderivative gives, but the residue method generalises to integrands without elementary antiderivatives.

Worked example 2: ∫_{−∞}^{∞} cos(x)/(1+x²) dx = π/e

This integral has no elementary antiderivative (try integration by parts and you'll loop). The residue method dispatches it cleanly.

Step 1: Replace cos(x) with the analytic e^{iz}.
        ∫ cos(x)/(1+x²) dx = Re ∫ e^{ix}/(1+x²) dx.
        Compute the complex integral I = ∫_{-∞}^{∞} e^{ix}/(1+x²) dx.

Step 2: Same contour as before — upper semicircle.
        f(z) = e^{iz}/(1 + z²) has poles at z = ±i; only z = i is inside.

Step 3: Residue at z = i.
        Res(f, i) = e^{i·i}/(2i) = e^{−1}/(2i) = 1/(2ie).

Step 4: Apply residue theorem.
        ∮_{γ_R} f dz = 2πi · 1/(2ie) = π/e.

Step 5: Show semicircle integral vanishes (Jordan's lemma).
        On Cᴿ, |e^{iz}| = e^{−Im(z) · sin(θ)·R}. In the upper half plane,
        Im(z) ≥ 0, so |e^{iz}| ≤ 1, but actually e^{−R sin θ} decays
        rapidly. Combined with the 1/R² factor from 1+z², the curved
        integral → 0 as R → ∞.

Step 6: Take R → ∞.
        ∫_{−∞}^{∞} e^{ix}/(1+x²) dx = π/e
        Real part: ∫ cos(x)/(1+x²) dx = π/e ≈ 1.156.
        Imaginary part: ∫ sin(x)/(1+x²) dx = 0 by symmetry. ✓

The numerical check: π/e ≈ 1.1557, and direct numerical integration of cos(x)/(1+x²) on [−40, 40] gives 1.1556. The residue answer is exact.

Choosing the right contour

The art of the residue method is contour choice. Different integrand shapes demand different contours, and the curved part has to be controllable.

Integrand patternStandard contourWhy it works
Rational R(x), degree denominator − degree numerator ≥ 2Upper semicircle radius R → ∞|R(z)| decays like 1/R² on the arc; ML estimate kills it
R(x) · e^{iax} for a > 0Upper semicircleJordan's lemma: e^{iaz} small in upper half plane
R(x) · e^{−iax} for a > 0Lower semicircle (clockwise)e^{−iaz} small in lower half plane
R(cos θ, sin θ) on [0, 2π]Unit circle |z| = 1Substitute z = e^{iθ}; trig becomes rational in z
x^a R(x) on [0, ∞), 0 < a < 1Keyhole contour around branch cutBranch cut traversed twice, with phase difference
R(x) · ln(x) on [0, ∞)Keyhole or sectorLogarithm's branch makes two arc integrals differ by 2πi
Fourier transforms with poles on real axisIndented contourHalf-residue contribution from semicircle around the pole

Each pattern has a few standard moves: substitute z = e^{iθ} for trig integrals, deform around poles on the contour, exploit symmetry to reduce to half-line integrals, choose contour so that one of the segments is easy to relate to the original integral.

Inverse Laplace transform via Bromwich

The inverse Laplace transform is given by the Bromwich integral:

f(t) = (1/(2πi)) · ∫_{c−i∞}^{c+i∞} F(s) e^{st} ds,

where c is to the right of all singularities of F. Closing the contour to the left with a large semicircle (where e^{st} decays for t > 0) makes this exactly a residue calculation: f(t) is the sum of residues of F(s) e^{st} at all poles of F.

For F(s) = 1/(s² + ω²), poles at s = ±iω, residues (1/(2iω)) e^{iωt} and (−1/(2iω)) e^{−iωt}. Sum: sin(ωt)/ω. The Laplace pair F = 1/(s² + ω²), f(t) = sin(ωt)/ω drops out by residue.

This is how circuit and control theorists invert Laplace transforms: factor F(s), identify poles, sum residues. Software like SymPy's inverse_laplace_transform implements exactly this algorithm.

Variants and extensions

  • Argument principle. ∮ f′/f dz = 2πi · (Z − P), where Z is the number of zeros and P the number of poles of f inside γ (with multiplicities). A direct consequence of the residue theorem applied to f′/f. Used to count zeros of polynomials in regions and to prove the Riemann hypothesis equivalents.
  • Rouché's theorem. If |g(z)| < |f(z)| on γ, then f and f + g have the same number of zeros inside γ. Proved via the argument principle. Workhorse tool in proving the fundamental theorem of algebra and locating zeros of perturbed functions.
  • Residue at infinity. For functions with poles "off to infinity", define Res(f, ∞) = −Res(f(1/w)/w², 0). Useful when the sum of all finite residues plus the residue at infinity is zero (a strict statement on the Riemann sphere).
  • Multidimensional residues (Grothendieck). For meromorphic forms in C^n, residues attach to higher-codimension singularities; the global residue theorem on a compact complex manifold says the sum vanishes. Foundation for higher-dimensional intersection theory.
  • Mittag-Leffler theorem. Constructs meromorphic functions with prescribed poles and residues. Conversely, the residue theorem evaluates contour integrals of such functions; the two are dual perspectives on the same data.

Where the residue theorem shows up

  • Signal processing — inverse Laplace and Fourier. Control engineers invert transfer functions H(s) by partial fractions or directly by residues at the poles of H(s). For a second-order H(s) = ω_n²/(s² + 2ζω_n s + ω_n²), the impulse response is computed as a sum of two pole residues; for damped oscillators with complex pole pair, the residues combine to give exponential-cosine responses.
  • Quantum field theory — Feynman propagators. Loop integrals over momentum k include propagators 1/(k² − m² + iε); the iε prescription dictates contour choice, and the integral is evaluated by residues. The retarded versus advanced Green's functions differ exactly in which poles get enclosed.
  • Number theory — Riemann zeta function. The functional equation of ζ(s), connecting ζ(s) and ζ(1 − s), is proved via contour integration with a residue at s = 1 (the simple pole of ζ). Riemann's 1859 paper, Hadamard's 1896 prime number theorem proof, and modern explicit-formula approaches all run on contour-residue technology.
  • Optics and diffraction — Fresnel integrals. ∫₀^∞ cos(x²) dx and ∫₀^∞ sin(x²) dx evaluate to (1/2)√(π/2) via a 45° wedge contour: ∫₀^∞ e^{−ix²} dx along the real axis, e^{−r²} along the rotated ray, and a small arc that vanishes. The shift to a Gaussian along the ray is a residue-free closed-contour argument.
  • Probability — characteristic functions. The probability density of a sum of independent random variables is the inverse Fourier transform of the product of characteristic functions. For Cauchy distributions and other algebraic densities, the inverse transform is a contour integral evaluated by residues.

Summing series with residues

A residue trick that surprises students: many infinite sums can be evaluated by integrating an auxiliary function with a pole at every integer.

The function π · cot(πz) has simple poles at every integer n with residue 1, because π cot(πz) = π cos(πz)/sin(πz), and sin(πz) ≈ π(z − n) near n while cos(πn) = (−1)ⁿ. Multiplying by f(z) gives Σ Res(πf(z) cot(πz), n) = Σ f(n).

For f(z) = 1/(z² + a²), one finds:

Σ_{n=−∞}^{∞} 1/(n² + a²) = π coth(πa)/a − 1/a².

Setting a → 0 limits gives Σ 1/n² = π²/6 (the Basel problem). Euler solved this in 1735 by other means; the residue derivation is contemporary and pedagogically clean.

Common pitfalls

  • Forgetting orientation. Counter-clockwise gives +2πi; clockwise gives −2πi. If you closed the contour in the lower half plane, your residue sum needs a sign flip. Always specify orientation explicitly.
  • Skipping the arc estimate. The conclusion that the semicircular contour integral vanishes as R → ∞ is not automatic — you need an ML estimate, Jordan's lemma, or a direct computation. For integrands like 1/(1+x²) decay is degree-2, so the πR · 1/R² goes to zero; for slower-decaying integrands the standard contour fails.
  • Residue at a non-pole. Residues are only defined for isolated singularities. A removable singularity (e.g., sin(z)/z at z = 0) has residue 0; an essential singularity has residue but might require Laurent expansion. Branch points are not isolated and require contour-cuts, not residues.
  • Double poles in disguise. If f(z) = g(z)/(z − a)² and g(a) ≠ 0, the pole is of order 2; a simple-pole formula will give the wrong residue. Always factor the denominator carefully and check zero multiplicity.
  • Real-axis poles. If a pole sits on the contour itself, the integral is improper. The principal value can sometimes be computed by indenting the contour with a small semicircle around the pole, contributing half the residue; but the result is not the integral in the ordinary sense. Always check whether the original integral converges as a principal value.

Frequently asked questions

What does the residue theorem say?

Let f be a meromorphic function — analytic except at isolated singularities — inside and on a positively oriented simple closed contour γ. Suppose the only singularities of f inside γ are isolated poles at z₁, z₂, …, zₖ. Then ∮_γ f(z) dz = 2πi · Σⱼ Res(f, zⱼ), where Res(f, zⱼ) is the residue of f at zⱼ — the coefficient of (z − zⱼ)⁻¹ in the Laurent expansion of f around zⱼ. The contour integral reduces to a finite algebraic computation.

What is the residue at a simple pole?

If f has a simple pole at z = a (a pole of order 1), the residue is Res(f, a) = lim_{z→a} (z − a) f(z). For f(z) = g(z)/h(z) with g(a) ≠ 0 and h having a simple zero at a, this simplifies to Res(f, a) = g(a)/h′(a). Example: Res(1/(1+z²), i) = 1/(2i) because (1 + z²)′ = 2z evaluates to 2i at z = i.

How do you compute residues at higher-order poles?

If f has a pole of order n at z = a, then Res(f, a) = (1/(n−1)!) · lim_{z→a} d^{n−1}/dz^{n−1}[(z−a)ⁿ f(z)]. The (z−a)ⁿ factor cancels the pole, leaving a function analytic at a; the (n−1)st derivative extracts the right Taylor coefficient. For double poles (n = 2), this becomes Res(f, a) = lim_{z→a} d/dz[(z−a)² f(z)]. As a sanity check, for n = 1 the formula collapses to the simple-pole rule.

How is the residue theorem used to compute real integrals?

Many real integrals have no elementary antiderivative but become tractable as contour integrals. The recipe: extend the integrand to a complex function, choose a contour (typically a semicircle in the upper half-plane) whose real-axis segment recovers the original integral, prove the curved part vanishes as the radius grows (via Jordan's lemma or an ML estimate), and use the residue theorem to evaluate the closed contour as 2πi times the sum of residues inside. Classic examples: ∫₀^∞ dx/(1+x²) = π/2 and ∫_{-∞}^∞ cos(x)/(1+x²) dx = π/e.

Why does the residue theorem work?

Cauchy's theorem says ∮_γ f(z) dz = 0 for any analytic f and closed γ in a simply connected domain. If f has poles, isolate each pole with a tiny circle and connect to γ by a slit; the slit integrals cancel pairwise, leaving γ minus a sum of small circles around the poles. Around each pole, the Laurent series f(z) = Σ_n c_n (z−a)ⁿ integrates term-by-term to ∮(z−a)ⁿ dz = 0 except for n = −1, which gives 2πi · c_{−1} = 2πi · Res(f, a). Adding contributions from all poles gives the theorem.

What's the difference between a pole, a removable singularity, and an essential singularity?

All three are isolated singularities, classified by the Laurent series Σ_n c_n (z−a)ⁿ. Removable: only finitely many negative-power coefficients, all zero — f extends analytically (e.g., sin(z)/z at z = 0). Pole of order n: only finitely many negative-power coefficients, with c_{−n} ≠ 0 the deepest non-zero (e.g., 1/z² at z = 0 has order 2). Essential: infinitely many non-zero negative-power coefficients (e.g., e^{1/z} at z = 0). The residue theorem applies to poles directly; essential singularities need more care, often using residue at infinity or Picard-style arguments.