Here is the most surprising fact in the course: the values of an analytic function on a closed curve determine its values everywhere inside. It follows from deforming the contour down to a tiny circle around the point.
🔑 Key idea
Cauchy's integral formula. If $f$ is analytic on and inside a simple closed contour $C$ (counterclockwise) and $a$ is inside $C$, then
$$f(a) = \frac{1}{2\pi i}\oint_C \frac{f(z)}{z - a}\,dz, \qquad\text{that is,}\qquad \oint_C \frac{f(z)}{z - a}\,dz = 2\pi i\,f(a).$$
If $a$ is outside $C$, the integral is $0$ (Cauchy's theorem).
💡 Why it works
The integrand is analytic except at $a$, so we may replace $C$ by a small circle $|z - a| = \varepsilon$. Split $\frac{f(z)}{z - a} = \frac{f(a)}{z - a} + \frac{f(z) - f(a)}{z - a}$. The first piece integrates to $2\pi i\,f(a)$. The second piece stays bounded near $a$ (its limit is $f'(a)$), say by $M$, so by the ML inequality its integral is at most $M \cdot 2\pi\varepsilon$, which tends to $0$. Since the integral does not depend on $\varepsilon$, it equals $2\pi i\,f(a)$ exactly.
$\frac{e^z}{z - 1}$ around a circle: while $1$ is inside, the integral is $2\pi i\,e^{1} \approx 17.08i$ for every circle you choose. The residue label shows $e \approx 2.718$, the value $f(1)$.
$z^2 + 1 = (z - i)(z + i)$. Only $i$ is inside (the point $-i$ is $2$ away from the center).
Write the integrand as $\frac{g(z)}{z - i}$ with $g(z) = \frac{z}{z + i}$, analytic inside the circle.
$2\pi i\,g(i) = 2\pi i \cdot \frac{i}{2i} = \pi i$.
Answer: $\pi i$
The formula has striking consequences. An analytic function is completely determined inside a circle by its values on the circle: if two analytic functions agree on $C$, they agree inside. With a circle centered at $a$, it says $f(a)$ is the average of $f$ around the circle, the mean value property behind the maximum modulus principle. And in practice it evaluates integrals of the form $\oint\frac{f(z)}{z - a}dz$ by a single substitution.
Find the point $a$ where the denominator vanishes, and check that it is inside $C$.
Put everything else into $f(z)$ and check that $f$ is analytic on and inside $C$.
The integral is $2\pi i\,f(a)$.
⚠️ Common mistake
Forgetting $2\pi i$, or using the formula with $a$ outside. The formula is $\oint \frac{f(z)}{z - a}dz = 2\pi i\,f(a)$, not $f(a)$; the $f(a)$ version needs the factor $\frac{1}{2\pi i}$ in front. And it only applies when $a$ is inside $C$: for $\oint_{|z| = 1}\frac{e^z}{z - 3}dz$ the answer is $0$, not $2\pi i e^3$. Check the location of $a$ first, every time.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.