Cauchy's Theorem on Path Integrals Cauchy's Integral theorem: Let $U$ be a convex open set and suppose $f$ is a function which is analytic on $U$, except possibly at one point, where it is at least continuous. Then $$\int_{\gamma} f(z) dz=0$$
for every closed path in $U$. 
Let $\gamma$ trace the unit circle centered at $0+0i$ in the anticlockwise direction on the set $\mathbb{C}$. 
Then, $\int_{\gamma} \frac{1}{z^2} dz = 0$, which makes sense. 
But then why does $\int_{\gamma} \frac{1}{z} dz = 2\pi i$? 
Both $\frac{1}{z}$ and $\frac{1}{z^2}$ are not defined at $z=0$, but then how does Cauchy's theorem only apply to the latter?

A simpler look at the problem from "another" Cauchy's integral formula perspective, stating:
$$f^{(n)}(a)=\frac{n!}{2\pi i} \int\limits_{\gamma}\frac{f(z)}{(z-a)^{n+1}}dz$$
In this case $a=0$ and $f(z)=1$


*

*for $n=0$ $$1=\frac{1}{2\pi i} \int\limits_{\gamma}\frac{1}{z}dz$$

*for $n=1$ $$1'=0=\int\limits_{\gamma}\frac{1}{z^2}dz$$

