Visual walkthrough — Complex integration — contour integrals
Step 0 — What are we even integrating along?
Because is a point on a 2D sheet, "moving a little" — the thing we write — is a tiny arrow with a direction, not just a length. That single fact is why complex integration is different from the real line, where can only point left or right.

In the picture: the burnt-orange path is our contour . At each point a little teal arrow shows which way we are stepping. To add up along the curve, we need a way to walk the curve in order — that is the parametrisation below.
Step 1 — Turning the walk into a clock: the parametrisation
WHY this works: the left side is a mysterious 2D sum; the right side is an ordinary real integral in the single real variable . We have converted a walk on a sheet into a clock reading.

Look at the teal velocity arrow : it is tangent to the curve and its length is the walking speed. Multiplying the collected value by this arrow is what makes the sum keep track of direction. See Analytic functions for the class of where the answer stops caring about the path at all.
Step 2 — The seed experiment: walk once around, collecting
Take the simplest interesting loop: the unit circle, , , going counterclockwise. Here is exactly "the point on the circle at angle ".
Its velocity: . The factor rotates the position arrow by — which is precisely the direction you must face to move around a circle. That is the geometry, not algebra.
- — the value we collect at each point.
- — the step direction; the cancels the .
- — a full lap contributes a clean .
WHY it isn't zero: the answer is the entire source of residue theory. Notice is exactly the total angle swept — going around once. The marks it as a pure rotation.

The plum arrow tracks the accumulated value: it winds around and lands at after one lap.
Step 3 — Every other power dies: with
Same circle, now collect :
- on the circle.
- — a point spinning around at whole-number speed .
WHY it vanishes: for any integer , the exponent is a nonzero whole number, so makes complete loops as goes . A vector that spins around a whole number of full circles averages to nothing — its integral is . Only makes the exponent , so the arrow stands still and just accumulates.

