Which technique proves this contour integral is zero (or gives its value)?
The decision path from a closed contour integral to the tool that actually finishes it.
Reach for this whenever you're staring at \oint_C f(z)\,dz (or a real integral someone has dressed up as one) and aren't sure which theorem does the work — ask whether f is analytic throughout the region C encloses first, then whether it has isolated singularities inside, and only then worry about which contour shape turns a real integral into a complex one.
What's actually being integrated
Every branch below assumes a closed contour — an open path has no "inside" to reason about.
Step 1 — is f analytic throughout the region C encloses?
Suppose f is analytic at every point on and inside a simple closed contour C. Then \oint_C f(z)\,dz = 0.
Corollary (multiply connected domains). Let f be analytic on a region. The region is bounded outside by a simple closed contour C_0. It contains finitely many "holes," each cut out by a simple closed contour C_1,\dots,C_n inside C_0. All the contours are traversed counterclockwise, and none overlap. Then \oint_{C_0} f(z)\,dz = \sum_{k=1}^{n}\oint_{C_k} f(z)\,dz.
Corollary (contour deformation). Let f be analytic on a region containing two contours C_1 and C_2 with the same endpoints. For closed contours, the region should contain the annular region between them. Suppose C_1 can be continuously deformed into C_2 without ever passing through a point where f fails to be analytic. Then \int_{C_1} f(z)\,dz = \int_{C_2} f(z)\,dz.
Analytic everywhere inside and on C, no exceptions? The integral is zero outright — stop here, no singularity-hunting needed.
Show proof
Main statement (proof sketch). The classical argument is due to Goursat and is genuinely more delicate than anything else in this course; only the idea is given here, not a fully rigorous version. Triangulate the region enclosed by C into a single triangle T (any simple closed contour can be built up from finitely many triangles, so it suffices to treat one). Bisecting each side of T subdivides it into four congruent sub-triangles, each with half the perimeter of T, whose boundary integrals of f sum exactly to \oint_T f(z)\,dz — the interior edges shared by adjacent sub-triangles are traversed once in each direction and cancel. By the pigeonhole principle, at least one sub-triangle T_1 has \left|\oint_{T_1} f\right| \ge \frac14\left|\oint_T f\right|. Repeating this quartering on T_1, then on the resulting sub-triangle, and so on, produces a nested sequence of shrinking triangles T\supset T_1\supset T_2\supset\cdots with perimeter of T_n equal to 2^{-n} times the perimeter of T, and \left|\oint_{T_n} f\right| \ge 4^{-n}\left|\oint_T f\right|. The nested triangles shrink to a single point z^* inside T (a compactness argument — a nested sequence of shrinking closed regions with diameters going to 0 has exactly one point common to all of them), where f is analytic. Analyticity at z^* means f(z) is well approximated near z^* by its linear part, f(z) = f(z^*) + f'(z^*)(z-z^*) + \varepsilon(z)(z-z^*) with \varepsilon(z)\to0 as z\to z^*; the constant and linear terms f(z^*)+f'(z^*)(z-z^*) have an antiderivative (a polynomial in z), so their contour integral around any closed triangle vanishes by the Fundamental Theorem for Contour Integrals, leaving only the error term. Bounding that error term with the ML inequality on T_n — whose perimeter and diameter are both shrinking geometrically like 2^{-n}, while \varepsilon(z)\to0 on T_n — shows \left|\oint_{T_n}f\right| is smaller than 4^{-n} times any fixed positive number, for n large enough. Comparing this to the lower bound above forces \oint_T f = 0. A fully rigorous version of this "shrink and estimate" argument needs more real-analysis machinery (uniform continuity on compact sets, in particular) than this course assumes; the geometric idea — that quartering shrinks the region's perimeter by half and its "defect" by at worst a quarter each time, so the defect cannot survive the limit — is the genuine content of the theorem.
Multiply connected corollary. Cut the region between C_0 and the inner contours C_1,\dots,C_n by finitely many connecting segments (crosscuts) so that the resulting boundary is a single simple closed contour on which f is analytic everywhere on and inside it; the main theorem gives 0 for the integral around this cut boundary. Each crosscut is traversed once in each direction, so those pieces cancel, leaving exactly \oint_{C_0} f\,dz (outer boundary, counterclockwise) minus \sum_k \oint_{C_k} f\,dz (inner boundaries, counterclockwise) — the minus sign because the cut construction traverses each inner hole clockwise as seen from inside the cut region. Setting this difference to 0 gives the stated identity.
Contour deformation corollary. Take n=1 in the multiply connected corollary, with C_0 the outer of the two contours and C_1 the inner one (the region between them is exactly the "annulus" swept out by deforming one contour into the other without crossing a point of non-analyticity), giving \oint_{C_0}f = \oint_{C_1}f directly.
Step 2 — no, it has isolated singularities inside: use the residue theorem
(a) Let f be analytic on and inside a simple closed contour C, traversed counterclockwise. Let z_0 be a point strictly inside C. Then f(z_0) = \frac{1}{2\pi i}\oint_C \frac{f(z)}{z-z_0}\,dz.
(b) Under the same hypotheses, f has derivatives of every order at z_0. For every n\ge0, f^{(n)}(z_0) = \frac{n!}{2\pi i}\oint_C \frac{f(z)}{(z-z_0)^{n+1}}\,dz.
Corollary. An analytic function always has derivatives of every order. Each of these derivatives is itself analytic.
Example
The single-simple-pole special case that comes first historically — a residue theorem in miniature, for one known analytic numerator over one linear factor.
Show proof
(a). The integrand g(z) = f(z)/(z-z_0) is analytic on and inside C except at z_0 itself, so it is not covered directly by Cauchy–Goursat. Instead, let C_r be a small circle of radius r centered at z_0, small enough to lie entirely inside C; since g is analytic on the region between C and C_r, the contour-deformation corollary of Cauchy–Goursat gives \oint_C \frac{f(z)}{z-z_0}\,dz = \oint_{C_r} \frac{f(z)}{z-z_0}\,dz for every such r. Write f(z) = f(z_0) + \big(f(z)-f(z_0)\big) and split the right side into two integrals. For the first, \oint_{C_r} \frac{f(z_0)}{z-z_0}\,dz = f(z_0)\oint_{C_r}\frac{dz}{z-z_0} = f(z_0)\cdot 2\pi i, using the direct parametrization z=z_0+re^{i\theta}, dz = ire^{i\theta}\,d\theta, so \oint_{C_r}\frac{dz}{z-z_0} = \int_0^{2\pi} i\,d\theta = 2\pi i, independent of r. For the second, continuity of f at z_0 means that for any \varepsilon>0, |f(z)-f(z_0)|<\varepsilon once r is small enough that |z-z_0|=r stays inside that continuity neighborhood; the ML inequality then bounds \left|\oint_{C_r} \frac{f(z)-f(z_0)}{z-z_0}\,dz\right| \le \frac{\varepsilon}{r}\cdot(2\pi r) = 2\pi\varepsilon, which can be made arbitrarily small. Since the left side of the original deformation identity does not depend on r at all, while the right side equals 2\pi i f(z_0) plus a quantity that can be forced below any 2\pi\varepsilon, that quantity must in fact be 0. Therefore \oint_C f(z)/(z-z_0)\,dz = 2\pi i f(z_0), which rearranges to the stated formula.
(b). The same strategy proves the derivative formula, with one more layer of estimation: differentiating under the integral sign (justified by the same kind of difference-quotient and ML-inequality estimate used in part (a), applied to \frac{1}{z-z_0} and its powers rather than carried out in full here) shows that if f(z_0) is given by the integral in part (a), then f'(z_0) is given by differentiating the integrand in z_0 once, f''(z_0) by differentiating it twice, and so on, producing exactly the stated formula with (z-z_0)^{n+1} in the denominator and the constant n! appearing from the n-th derivative of (z-z_0)^{-1}. Because this differentiation can be repeated for every n, f has derivatives of every order at z_0.
Corollary. Part (b) shows every analytic f has an n-th derivative at every interior point of its domain, for every n; and each derivative f^{(n)}, being given itself by a Cauchy-type integral formula in z_0, is differentiable in z_0 by the same argument one order further — hence analytic.
Term
Residue
What the residue theorem actually sums — one number per enclosed singularity.
Let f be analytic inside and on a simple closed contour C (counterclockwise), except at finitely many isolated singular points z_1,\dots,z_k inside C. Then \oint_C f(z)\,dz = 2\pi i \sum_{j=1}^{k} \operatorname{Res}_{z=z_j} f.
Example
The general tool once more than one singularity (or one of higher order) sits inside C.
Show proof
Surround each singular point z_j with a small circle C_j, centered at z_j, with radius small enough that the C_j lie inside C, pairwise disjoint, and each containing no singular point of f other than z_j itself. Then f is analytic on the region bounded outside by C and inside by C_1,\dots,C_k — exactly the multiply connected setting of the Cauchy–Goursat theorem's corollary — so \oint_C f(z)\,dz = \sum_{j=1}^{k} \oint_{C_j} f(z)\,dz, each C_j traversed counterclockwise. It remains only to identify each \oint_{C_j} f\,dz.
By definition, the residue \operatorname{Res}_{z=z_j} f is the coefficient c_{-1} of (z-z_j)^{-1} in f's Laurent series on a punctured disk around z_j — and C_j, lying inside that punctured disk (having been chosen small enough), is exactly the kind of circle Laurent's Theorem uses to recover coefficients: c_{-1} = \frac{1}{2\pi i}\oint_{C_j} \frac{f(w)}{(w-z_j)^{-1+1}}\,dw = \frac{1}{2\pi i}\oint_{C_j} f(w)\,dw, taking n=-1 in Laurent's coefficient formula. Rearranged, this says \oint_{C_j} f\,dz = 2\pi i\operatorname{Res}_{z=z_j} f directly, for each j. Substituting into the sum above gives \oint_C f(z)\,dz = \sum_{j=1}^{k} 2\pi i\operatorname{Res}_{z=z_j} f = 2\pi i\sum_{j=1}^{k}\operatorname{Res}_{z=z_j} f.
Step 3 — this is really a real integral in disguise: which contour?
The singularity sits ON the real axis itself, not off it — route a small semicircular detour around it instead.