Real Integrals by Residues

Here is the payoff that makes the residue theorem famous: it evaluates stubborn real integrals that have no elementary antiderivative. The trick is to view a real integral over the line as part of a closed contour in the complex plane, close it with a large semicircle, and let the semicircle's contribution vanish.

Worked: the bell-shaped integral

Evaluate \displaystyle\int_{-\infty}^{\infty} \frac{dx}{1 + x^2} by residues, treating it as a complex integral of f(z) = \dfrac{1}{1 + z^2} = \dfrac{1}{(z - i)(z + i)}.

Step 1 — close the contour. Integrate f around the half-disk: the segment from -R to R plus the upper arc \Gamma_R. Splitting the closed loop,

\oint = \int_{-R}^{R} \frac{dx}{1 + x^2} + \int_{\Gamma_R} \frac{dz}{1 + z^2}.

Step 2 — kill the arc with the ML inequality. On \Gamma_R we have |z| = R, so for large R the integrand is bounded by M = \dfrac{1}{R^2 - 1}, and the arc has length L = \pi R. By the ML inequality,

\left|\int_{\Gamma_R} \frac{dz}{1 + z^2}\right| \le M\,L = \frac{\pi R}{R^2 - 1} \;\xrightarrow{R \to \infty}\; 0.

Step 3 — pick up the enclosed residue. Inside the upper half-plane the only pole is z = i. By the quotient rule with h(z) = 1 + z^2, h'(z) = 2z:

\operatorname{Res}(f, i) = \frac{1}{h'(i)} = \frac{1}{2i}.

Step 4 — assemble. The arc vanishes, so the real integral equals the closed contour integral, which the residue theorem evaluates:

\int_{-\infty}^{\infty} \frac{dx}{1 + x^2} = 2\pi i\,\operatorname{Res}(f, i) = 2\pi i \cdot \frac{1}{2i} = \pi.

Step 5 — sanity check. This is an improper integral we can also do directly: \int_{-\infty}^{\infty} \frac{dx}{1 + x^2} = \bigl[\arctan x\bigr]_{-\infty}^{\infty} = \tfrac{\pi}{2} - (-\tfrac{\pi}{2}) = \pi. The two methods agree.

A harder one: a fourth-degree denominator

The same machine evaluates \displaystyle\int_{-\infty}^{\infty} \frac{dx}{1 + x^4}, which has no friendly antiderivative at all. The denominator vanishes at the four fourth roots of -1; the two in the upper half-plane are

z_1 = e^{i\pi/4}, \qquad z_2 = e^{i 3\pi/4}.

Each is a simple pole, and the quotient rule gives \operatorname{Res}(f, z_k) = \dfrac{1}{4 z_k^3} = -\dfrac{z_k}{4} (using z_k^4 = -1). Summing the two upper residues and multiplying by 2\pi i,

\int_{-\infty}^{\infty} \frac{dx}{1 + x^4} = 2\pi i\bigl(\operatorname{Res}(f, z_1) + \operatorname{Res}(f, z_2)\bigr) = \frac{\pi}{\sqrt{2}}.

The astonishing thing is that the answer is real, yet the route runs entirely through the complex plane and through a pole the real integral never even meets. The decay of f guarantees the arc contributes nothing, so the line integral is fully determined by the residues hiding above it. Whole families of integrals — rational functions, products with e^{iax} (Fourier integrals), and more — fall to exactly this contour-closing technique. The line was never the whole story; the upper half-plane was.

Grow the semicircle and watch the arc vanish

The contour is the real segment [-R, R] closed by the upper arc \Gamma_R. Grow R with the slider: the pole at z = i sits enclosed for any R > 1, while the readout reports the arc's ML bound \dfrac{\pi R}{R^2 - 1} shrinking toward 0. In the limit only the residue at i remains, giving \pi.