I have ran into a question while performing a closed complex integral. The integral is: $$\oint\frac{1}{(z+1)(1-z)}dz$$ in the region $|z|=3$.
Since Cauchy's integral formula requires an integral of the form
$$\oint\frac{1}{(z-z_0)}dz$$ I sepparated the two integrals:
$$\oint\frac{1}{(z+1)(1-z)}dz=\oint \frac{\frac{1}{1+z}}{-(z-1)}dz+\oint \frac{\frac{1}{1-z}}{1+z}dz$$ Now I just evaluate using the formula, $$\oint\frac{1}{(z+1)(1-z)}dz=2\pi i(\frac{-1}{1+(1)}+\frac{1}{1-(-1)})=0$$
However, how can this be? I know that a closed integral is 0 if it doesnt contain any poles, can it also be 0 if it DOES contain poles?
Of course it can. Take $f(z)=\frac1{z^2}$, for instance. It has a pole at $0$. But, since $f$ has a primitive, the integral of $f$ along any closed path is $0$.