Regarding Cauchy Integral and Cauchy - Goursat Theorem on $g(z)=\int_C \frac{2s^2-s-2}{s-z} dz$ If $C$ is the circle $|z|=3$ 
$$g(z)=\int_C \frac{2s^2-s-2}{s-z} ds$$
then using Cauchy Integral
$$g(2) =\int_C \frac{2s^2-s-2}{s-2} dz = 2\pi i (2(2^2)-2-2) = 8\pi i$$
But what can we say about the value of $g(z)$ when $|z| > 3$?
By Cauchy Goursat,
$$\int_C f(z) dz = 0$$ 
if $f(z)$ is analytic at all points interior to and on a simple closed contour C
but if 
$$f(s) = \frac{2s^2-s-2}{s-z} $$
then we know that $f(s)$ is not analytic when $s=z$
so we know that there is no simple closed contour that can enclosed $s \neq z$
what am I missing here?
 A: Most of the confusion was probably caused by the switch from $z$ being a variable of integration in $\int f(z)\,dz$ to it being a fixed number in $$\int_C \frac{2s^2-s-2}{s-z} \,ds$$
The explanation given by Daniel Fischer is quoted  to create an actual answer here: 


*

*For $\lvert z\rvert > 3$, the integrand $\frac{s^2-s-2}{s-z}$ has no singularities enclosed by $C$, so the integral is $0$.

*For example, take $z=4$. Since
$C$ is the boundary curve of the disk with radius $3$ centered at the origin, $z = 4$ lies outside the closure that disk. Thus $\frac{s^2-s-2}{s-4}$ is holomorphic in a neighbourhood of the disk. Cauchy's integral theorem says the integral is $0$.

*The contour is a closed path in the plane. $z$ is a parameter, nothing more. The function $f(s) = \frac{2s^2-s-2}{s-z}$ is (remember, $z$ is just a parameter) analytic in the entire plane minus the point $z$. If $\lvert z\rvert = 3$, then $f$ has a singularity on $C$, and the integral does not exist. If $\lvert z\rvert > 3$, the contour $C$ does not wind around the singularity of $f$, so by Cauchy's integral theorem the integral is $0$. If $\lvert z\rvert < 3$, the contour winds (once) around the singuarity of $f$, and the integral is (in general) nonzero, it is $2\pi i(2z^2-z-2)$ then.
