# Why am I getting this error using Cauchy's integral formula?

$$\int_{\gamma}\frac{dz}{z^2+1} = \frac{1}{2i}\int_{\gamma}\frac{dz}{z-i}-\frac{1}{2i}\int_{\gamma}\frac{dz}{z+i} = 2 \pi i \times0$$

By cauchy's integral formula right?

According to my lecture notes this should be $\pi$

Where $\gamma$ is a closed contour, semicircle of radius $R$. in the upper half plane

• The semicircle only encloses one singularity, $z=i$, so one of those integrals will be zero and the other will be $\pi$. – TorsionSquid Apr 27 '16 at 13:17
• by the Cauchy integral formula, or by direct evaluation of $\int_\gamma \frac{dz}{z+i} = \int_{-R}^R \frac{dt}{t+i} + \int_0^\pi \frac{R i e^{i\theta}}{R e^{i\theta} + i} d\theta$ – reuns Apr 27 '16 at 13:40