Deriving the formula
Step 1 — shrink the contour to a tiny circle. The integrand
f(z)/(z - a) is holomorphic everywhere inside
\gamma except at z = a. By Cauchy's theorem
we may deform \gamma down to a small circle
C_\varepsilon of radius \varepsilon about
a without changing the integral:
\oint_\gamma \frac{f(z)}{z - a}\,dz = \oint_{C_\varepsilon} \frac{f(z)}{z - a}\,dz.
Step 2 — parametrise the small circle. On
C_\varepsilon set
z = a + \varepsilon e^{it}, so
z - a = \varepsilon e^{it} and
dz = i\varepsilon e^{it}\,dt. The
\varepsilon e^{it} cancels:
\oint_{C_\varepsilon} \frac{f(z)}{z - a}\,dz = \int_0^{2\pi} \frac{f(a + \varepsilon e^{it})}{\varepsilon e^{it}}\,i\varepsilon e^{it}\,dt = i\int_0^{2\pi} f(a + \varepsilon e^{it})\,dt.
Step 3 — split f. Write
f(z) = f(a) + \bigl(f(z) - f(a)\bigr). The constant part comes
straight out:
i\int_0^{2\pi} f(a)\,dt + i\int_0^{2\pi} \bigl(f(a + \varepsilon e^{it}) - f(a)\bigr)\,dt = 2\pi i\,f(a) + R_\varepsilon.
Step 4 — kill the remainder with the ML inequality. By the
ML
inequality, the remainder term over C_\varepsilon is
bounded by M\,L with
L = 2\pi\varepsilon and
M = \max |f(z) - f(a)|. Since f is
continuous, that maximum \to 0 as
\varepsilon \to 0, so
|R_\varepsilon| \le M \cdot 2\pi\varepsilon \;\longrightarrow\; 0.
Step 5 — read off the formula. The integral does not depend on
\varepsilon, so in the limit only the constant term remains:
\oint_\gamma \frac{f(z)}{z - a}\,dz = 2\pi i\,f(a) \quad\Longrightarrow\quad f(a) = \frac{1}{2\pi i}\oint_\gamma \frac{f(z)}{z - a}\,dz.
Move the point inside and out
The circle is the contour \gamma; drag the point
a with the sliders. When a sits
inside, the integral \oint f(z)/(z - a)\,dz equals
2\pi i\,f(a); push a outside and the
integrand becomes holomorphic everywhere inside, so by Cauchy's theorem the integral is zero. The
readout shows the sample value for f(z) = z^2.
The formula only fires when a is strictly inside
\gamma and f is holomorphic on and within
the contour. Reach for it at a point outside \gamma and you do
not get f(a) — you get 0, because
then the integrand f(z)/(z - a) has no singularity inside the loop and
Cauchy's theorem sends the whole integral to zero. So
\frac{1}{2\pi i}\oint_\gamma \frac{f(z)}{z - a}\,dz equals
f(a) for interior a but
0 for exterior a — never confuse the two
cases.