Left panel (): the arrow closes back on the origin — net zero. Right panel (): it never closes, spiralling to . This is the whole content of Laurent series residues: only the term survives a loop.
Step 4 — Smooth everywhere inside ⇒ the loop gives zero (Cauchy)
Now split into its real and imaginary parts, , with and :
Each piece is a real line integral around a loop, so Green's theorem turns each loop into an area integral over the region the loop encloses:
+i\iint_D\!\Big(\tfrac{\partial u}{\partial x}-\tfrac{\partial v}{\partial y}\Big)dA.$$ - $\tfrac{\partial u}{\partial x}$ etc. — how fast each part changes as you nudge in each direction. - The two brackets are the two "swirl" densities Green's theorem measures over the whole disc $D$. **WHY both vanish for analytic $f$:** an [[Analytic functions|analytic]] function obeys the [[Cauchy–Riemann equations]] $u_x = v_y$ and $u_y = -v_x$. Substitute: $-v_x - u_y = -v_x - (-v_x) = 0$ and $u_x - v_y = u_x - u_x = 0$. Both integrands are **exactly zero at every interior point** — no swirl anywhere — so the whole loop integral collapses to $0$. > [!formula] Cauchy's Integral Theorem > If $f$ is analytic on and inside a closed contour $\gamma$, then $\displaystyle\oint_\gamma f\,dz = 0$. ![[deepdives/dd-maths-4.10.02-d2-s05.png]] Every little cell of $D$ has zero swirl (blank cells), so summing them gives nothing. Compare Step 2: there the "spike" at $z=0$ sat inside, and $1/z$ is **not** analytic there — that is the loophole. --- ## Step 5 — Shrink the loop onto the spike (Cauchy's Integral Formula) Take an analytic $f$ and a point $a$ **inside** $\gamma$. Look at $\dfrac{f(z)}{z-a}$: it is smooth everywhere except at the single spike $z=a$, where the denominator vanishes. **Key move — deform the loop.** In the ring between $\gamma$ and a tiny circle around $a$, the function $f/(z-a)$ is analytic, so by Step 4 the loop integral over that ring is $0$. That means we may **slide $\gamma$ inward** onto a tiny circle $z = a + \varepsilon e^{it}$ without changing the integral. $$\oint_\gamma\frac{f(z)}{z-a}\,dz=\int_0^{2\pi}\frac{f(a+\varepsilon e^{it})}{\varepsilon e^{it}}\,\underbrace{i\varepsilon e^{it}}_{z'(t)}\,dt = i\int_0^{2\pi}f(a+\varepsilon e^{it})\,dt.$$ - $\varepsilon e^{it}$ — the tiny step away from $a$ at angle $t$. - The $\varepsilon e^{it}$ in $z'$ **cancels** the one in the denominator (just like Step 2!). **WHY the limit is clean:** as $\varepsilon \to 0$ the tiny circle collapses onto $a$, so $f(a+\varepsilon e^{it}) \to f(a)$, a constant. Then $i\int_0^{2\pi} f(a)\,dt = 2\pi i\,f(a)$. > [!formula] Cauchy Integral Formula & Residue Theorem > $$f(a)=\frac{1}{2\pi i}\oint_\gamma\frac{f(z)}{z-a}\,dz,\qquad \oint_\gamma f\,dz = 2\pi i\sum_k \operatorname{Res}_{z=z_k} f.$$ > A **residue** is the $c_{-1}$ coefficient of the [[Laurent series]] — the only surviving term of Step 3. ![[deepdives/dd-maths-4.10.02-d2-s06.png]] The big orange loop shrinks (dashed teal) onto the plum micro-circle around the spike $a$; the value never changes because the ring between them is swirl-free. See [[Residue theorem applications]] for using this on real integrals. --- ## Step 6 — Edge cases you must never trip on > [!mistake] "Closed loop ⇒ 0, always." > Only if $f$ is analytic **inside**. A spike inside (like $1/z$) breaks it — you get $2\pi i\sum$Res. > [!mistake] "Path doesn't matter." > True only for analytic $f$. For $\bar z$ (not analytic), swapping the straight line for an arc > changes the answer. Check analyticity first. - **Spike ON the contour** (not inside): the integral is not defined by this theorem — the loop passes through the singularity. Nudge the contour off it (principal-value techniques). - **Clockwise orientation:** reverses the walk, so every $dz \to -dz$ — the answer flips sign: clockwise gives $-2\pi i\sum$Res. - **No spike at all inside** ($n\neq -1$ case, analytic case): the accumulated arrow closes up — $0$. ![[deepdives/dd-maths-4.10.02-d2-s07.png]] Three loops: (1) spike inside → $2\pi i$; (2) spike outside → the loop encloses only smooth ground → $0$; (3) same spike but clockwise → $-2\pi i$. --- ## The one-picture summary ![[deepdives/dd-maths-4.10.02-d2-s08.png]] One frame compresses the whole story: **parametrise** the walk ($dz = z'\,dt$) → on a loop **only the $1/z$ term survives** ($2\pi i$, everything else $0$) → **smooth interior kills the loop** (Cauchy) → **a spike contributes $2\pi i\times$ its residue** (residue theorem). Hard real integrals become *counting the spikes inside*. > [!recall]- Feynman retelling — the whole walkthrough in plain words > You stroll around a flat field, and at every step someone hands you a little arrow (that's > $f(z)\,dz$). To keep it honest you walk by a clock, $t$ — that's the parametrisation. On a perfectly > smooth field, walking a full loop, all the arrows cancel and you finish empty-handed: **zero**. > But bury a magic spike under the field. Now every single lap around the spike hands you the **exact > same** bundle, $2\pi i$ times the spike's strength (its residue), no matter how you wiggle the loop — > because the smooth ring between two loops always cancels, so you can shrink any loop down onto the > spike. That's why a fearsome integral turns into a schoolyard game: **count the spikes inside your > loop, add up their strengths, multiply by $2\pi i$.** Done. > [!mnemonic] > **"Only $1/z$ survives the loop; smooth dies to zero; a spike pays $2\pi i\times$Res."** --- ## Connections - [[Cauchy–Riemann equations]] — the equations that zero out both swirl integrands (Step 4). - [[Green's theorem]] — the real-analysis engine turning loop into area (Step 4). - [[Laurent series]] — residue = the surviving $c_{-1}$ term (Steps 3, 5). - [[Analytic functions]] — the class for which paths don't matter (Steps 1, 4). - [[Residue theorem applications]] — cashing the residue theorem into real integrals.