I have this exercise:
$$\int_{|z|=1}\frac{\cos z}{z^3}dz$$
The way I tried to solve it was:
Since we have a singularity in $0$, and it is inside of the curve, lets consider the new curve: $|z|=1/2$, then by the deformation theorem and Cauchy's integral formulas, we get that: $$\int_{|z|=1}\frac{\cos z}{z^3}dz=\int_{|z|=\frac 12}\frac{\cos z}{z^3}dz=2\pi i(-\cos (0))=-2\pi i$$
Is this correct? I think I followed all the hypothesis correctly, but this puzzles me, since $0$ is still inside the circle.
By the theorem stated above, we get $$ \int_{|z|=1}\frac{\cos z}{z^3}dz = \frac{2\pi i}{2!}(-\cos 0)=-\pi i. $$ Also, the deformation theorem is not needed as Daniel Fischer commented.
$^1$ Fundamentals of Complex Analysis: with Applications to Engineering and Science, page 211