I would like to evaluate the following simple integral with complicated contour. $$ \lim_{r\rightarrow 0} \oint_{C (r)}dz~F(z) ,\quad F(z):=\left(\sqrt{z+m}+\sqrt{z-m}\right), \quad m>0 $$ where the contour $C(r) $ is on the left panel of the figure below.
I tried two methods
Method 1
Taking the limit $r\rightarrow 0$, the above integral can be decomposed into two integrations on two Riemann sheets shown on the middle panel of the figure below. $$ \begin{array}{cc} \lim_{r\rightarrow 0} \oint_{C (r)}dz~F(z) &=&\int_{-m , x\in R_1}^{m} dx ~ F(x)+\int_{m , x\in R_2}^{-m} dx ~ F(x)\\ &=& \int_{-m , x\in R_1}^{m} dx ~ F(x)-\int_{-m , x\in R_2}^{m} dx ~ F(x) \end{array} \quad \quad (1) $$ where in the second equality, we changed the variable $x \rightarrow -x$ for the second integral and used the fact that $F(-x) = F(x)$. Evaluating the first integral we find $$ \int_{-m , x\in R_1}^{m} dx ~ F(x) = \frac{4\sqrt{2}}{3} m (\sqrt{m}+ \sqrt{-m}) $$ On the first Riemann sheet $R_1$, we have $\sqrt{-1} = i$, so the above integral becomes $\frac{4\sqrt{2}}{3} m (\sqrt{m}+ i\sqrt{m})$. On the second Riemann sheet $R_2$, we have $\sqrt{-1} = - i$, so the second integral becomes $ \frac{4\sqrt{2}}{3} m (\sqrt{m}-i \sqrt{m})$. Therefore the final solution is $$ \lim_{r\rightarrow 0} \oint_{C (r)}dz~F(z) =i2\frac{4\sqrt{2}}{3} m \sqrt{m}. \quad \quad (2) $$
Method 2
Let's assume we don't know how to explicitly evaluate $ \int_{-m }^{m} dx ~ F(x)$. In this case, we can not follow the trick used above where we choose $\sqrt{-1}=i$ or $\sqrt{-1}=-i$ after evaluating the integral. This means we have to incorporate the effect of the different Riemann surfaces at the level of equation (1). I decided to do this by rotating the contour on the second Riemann surface by $2\pi$, centered around $z=-m$. This is schematically depicted in third panel of the figure below. Since the integration contour of the second integral of equation (1) crossed the branch cut, the square root function should have sign change, i.e. $$ F(z)=\left(\sqrt{z+m}+\sqrt{z-m}\right) \rightarrow \left(-\sqrt{z+m}-\sqrt{z-m}\right) = -F(z) $$ Then the sum of two integrals in equation (1) will simply be the $$ \int_{-m , x\in R_1}^{m} dx ~ F(x)-\int_{-m , x\in R_2}^{m} dx ~ F(x) = \int_{-m , x\in R_1}^{m} dx ~ F(x)+\int_{-m , x\in R_1}^{m} dx ~ F(x) = 2\int_{-m , x\in R_1}^{m} dx ~ F(x) $$ Evaluating this integral gives $$ 2\int_{-m , x\in R_1}^{m} dx ~ F(x) = 2\frac{4\sqrt{2}}{3} m (\sqrt{m}+ i\sqrt{m}) . \quad \quad (3) $$
Now, here is my question:
Two methods to solve the integral resulted in two different solutions (2) and (3). I can not identify where I made a mistake and weather one of the method (or both) are wrong.
