Question: Evaluate the first two terms of $$I(m) = \int_0^{\pi/2}\frac{\sin^2\theta}{(1-m^2\sin^2\theta)^{1/2}}d\theta$$ as $m\to 1^-$.
My approach: Setting $m = 1-\epsilon$ and $k = \sin\theta$, we are left to find the asymptotic expansion of $$J(\epsilon) = \int_0^1\frac{k^2}{\sqrt{(1-k^2)[1-(1-\epsilon)^2k^2]}}dk$$ as $\epsilon\to 0^+$. Now, when $k = \mathrm{ord}(\epsilon)$, the integrand is $\mathcal{O}(\epsilon^2)$, which implies that $J(\epsilon) = \mathcal{O}(\epsilon^3)$. And, when $k = \mathrm{ord}(1)$, the integrand is $\mathcal{O}(1)$, which implies that $J(\epsilon) = \mathcal{O}(1).$ Therefore, choosing $\delta$ such that $\epsilon \ll \delta \ll 1$, we arrive at $$J(\epsilon)\sim \int_{\delta}^1 \frac{k^2}{\sqrt{(1-k^2)[1-(1-\epsilon)^2k^2]}}dk.$$ Now, since $\epsilon \to 0^+$, using Taylor expansion, $$\frac{1}{\sqrt{1-(1-\epsilon)^2k^2}} = \frac{1}{\sqrt{(1-k^2)}} -\frac{\epsilon k^2}{(1-k^2)^{3/2}}+\cdots.$$ Further, since $\delta \ll 1$, $$\lim_{\epsilon\to 0^+}J(\epsilon) \sim \lim_{m\to 1^-}\int_{`0'}^m \frac{k^2}{1-k^2}dk = \lim_{m\to 1^-}\left(-m + \frac{1}{2}\ln(m+1) - \frac{1}{2}\ln(m-1)\right)$$ $$= -1 + \frac{1}{2}\ln(2) + \mathcal{O}(1).$$
Can someone please check my approach and let me know if this is the correct way to solve this problem? Thanks a lot in advance.
In my humble opinion, what you are doing after $$I(m)=\int_0^1 \frac{k^2}{\sqrt{\left(1-k^2\right) \left(1-k^2 m^2\right) }}\,dk$$ is not correct (not to say more).
Just compute the elliptic integral $$I(m)=\frac{K\left(m^2\right)-E\left(m^2\right)}{m^2}$$ and now use the series expansion.
The first term would be $$-\frac{1}{2} (\log (1-m)+2-3 \log (2))+O\left((m-1)^1\right)$$
Try it with $m=\frac {999}{1000}$ : it would give $$\frac{3}{2} \log (5)+3\log (2)-1=3.49360$$ while the exact value is $3.49860$