Why is this solution correct? I am going over the solutions to some complex integration exercises, and I don't fully understand the arguments the following exercise.
I marked every transition a number, and my questions are in bold:
$$
\int_{|z| = 2}\frac{dz}{\sqrt{z^2 - 1}} \overset{(1)}{=} \int_{|z| = 2}\frac{dz}{z\sqrt{1 - \frac{1}{z^2}}} \overset{(2)}{=} \int_{|z| = R}\frac{dz}{z\sqrt{1 - \frac{1}{z^2}}} \overset{(3)}{=} \int_{|z| = R}\frac{dz}{z[1 + o(\frac{1}{z^2})]} \overset{(4)}{=} \int_{|z| = R}\frac{1}{z} [1 + o(\frac{1}{z^2})]dz \overset{R \rightarrow \infty}{\rightarrow} 2\pi i
$$


*

*Instructions say that we must make sure that the branches for the square roots are compatible (not sure what the correct translation is). What does it mean? How do I check that?

*Explanation says that since $f \in Hol(\{2 < |z| < R\})$, we can integrate over $|z| = R$. I figured it's because we can integrate over the ring bounds and the sum of the integrals will be 0. But shouldn't we change sign in this case?

*Here we choose a branch $\varphi$ of square root such that $\varphi(1) = 1$ and then $\varphi(1+\Delta h) = \varphi(1) + \int_{[1, 1+ \Delta h]}\varphi ' = 1 + o(\Delta h)$

*Why is this justified?
Side note - writing this question really helped me understand things better! :)
Thanks!
 A: *

*If $f \colon U \to \mathbb{C}$ is holomorphic, where $U\subset\mathbb{C}$ is a connected open set, a holomorphic function $g\colon U\to \mathbb{C}$ is a branch of the square root of $f$ if $g(z)^2 = f(z)$ for all $z\in U$. If $g$ is a branch of the square root of $f$, then so is $-g$, and since we assumed $U$ connected, these are the only branches of the square root of $f$. For if $h$ is a branch of the square root of $f$, then $$0 \equiv h(z)^2 - g(z)^2 = \bigl(h(z) - g(z)\bigr)\bigl(h(z)+g(z)\bigr),$$ so if either factor is nonzero at some $z_0\in U$, it is by continuity nonzero in a neighbourhood $V$ of $z_0$, and the other factor must therefore vanish on $V$, and by the identity theorem on all of $U$. On $\mathbb{C}\setminus [-1,1]$, there are two branches of the square root of $z \mapsto z^2 -1$, and two branches of the square root of $z \mapsto 1 - \frac{1}{z^2}$, the branches of the respective square roots differ by a constant factor of $-1$. That the chosen branches of the respective square roots are compatible means that the integrand in both integrals is the same, that means the chosen branches must satisfy $\sqrt{z^2-1} = z\sqrt{1-\frac{1}{z^2}}$ on all of $\mathbb{C}\setminus [-1,1]$. Since a branch of the square root of a function on a domain is completely determined by a single nonzero value, it is sufficient to check the equality in one point, e.g. $2$. So if in the first integral the chosen branch takes the positive real value $\sqrt{3}$ at $2$, the branch of $\sqrt{1-\frac{1}{z^2}}$ in the second integral is compatible if and only if it takes the positive real value $\frac{1}{2}\sqrt{3}$ in $2$.

*Since $f(z) = \frac{1}{z\sqrt{1-\frac{1}{z^2}}}$ is holomorphic on $\mathbb{C}\setminus [-1,1]$, Cauchy's integral theorem says that the integral of $f$ over a circle $\lvert z\rvert = r$ is independent of $r$, as long as $r > 1$, since any two such circles are homologous in $\mathbb{C}\setminus [-1,1]$. Another way to obtain the independence of the integral from the radius is to invoke Stokes' theorem for the closed $1$-form $f(z)\,dz$. Two such circles with different radius form the boundary of an annulus $A = \{ z : r_1 < \lvert z\rvert < r_2\}$, and Stokes' theorem says $$\int_{\partial A} f(z)\,dz = \int_A d\bigl(f(z)\,dz\bigr) = \int_A 0 = 0.$$ But, the boundary has to be positively oriented, and that means that the inner bounding circle has to be negatively oriented (so that $A$ lies to the left of both boundary curves), that is $$\int_{\partial A} f(z)\,dz = \int_{\lvert z\rvert = r_2} f(z)\,dz - \int_{\lvert z\rvert = r_1} f(z)\,dz.$$ There is no sign change, because in the application of Stokes' theorem, the orientation of the inner circle is negative.

*Yes, here the branch of $\sqrt{1-\frac{1}{z^2}}$ with $\lim\limits_{z\to\infty} \sqrt{1-\frac{1}{z^2}} = 1$ is chosen. It ought, however, to be a big $O$, and not a little $o$, since (for $\lvert w\rvert \ll 1$) $\sqrt{1+w} = 1 + \frac{1}{2} w + O(w^2)$, so we have $\sqrt{1-\frac{1}{z^2}} = 1 - \frac{1}{2z^2} + O\left(\frac{1}{z^4}\right)$ for large $\lvert z\rvert$.

*Expanding $\frac{1}{1+\varepsilon}$ into a geometric series yields $$\frac{1}{1+\varepsilon} = 1 - \varepsilon + \varepsilon^2 - \varepsilon^3 + \dotsc,$$ and since we're only interested in the asymptotic behaviour as determined by the constant term $1$, we can absorb all higher powers of $\varepsilon$ and the constant factor ($-1$) into the asymptotic estimate $\frac{1}{1+\varepsilon} = 1 + O(\varepsilon)$. Here $\varepsilon = b(z)\frac{1}{z^2}$, where $b(z)$ is bounded, yielding the overall $$\frac{1}{\sqrt{1-\frac{1}{z^2}}} = \frac{1}{1+O(z^{-2})} = 1 + O(z^{-2}).$$
