I'm trying to evaluate $\int_{C(2,1)}(z^4-\frac{1}{z})dz.$
What I've done so far is note that $\int(z^4-\frac{1}{z})dz=\int_{C(2,1)}\frac{z^5-1}{z}dz$
So if we let $f(z)=z^5-1$
Then we have by Cauchy's Integral formula
$f(z_0)=\frac{1}{2\pi i}\int_{C(2,1)}\frac{f(z)}{z-z_0}dz=\frac{1}{2\pi i}\int_{C(2,1)}\frac{z^5-1}{z-0}dz$
$\Rightarrow\int_{C(2,1)}\frac{z^5-1}{z}dz=2\pi if(0)=-2\pi i$
This doesn't seem right though , I had thought that it would equal zero because $z_0=0$ is not in $C(2,1)$. Could anyone point out if I've made a mistake ?
[Edited to remove previous confusion.]
Cauchy's integral formula states that $$ f(z_0) = \frac{1}{2\pi i} \oint_C \frac{f(z)}{z - z_0}dz$$ when $z_0$ is in the interior of your simple contour $C$.
However, as you pointed out, $z_0 = 0$ is not in the interior of your contour $C(2,1)$, so Cauchy's integral formula does not apply here!
Your second approach, where you appear to be invoking Cauchy's theorem, is the correct approach. Since $z^4 - 1/z$ is holomorphic on the open set $U = \mathbb C - \{ 0 \}$, and since $U$ contains the contour $C(2,1)$ and its interior, you are right to conclude that the integral is zero.