Visual walkthrough — Residue theorem — computing real integrals
We follow one concrete integral the whole way: Every abstract idea will be shown on this example first.
Step 1 — The road is really a slice of a 2-D map
Let us name the map. A complex number is written
- = how far right (the real axis, our road),
- = how far up (the imaginary axis),
- = the special number with , the unit that points "up".
The road is exactly the line .

Step 2 — Where does the function blow up? (find the poles)
- : the point — above the road, in the UHP.
- : the point — below the road, in the lower half-plane.

Recall Why is
a simple pole? Because : the factor appears to the first power. ::: A first-power zero of the denominator is exactly what "simple pole" means.
Step 3 — Bend the road into a closed loop
We build a contour in two pieces:
- the straight segment from to along the road (this is our integral, cut off at radius ),
- the arc : a semicircle of radius , for from to , arching over the top.
Here (rho) is just "how big we make the loop" — we will push it to later.

Step 4 — The whole loop is just times the trapped residue
Now compute that one residue. For a simple pole of (the parent derives this from near the pole):
- (the numerator), so ,
- , so , giving .

Notice: this is already , independent of how big is (as long as so is enclosed). That constancy is the clue that the arc must be doing nothing.
Step 5 — Why the far arc dies (the degree-gap picture)
Multiply the two (this is the standard "" bound):
The height shrinks faster () than the length grows (), so their product falls off like .

Step 6 — Take the limit: the road piece equals the answer
Start from Step 3's identity, insert Step 4's value on the left and let the arc go to :
= \underbrace{\int_{-\rho}^{\rho}\frac{dx}{1+x^2}}_{\to\,\int_{-\infty}^{\infty}} + \underbrace{\int_{\Gamma_\rho}f\,dz}_{\to\,0\ \text{(Step 5)}}.$$ Taking $\rho\to\infty$: $$\boxed{\int_{-\infty}^{\infty}\frac{dx}{1+x^2}=\pi.}$$ > [!example] Sanity check with ordinary calculus > The real antiderivative is $\arctan x$, and > $$\arctan x\Big|_{-\infty}^{\infty}=\frac{\pi}{2}-\left(-\frac{\pi}{2}\right)=\pi.\ \checkmark$$ > The contour method reproduced it *without ever integrating* — we only found a pole and one residue. --- ## Step 7 — The degenerate & edge cases (never get surprised) Each of these is a scenario the naive picture might trip on. We show what changes. > [!intuition] Case A — A pole sits **on** the road ($y=0$) > If the denominator vanished at a real $x$, the integrand would blow up *on the path itself* — the > plain formula is illegal. The fix is to **indent** the contour with a tiny half-circle detour > around that point, which is the subject of [[Principal Value Integrals]]. For $\frac{1}{1+x^2}$ > this never happens: the poles $\pm i$ are off the road. > [!intuition] Case B — A **higher-order** pole (spike is "fatter") > If a factor is squared, e.g. $\frac{1}{(1+x^2)^2}$, then $z=i$ is an **order-2** pole. The simple > formula $\frac{g}{h'}$ no longer applies; you differentiate once: > $$\operatorname{Res}_{i}=\frac{1}{(2-1)!}\lim_{z\to i}\frac{d}{dz}\Big[(z-i)^2 f\Big]=\frac{1}{4i},$$ > giving $\int_{-\infty}^{\infty}\frac{dx}{(x^2+1)^2}=2\pi i\cdot\frac{1}{4i}=\frac{\pi}{2}$. The > *picture* is identical — same loop, same trapped point — only the residue recipe fattens. > [!intuition] Case C — Arch **downward** instead > Legal, but now you enclose $z=-i$, and a clockwise (negative) orientation flips the sign: > $$\operatorname{Res}_{-i}\frac{1}{1+z^2}=\frac{1}{2(-i)}=-\frac{1}{2i},\qquad > \int = (-2\pi i)\cdot\left(-\frac{1}{2i}\right)=\pi.$$ > The two extra minus signs cancel — you get the **same** $\pi$. Good: the road integral cannot > care which way you chose to close it. ![[deepdives/dd-maths-4.10.06-d2-s06.png]] > [!mistake] "The arc always vanishes." > **Why it feels right:** it did here so cleanly. **The fix:** it vanished *because* the degree gap > was $\ge 2$ (Step 5). Weaker decay needs [[Jordan's Lemma]]; a pole on the road needs > [[Principal Value Integrals]]; branch points need [[Contour Integration & Branch Cuts]]. Always > re-check the arc. --- ## The one-picture summary ![[deepdives/dd-maths-4.10.06-d2-s07.png]] The entire derivation in one frame: the **road** (real integral) plus the **arc** (vanishes) equal the **loop**, and the loop equals $2\pi i$ times the strength of the single **trapped spike** at $z=i$.\underbrace{\int_{-\infty}^{\infty}\frac{dx}{1+x^2}}{\text{road}} +\underbrace{0}{\text{arc}\ \to 0} =\underbrace{2\pi i\operatorname{Res}{i}}{\text{loop}} =2\pi i\cdot\frac{1}{2i}=\pi.
> [!recall]- Feynman retelling of the whole walkthrough > We had a straight road ($\int_{-\infty}^{\infty}\frac{dx}{1+x^2}$) and we wanted its total. > First we noticed the road is only the bottom edge of a big flat map (the complex plane), and our > function is happy to live all over that map. On the map, the function has two "danger points" > where it explodes: one just above the road ($i$) and one just below ($-i$). We tied the two ends > of the road together with a huge half-circle going over the top, making a closed loop that > **traps** the upper danger point and leaves the lower one outside. A magic rule (the residue > theorem) says the loop's total is simply $2\pi i$ times the "strength" of each trapped danger > point — here just one, with strength $\frac{1}{2i}$, giving $\pi$. Then we checked the huge arc: > as it gets bigger, the function on it shrinks like $1/\rho^2$ while the arc only grows like $\rho$, > so the arc's contribution melts to zero. What is left is the road alone, which therefore equals > the loop's $\pi$. Same answer that $\arctan$ gives — but we never integrated, we just counted one > spike. > [!mnemonic] Road + dead Arc = Loop = $2\pi i\sum$ trapped strengths. --- ## Connections - [[Residue theorem — computing real integrals]] (this page derives its central boxed result in pictures) - [[Cauchy's Integral Theorem & Formula]] (why smooth regions add nothing to a loop) - [[Laurent Series & Classification of Singularities]] (what "residue $=c_{-1}$" and pole order mean) - [[Jordan's Lemma]] (when the degree gap is only $1$ and the arc needs oscillatory decay) - [[Principal Value Integrals]] (Case A: a pole sitting on the road) - [[Contour Integration & Branch Cuts]] (loops that dodge branch points instead of poles)