Finding a mistake in calculating $\int_{-1}^1 \frac{dz}{\sqrt{1-z^2}}$ using contour integral Let us calculate
$$I=\int_{-1}^1 \frac{dz}{\sqrt{1-z^2}} $$
using contour integral. I want to know what is wrong with the following argument.
Let $C$ denote the contour around the branch cut from $z=-1$ to $z=1$, wrapping around each branch point with small circular arcs with radius $\epsilon$. Since $\sqrt{1-z^2}=\sqrt{(1-z)(1+z)}\sim \mathcal{O}(\sqrt{\epsilon})$ for the small circular arcs each centered at $z=-1, z=1$, the $dz=\epsilon e^{i\theta} id\theta$ make the small circular arc contributions vanish. Since there is a branch cut (-1 sign difference in the upper and lower part of the integral), the contour integral becomes
$$\oint_C \frac{dz}{\sqrt{1-z^2}} = 2I =0$$
where in the last equality, I used the residue theorem and used the fact that there are no simple poles.
However, the result should be $I=\pi$.  Where is wrong?
 A: I just wanted to add another full example. Consider the contour integral $$I_R=\oint_{|z|=R} \frac{{\rm d}z}{z\sqrt{1-z^2}}$$
for some large $R$ counter-clockwise. The integrand is holomorphic on $\mathbb{C}$, except at $z=0$ where it has a simple pole and the cut is chosen to be $(-\infty,-1) \cup (1,\infty)$ i.e. the principal-branch of the square-root selects the argument from $(-\pi,\pi)$.
Estimating the integral gives $$|I_R| \leq \int_{0}^{2\pi} \frac{{\rm d}t}{\sqrt{|1-R^2 e^{2it}|}} \leq \frac{2\pi}{\sqrt{R^2-1}}$$
and so it vanishes for $R\rightarrow \infty$.
We can now deform the contour to enclose the 3 singularities separately counter-clockwise which gives $$I_\infty = 0 = \oint_{(-\infty,-1)} \frac{{\rm d}z}{z\sqrt{1-z^2}} + \oint_{|z|=1} \frac{{\rm d}z}{z\sqrt{1-z^2}} + \oint_{(1,\infty)} \frac{{\rm d}z}{z\sqrt{1-z^2}} = J_- + I_1 + J_+ \, .$$
Since the integrand only has a pole at $z=0$ inside of $|z|=1$, we can readily evaluate $I_1=2\pi i$ using the residue theorem. On the other hand $$J_+=\int_{1-i0}^{\infty-i0} \frac{{\rm d}z}{z\sqrt{1-z^2}} + \int_{\infty+i0}^{1+i0}\frac{{\rm d}z}{z\sqrt{1-z^2}} = -2i \int_1^\infty \frac{{\rm d}z}{z\sqrt{z^2-1}} = -2i \int_0^1 \frac{{\rm d}z}{\sqrt{1-z^2}}$$
where the last equality arises after substituting $z \rightarrow \frac{1}{z}$. Similarly you will find $J_-=J_+ $ and hence $$0=2\pi i - 4i \int_0^1 \frac{{\rm d}z}{\sqrt{1-z^2}} \, .$$
