The residue theorem
The residue theorem
Let \(f\) be analytic inside and on a simple closed loop \(\gamma\), traversed anticlockwise, except at finitely many points \(a_1, \ldots, a_k\) inside \(\gamma\). Then
\[ \oint_\gamma f(z)\,dz = 2\pi i\sum_{j=1}^k \operatorname{Res}(f, a_j). \]Cauchy's theorem (no singularities, integral 0) and Cauchy's integral formula (one simple pole at \(a\), residue \(f(a)\)) are both special cases. The theorem reduces integration around a loop to finding a few Laurent coefficients, which is usually easy.
Example
\(\displaystyle\oint_{|z| = 2}\frac{z\,dz}{(z - 1)(z + 3)}\). Only \(z = 1\) is inside; its residue is \(\frac{1}{1 + 3} = \frac14\). The integral is \(2\pi i\cdot\frac14 = \frac{\pi i}2\).
Integrals over the real line
Here is the method that made the residue theorem famous. To compute a real integral \(\int_{-\infty}^\infty f(x)\,dx\), close the real line into a loop with a large semicircle, and let the semicircle grow.
Example: \(\displaystyle\int_{-\infty}^\infty \frac{dx}{1 + x^2}\)
Take \(f(z) = \frac1{1 + z^2}\), with simple poles at \(\pm i\). For \(R > 1\), only \(i\) is inside, with residue \(\frac1{2i}\). So
\[ \int_{-R}^R \frac{dx}{1 + x^2} + \int_{\text{arc}} \frac{dz}{1 + z^2} = 2\pi i\cdot\frac1{2i} = \pi. \]By the ML estimate of Unit 7, the arc integral is at most \(\frac{\pi R}{R^2 - 1} \to 0\). Letting \(R \to \infty\): the integral is \(\pi\), as \(\arctan\) confirms.
The point is that the method works just as well when no antiderivative is available.
Example: \(\displaystyle\int_{-\infty}^\infty \frac{dx}{1 + x^4}\)
The poles of \(\frac1{1 + z^4}\) are the fourth roots of \(-1\): \(e^{i\pi/4}, e^{3i\pi/4}, e^{5i\pi/4}, e^{7i\pi/4}\). Two lie in the upper half plane. At each, by the \(\frac pq\) rule, the residue is \(\frac1{4z^3} = -\frac z4\) (since \(z^4 = -1\)). Their sum is \(-\frac14(e^{i\pi/4} + e^{3i\pi/4}) = -\frac{i\sqrt2}{4}\). The arc vanishes as before, so
\[ \int_{-\infty}^\infty \frac{dx}{1 + x^4} = 2\pi i\cdot\left(-\frac{i\sqrt2}4\right) = \frac{\pi}{\sqrt2}. \]The general rule: if \(p\) and \(q\) are polynomials with \(\deg q \ge \deg p + 2\) and \(q\) has no real zeros, then \(\int_{-\infty}^\infty \frac{p(x)}{q(x)}dx = 2\pi i\sum\operatorname{Res}\) over the poles in the upper half plane.
Trigonometric integrals
An integral over a full period, \(\int_0^{2\pi} R(\cos\theta, \sin\theta)\,d\theta\), becomes a loop integral around the unit circle. Substitute \(z = e^{i\theta}\):
\[ \cos\theta = \frac12\left(z + \frac1z\right), \qquad \sin\theta = \frac1{2i}\left(z - \frac1z\right), \qquad d\theta = \frac{dz}{iz}. \]Example: \(\displaystyle\int_0^{2\pi}\frac{d\theta}{2 + \cos\theta}\)
The integrand becomes \(\frac{1}{2 + \frac12(z + 1/z)}\cdot\frac{1}{iz} = \frac{2}{i(z^2 + 4z + 1)}\). The poles are \(z = -2 \pm \sqrt3\); only \(z_1 = -2 + \sqrt3\) is inside the unit circle. Its residue is \(\frac{2}{i(z_1 - z_2)} = \frac{2}{i\cdot2\sqrt3} = \frac1{i\sqrt3}\). So
\[ \int_0^{2\pi}\frac{d\theta}{2 + \cos\theta} = 2\pi i\cdot\frac{1}{i\sqrt3} = \frac{2\pi}{\sqrt3}. \]Integrals with oscillation
Integrals like \(\int_{-\infty}^\infty \frac{\cos x}{1 + x^2}\,dx\) appear in Fourier analysis and probability. The trick: \(\cos x = \operatorname{Re}\,e^{ix}\), and \(e^{iz}\) is small in the upper half plane, since \(|e^{i(x + iy)}| = e^{-y} \le 1\) for \(y \ge 0\).
Example: \(\displaystyle\int_{-\infty}^\infty\frac{\cos x}{1 + x^2}\,dx\)
Integrate \(\frac{e^{iz}}{1 + z^2}\) around the semicircle. On the arc, \(|e^{iz}| \le 1\), so the arc integral still vanishes. The residue at \(i\) is \(\frac{e^{i\cdot i}}{2i} = \frac{e^{-1}}{2i}\). So
\[ \int_{-\infty}^\infty\frac{e^{ix}}{1 + x^2}\,dx = 2\pi i\cdot\frac{e^{-1}}{2i} = \frac\pi e, \]and taking real parts, \(\displaystyle\int_{-\infty}^\infty\frac{\cos x}{1 + x^2}\,dx = \frac\pi e\).
Note that using \(\cos z\) directly would fail: \(\cos z\) is huge in the upper half plane (Unit 5), and the arc integral would explode. Choosing the right function to integrate is the art of the method.
Going deeper: the integral of sin x / x
\(\int_{-\infty}^\infty\frac{\sin x}{x}dx = \pi\) is a classic. Integrate \(\frac{e^{iz}}{z}\), which has a pole on the real line, around a semicircle with a small semicircular detour above 0. The big arc vanishes (more delicately, by Jordan's lemma, since \(\frac1R\) decays slowly), and the small detour of radius \(\varepsilon\) contributes \(-\pi i\) times the residue 1 in the limit: half a turn around the pole. Since nothing is inside, the real line integral equals \(\pi i\). Its imaginary part gives \(\pi\).
Summing series
The function \(\pi\cot\pi z\) has simple poles at every integer \(n\), each with residue 1 (Unit 10, scaled). Multiplying by \(f(z)\) places a copy of \(f(n)\) at each integer, ready to be collected by a large contour:
\[ \sum_{n=-\infty}^\infty f(n) = -\sum \operatorname{Res}\big(\pi\cot(\pi z)\,f(z)\big) \text{ at the poles of } f, \]for rational \(f\) decaying like \(\frac1{z^2}\), because the integral around a huge square tends to 0.
Example: the Basel problem
With \(f(z) = \frac1{z^2}\), the pole of \(f\) coincides with the pole of \(\cot\) at 0. Using \(\pi\cot\pi z = \frac1z - \frac{\pi^2z}{3} - \cdots\), the residue of \(\frac{\pi\cot\pi z}{z^2}\) at 0 is \(-\frac{\pi^2}{3}\). The other residues are \(\frac1{n^2}\). Their total is 0, so \(2\sum_{n=1}^\infty\frac1{n^2} - \frac{\pi^2}3 = 0\), and
\[ \sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}. \]Counting zeros
If \(f\) has a zero of order \(m\) at \(a\), then \(\frac{f'}{f}\) has a simple pole there with residue \(m\); a pole of order \(m\) gives residue \(-m\). Applying the residue theorem to \(\frac{f'}f\):
The argument principle
If \(f\) is meromorphic inside and on \(\gamma\), with no zeros or poles on \(\gamma\), then
\[ \frac1{2\pi i}\oint_\gamma\frac{f'(z)}{f(z)}\,dz = Z - P, \]the number of zeros minus the number of poles inside \(\gamma\), counted with multiplicity.
The left side is the winding number of the image curve \(f(\gamma)\) around 0: \(\frac{f'}{f}dz = d\log f\), and the change in \(\arg f\) around the loop, divided by \(2\pi\), counts turns. So you can count zeros inside a region just by watching how many times \(f\) turns as you walk around its edge. A useful consequence:
Rouché's theorem
If \(|g| < |f|\) on \(\gamma\), then \(f\) and \(f + g\) have the same number of zeros inside \(\gamma\).
(A dog on a short lead walks round a tree the same number of times as its owner.)
Example
How many roots does \(z^5 + 3z + 1\) have in \(|z| < 1\)? On \(|z| = 1\), \(|3z| = 3\) while \(|z^5 + 1| \le 2\). So it has as many roots as \(3z\): exactly one.
Practice set
Mixed questions covering the whole unit. Try each one before opening the answer.
1. Compute \(\displaystyle\oint_{|z| = 3}\frac{e^z}{z(z - 2)}\,dz\).
Show answer
Residues: at 0, \(\frac{1}{-2}\); at 2, \(\frac{e^2}{2}\). Both inside. Total: \(2\pi i\cdot\frac{e^2 - 1}2 = \pi i(e^2 - 1)\).
2. Compute \(\displaystyle\int_{-\infty}^\infty\frac{dx}{(x^2 + 1)(x^2 + 4)}\).
Show answer
Upper poles \(i\) and \(2i\). Residues: \(\frac{1}{2i\cdot3} = \frac1{6i}\) and \(\frac{1}{(-3)\cdot4i} = -\frac1{12i}\). Sum \(\frac1{12i}\). Integral: \(2\pi i\cdot\frac1{12i} = \frac\pi6\).
3. Compute \(\displaystyle\int_0^{2\pi}\frac{d\theta}{5 + 4\cos\theta}\).
Show answer
The integrand becomes \(\frac{1}{i(2z^2 + 5z + 2)} = \frac{1}{i(2z + 1)(z + 2)}\). Inside: \(z = -\frac12\), residue \(\frac{1}{i\cdot2\cdot\frac32} = \frac{1}{3i}\). Integral: \(\frac{2\pi}3\).
4. Compute \(\displaystyle\int_{-\infty}^\infty\frac{\cos 2x}{1 + x^2}\,dx\).
Show answer
Use \(\frac{e^{2iz}}{1 + z^2}\): residue at \(i\) is \(\frac{e^{-2}}{2i}\). The integral is \(\frac{\pi}{e^2}\).
5. How many zeros does \(z^4 - 6z + 3\) have in \(|z| < 1\)? In \(|z| < 2\)?
Show answer
On \(|z| = 1\): \(|6z| = 6 > |z^4 + 3| \le 4\), so one zero. On \(|z| = 2\): \(|z^4| = 16 > |{-6z} + 3| \le 15\), so four zeros. Three of them lie in \(1 \le |z| < 2\).
6. Use \(\frac{f'}{f}\) to find \(\displaystyle\frac{1}{2\pi i}\oint_{|z| = 2}\frac{3z^2}{z^3 - 1}\,dz\).
Show answer
This is \(\frac{f'}{f}\) for \(f = z^3 - 1\), whose three zeros (the cube roots of unity) all lie inside \(|z| = 2\). The answer is 3.
Summary and glossary
- \(\oint_\gamma f = 2\pi i\sum\operatorname{Res}\) over the singularities inside \(\gamma\).
- Real integrals over \(\mathbb R\): close with a semicircle, show the arc vanishes, sum the residues in the upper half plane.
- Integrals over \([0, 2\pi]\): substitute \(z = e^{i\theta}\) and integrate around the unit circle.
- For oscillating integrals use \(e^{iz}\), which is small in the upper half plane; \(\pi\cot\pi z\) turns sums into residues.
- The argument principle counts zeros minus poles; Rouché compares two functions on a boundary.
- Residue theorem
- A loop integral equals \(2\pi i\) times the sum of the residues inside.
- Closing the contour
- Completing a real interval to a loop with an arc whose contribution vanishes.
- Argument principle
- \(\frac{1}{2\pi i}\oint\frac{f'}{f} = Z - P\).
- Rouché's theorem
- A small perturbation doesn't change the number of zeros inside a loop.