My question concerns the complete elliptic integral of the first kind, specifically in its Legendre form, defined below:
$$K(m) = \int_0^{\pi/2} \frac{d\theta}{\sqrt{1-m\sin^2\theta}}.$$
This function is well defined for $|m|<1$, but must be analytically continued to treat larger $m$. The proper way to do this continuation has already been presented here:
https://math.stackexchange.com/a/2008409/469366.
However, I do not understand the first equation of this answer. Namely, if one defines $m_\epsilon = m \pm i\epsilon$ with $m>1$ and $\epsilon>0$, how can one perform the expansion:
$$\lim_{\epsilon\rightarrow0}K(m_\epsilon) = \lim_{\epsilon\rightarrow0} \int_0^{\pi/2} \frac{d\theta}{\sqrt{1-m_\epsilon\sin^2\theta}} = \int_0^{\theta^*} \frac{d\theta}{\sqrt{1-m\sin^2\theta}} \pm i \int_{\theta^*}^{\pi/2} \frac{d\theta}{\sqrt{m\sin^2\theta-1}},$$
where the $\pm$ in this expansion corresponds to that in $m_\epsilon$, and the value $\theta^* = \arcsin(1/\sqrt{m})$ is the input for which the denominator becomes zero.
I understand that in the second integral, the denominator would have a negative real part, and so we can reverse the order and pull out a $-i$ in front of the whole integral, but the introduction of a $\pm$ due to the $\pm$ inside $m_\epsilon$ is something I have not been able to figure out.
I feel that this may have something to do with the branch cuts present in the elliptic integrals, but I have only encountered those cuts when $m$ is taken as the independent variable, not when dealing with the integral over $\theta$, itself.
If anyone can shed light on how to perform this expansion, I would greatly appreciate it. To give you an idea of my background: I have a mathematics bachelors, but I only encountered complex analysis in physics graduate school, so I am familiar but not highly advanced in this subject.