evaluation of real integrals by residues
Here is the big payoff that motivates the whole subject. There are real integrals — perfectly ordinary integrals along the real axis — that defeat every method of first-year calculus: no substitution, no integration by parts, no partial fractions cracks them. Yet by leaving the real line, taking a detour through the complex plane, and counting residues, they fall in a few lines. Evaluating real integrals by residues is the art of solving a real problem by temporarily making it complex.
The recipe has a few standard moves. For a rational function over the whole real line, you close the contour with a large semicircle in the upper half-plane; the semicircle's contribution vanishes as its radius grows (provided the integrand decays fast enough), so the real integral equals 2 pi i times the sum of residues in the upper half-plane. For integrals with sin and cos over a full period, you substitute z = e^{i theta}, turning the integral into a loop around the unit circle. For oscillatory integrals (a Fourier-type factor e^{i k x}), Jordan's lemma guarantees the arc vanishes, and you pick the half-plane where the exponential decays. Integrands with roots or logarithms call for a keyhole contour wrapped around a branch cut.
This is a genuine method, not a sleight of hand. The complex integral and the real integral are linked by honest theorems — Cauchy's theorem and the residue theorem — and the limiting arguments that kill the added arcs are rigorous (Jordan's lemma, estimation by the maximum on the arc). It is the standard route to integrals throughout physics and engineering: diffraction integrals, Green's functions, the normalisation of wavefunctions, response functions in electrodynamics, and the inverse Laplace transform all yield to a well-chosen contour and a tally of residues.
Compute the integral of 1/(x^2 + 1) from minus infinity to infinity. Close with a semicircle in the upper half-plane; its contribution vanishes as the radius grows. The only enclosed pole is z = i, with residue 1/(2i). The real integral therefore equals 2 pi i times 1/(2i) = pi — matching the familiar arctangent answer, but obtained without finding an antiderivative.
Close the contour, discard the vanishing arc, sum the enclosed residues — and a hard real integral falls out.
The arc only vanishes if the integrand decays fast enough; for slowly decaying or merely oscillatory integrands you must invoke Jordan's lemma or check the estimate explicitly, and choose the half-plane carefully. Closing in the wrong half-plane, or assuming the arc dies when it does not, is the classic way these calculations go wrong.