Cauchy's formula writes $f(a)$ as an integral in which $a$ appears only in the simple factor $\frac{1}{z - a}$. Differentiating under the integral sign with respect to $a$ is then easy, and it gives formulas for every derivative. As a consequence, an analytic function automatically has derivatives of all orders.
🔑 Key idea
If $f$ is analytic on and inside $C$ and $a$ is inside $C$, then for $n = 0, 1, 2, \ldots$
$$f^{(n)}(a) = \frac{n!}{2\pi i}\oint_C \frac{f(z)}{(z - a)^{n + 1}}\,dz, \qquad\text{that is,}\qquad \oint_C \frac{f(z)}{(z - a)^{n + 1}}\,dz = \frac{2\pi i}{n!}f^{(n)}(a).$$
The power in the denominator is one more than the order of the derivative.
💡 Why it works
Differentiate $f(a) = \frac{1}{2\pi i}\oint \frac{f(z)}{z - a}dz$ with respect to $a$: $\frac{d}{da}(z - a)^{-1} = (z - a)^{-2}$, then $2(z - a)^{-3}$, then $3!\,(z - a)^{-4}$, and so on, giving $n!\,(z - a)^{-(n + 1)}$ after $n$ steps. Moving the derivative inside the integral is justified because the integrand is a smooth function of $a$ on the contour. Since the right side exists for every $n$, so does $f^{(n)}(a)$: one complex derivative on an open set brings all the others with it.
$\frac{e^{2z}}{(z - 1)^3}$: a pole of order 3 at $1$. The integral is $\frac{2\pi i}{2!}\cdot(e^{2z})''\big|_{z = 1} = 4\pi e^2\,i \approx 92.85i$.
The first few cases of $\oint_C \frac{f(z)}{(z - a)^{n + 1}}dz = \frac{2\pi i}{n!}f^{(n)}(a)$.
Denominator
$n$
Integral equals
$z - a$
$0$
$2\pi i\,f(a)$
$(z - a)^2$
$1$
$2\pi i\,f'(a)$
$(z - a)^3$
$2$
$\pi i\,f''(a)$
$(z - a)^4$
$3$
$\frac{\pi i}{3}f'''(a)$
Compare with real calculus, where $f(x) = x|x|$ has a first derivative but no second at $0$. Nothing like that can happen for analytic functions: once $f'$ exists on an open set, $f''$, $f'''$ and all the rest exist there too, and each is analytic.
$n = 1$ with $f(z) = ze^z$ and $a = 2$, inside the circle.
$f'(z) = e^z + ze^z$, so $f'(2) = 3e^2$.
The integral is $\frac{2\pi i}{1!}\cdot 3e^2 = 6\pi e^2\,i$.
Answer: $6\pi e^2\,i$
The same formula gives Taylor coefficients: the coefficient of $(z - a)^n$ in the Taylor series of $f$ is $\frac{f^{(n)}(a)}{n!} = \frac{1}{2\pi i}\oint_C\frac{f(z)}{(z - a)^{n + 1}}dz$. So integrals of this kind are really asking for one Taylor coefficient, which is often the quickest way to compute them.
⚠️ Common mistake
Taking the power $n + 1$ as the order of the derivative, or dropping $n!$. In $\oint \frac{f(z)}{(z - a)^4}dz$ the derivative is $f'''$ (order $3$, not $4$), and the factor is $\frac{2\pi i}{3!} = \frac{\pi i}{3}$. A quick check with $f(z) = (z - a)^3$: the integrand is $\frac{1}{z - a}$, the integral is $2\pi i$, and the formula gives $\frac{2\pi i}{3!}\cdot 3! = 2\pi i$. Only the right $n$ and the $n!$ make that work.
Practice
Pass with 3 right answers, the last 2 in a row. Each right answer earns 3 XP.