What it means to integrate along a contour
In Volume I a definite integral meant sweeping x from a to b along the real line. In the complex plane there is no single "left to right" — to add up a function f(z) we must first choose a contour, a directed path C through the plane, and integrate along it. A contour integral is written as the integral over C of f(z) dz, and like a line integral from multivariable calculus its value can depend on the path you take, not just on the endpoints.
Concretely, you parametrize the path as z(t) for t from a to b, so dz = z'(t) dt, and the contour integral becomes an ordinary real integral: integral from a to b of f(z(t)) z'(t) dt. Picture walking the unit circle counterclockwise as z(t) = e^{i t} with t from 0 to 2 pi; then dz = i e^{i t} dt and you are summing tiny complex steps i e^{i t} dt, each weighted by f. The whole machinery reduces complex integration to a parametrization you already know how to handle.
Cauchy's theorem: the loop that vanishes
Here is the first miracle of the subject. If f is analytic (complex-differentiable) everywhere on and inside a simple closed contour C, then the integral around C of f(z) dz equals zero. This is Cauchy's integral theorem. No matter how wild the loop, an analytic function leaves no net residue of itself once you come back to the start.
Why should this be true? Split f(z) = u + i v and dz = dx + i dy, and the single complex integral becomes two real line integrals. Apply Green's theorem to each, and the integrands that appear are exactly the Cauchy-Riemann equations: du/dx = dv/dy and du/dy = -dv/dx. Analyticity makes both double integrals vanish identically. So Cauchy's theorem is really the Cauchy-Riemann conditions wearing the costume of an integral — the complex-plane cousin of a conservative field, where the loop integral of a gradient is zero.
Deforming contours like rubber bands
Cauchy's theorem has an immensely useful corollary: in a region where f is analytic, you can slide and stretch a contour freely without changing the integral, as long as you do not drag it across any singularity. Two paths with the same endpoints give the same answer; a closed loop can be shrunk, bulged, or reshaped at will. This is path deformation, and it is the working analyst's superpower — you replace an ugly contour with a convenient circle or straight line, and the value is preserved.
When a singularity IS trapped inside, deformation tells you the whole loop integral equals the integral around a tiny circle hugging that bad point — all the interesting content collects there. That single idea is the seed of the residue theorem, which we develop in the next guide using a Laurent series to read off the leftover coefficient at each singularity.
C (big loop) deform inward
.--------------. .--------------.
/ \ / ___ \
| * z0 | ==> | / \ C0 | loop integral on C
| (singularity) | | | *z0 | | = small loop on C0
\ / \ \___/ / (the rest is analytic)
'--------------' '--------------'Cauchy's integral formula: the boundary knows everything
Now the second, even more startling result. If f is analytic on and inside a closed contour C, and z0 is any point inside, then f at z0 is recovered entirely from the values of f on the boundary: f(z0) = (1/(2 pi i)) times the integral around C of f(z)/(z - z0) dz. This is Cauchy's integral formula. The values on the rim of the loop completely determine the value at every interior point — the inside is hostage to the edge.
The derivation is exactly the deformation trick. Around C the integrand f(z)/(z - z0) is analytic except at z0, so shrink the loop to a tiny circle of radius r centered at z0: z = z0 + r e^{i theta}. On that circle dz = i r e^{i theta} d theta and z - z0 = r e^{i theta}, so the r's cancel and the integral becomes the integral from 0 to 2 pi of i f(z0 + r e^{i theta}) d theta. Let r go to zero; by continuity f tends to f(z0), and you are left with i f(z0) times 2 pi, which gives the formula after dividing by 2 pi i.
Differentiating under the integral sign with respect to z0 gives formulas for every derivative too: f^{(n)}(z0) = (n!/(2 pi i)) times the integral around C of f(z)/(z - z0)^{n+1} dz. One quiet consequence is profound: an analytic function is automatically infinitely differentiable and equals its own Taylor series, a rigidity with no parallel in the real world, where being differentiable once promises nothing about the second derivative.
Working a concrete loop, step by step
Let us evaluate the integral around the unit circle of (e^z)/(z - 0.5) dz. The integrand has a single bad point at z0 = 0.5, which lies inside the unit circle, while the numerator e^z is analytic everywhere. This is tailor-made for the formula with f(z) = e^z.
- Identify the pole: the denominator vanishes at z0 = 0.5, and since the magnitude 0.5 is less than 1, the pole sits inside the unit circle. Good — the formula applies.
- Match the pattern: write the integrand as f(z)/(z - z0) with f(z) = e^z (analytic inside) and z0 = 0.5.
- Apply Cauchy's integral formula: the integral around C of f(z)/(z - z0) dz = 2 pi i times f(z0) = 2 pi i times e^{0.5}.
- Read the answer: the loop integral equals 2 pi i times sqrt(e), roughly 3.30 times 2 pi i. We never antidifferentiated anything — the boundary value of e^z at the pole did all the work.
Notice the division of labor that powers all of applied complex analysis. If a contour encloses no singularity, Cauchy's theorem hands you zero instantly. If it encloses one nicely, Cauchy's integral formula reads the answer straight off the boundary value. And when there are several poles or worse singularities, these two results combine into the residue theorem and the evaluation of real integrals — closing a contour in the complex plane to crack a stubborn real definite integral is a fully legitimate method, not a trick or a cheat.