Q: compute integral
$$\oint_{|z|=1} \frac {\cos z}{z^3} dz$$
A: I let $f(z)=\frac {\cos z}{z^3}$
$f(0) = \frac{1}{2\pi i} \oint \frac{f(z)}{(z-0)}dz$
$f(0) = \frac{1}{2\pi i} \frac{\cos (z=0)}{(z=0)^2}$
Now I'm stuck. I think I have to expand ${\cos z}$, but is it legal to do right before setting ${z=0}$, or do I have to expand it when it is still in the integral?
Cauchy's Integral Formula is
$$f^{(n)}(z_0)=\frac{n!}{2\pi i}\oint_C \frac{f(z)}{(z-z_0)^{n+1}}\,dz$$
Here, we have $f(z)=\cos z$, $z_0=0$ and $n=2$. Therefore, we have
$$\oint_{|z|=1} \frac{\cos z}{z^{3}}\,dz=\pi i\left.\frac{d^2\cos z}{dz^2}\right|_{z=0}=-\pi i$$