Cauchy's theorem says integrals vanish when nothing bad is inside. When something bad is inside, the same theorem still helps: it lets us slide and shrink the contour freely, as long as we never drag it across a point where $f$ fails to be analytic. Then any contour around a point can be replaced by a tiny circle around it, where the integral is easy.
Key idea
Why it works
Worked examples
Worked example: A square instead of a circle
- The only bad point is $i$, inside the square.
- Shrink the square to a small circle around $i$ without crossing $i$: the integral of $\frac{1}{z - i}$ is $2\pi i$.
- Times $5$: $10\pi i$.
Answer: $10\pi i$
Worked example: A square power
- $-1$ is inside, but the power is $2$.
- $\frac{1}{(z + 1)^2}$ has the antiderivative $-\frac{1}{z + 1}$ away from $-1$, so the integral is $0$.
Answer: $0$
Worked example: Partial fractions
- $\frac{1}{z(z - 3)} = \frac{1}{3}\left(\frac{1}{z - 3} - \frac{1}{z}\right)$.
- On $|z| = 2$ only $0$ is inside: $\frac{1}{3}(0 - 2\pi i) = -\frac{2\pi i}{3}$.
- On $|z| = 4$ both are inside: $\frac{1}{3}(2\pi i - 2\pi i) = 0$.
Answer: $-\frac{2\pi i}{3}$ and $0$
Common mistake