Question: Calculate $\oint\frac{z^{2}}{z-4}dz$ over a contour C which is a circle with $\left|z\right|=1$ in anticlock-wise direction.
My Approach:
Using the Cauchy-Integral Formula $f\left(z_{0}\right)=\frac{1}{2\pi i}\oint \frac{f\left(z\right)}{z-z_{0}}dz$,
Let $z'=z-2\ \to dz'=dz$
So we have to calculate $\oint \frac{\left(z'+2\right)^{2}}{z'-2}dz'$, and also, the contour now becomes a circle of radius $1$ with center at $z=2$
Esentially, what we have now, is a point $z_{0}=2$ lying inside the new contour (a circle of radius $1$ with center at $z=2$) with $f\left(z\right)=\left(z+2\right)^{2}$.
So by using the cauchy-integral formula, our answer becomes: $\oint \frac{\left(z'+2\right)^{2}}{z'-2}dz'=2\pi i\cdot f\left(2\right)=32\pi i$
Is this method/answer correct? If not, where am I wrong? And is there another way to solve this problem?
So, the thing is, for Cauchy's integral formula
$$f(z_0) = \frac{1}{2\pi i} \oint_\gamma \frac{f(z)}{z-z_0} \, \mathrm{d}z$$
to apply, $\gamma$ needs to enclose the point $z_0$.
The circle $|z|=1$ does not enclose $4$. Moreover, the transformation $z'=z-2$ shifts the unit circle to the left, to become $|z+2| =1$, which has center $-2$ and still does not enclose $2$. (Transformations like this are generally pointless for Cauchy's integral formula, because you shift $\gamma$ and $z_0$ in the same direction by the same amount, so unless it simplifies something else it's generally not helpful.)
What you'll want to use is Cauchy's integral theorem, which claims that if $f$ is complex-differentiable in a simply connected domain, with $\gamma$ a simple closed curve contained therein, then
$$\oint_\gamma f(z) \, \mathrm{d}z = 0$$