Integrate $\int_{0}^{\pi}\frac{\sin(x)}{(\sin^{2} (x) + k\cos^{2}(x))^{1/2}}\,dx$ I am faced with a dilemma. I have the following integral:
$$I(g,b) = \int_{0}^{\pi} \frac{\sin(\theta)}{(\sin^2(\theta) + \frac{g}{b}\cos^2(\theta))^{1/2}} d\theta =  \int_{0}^{\pi} \frac{\sin(\theta)}{(1 - (1-\frac{g}{b})\cos^2(\theta))^{1/2}} d\theta$$
I know that if $g=b=1$:
$$I(1,1) = \int_{0}^{\pi} \frac{\sin(\theta)}{(\sin^2(\theta) + \cos^2(\theta))^{1/2}} d\theta =  \int_{0}^{\pi} \sin(\theta) d\theta = \big[-\cos(\theta)\big]_{0}^{\pi} =2$$
However if I solve the integral by substitution;
$$u= \big( 1-\frac{g}{b}\big)^{\frac{1}{2}} \cos(\theta) $$
$$du= -\big( 1-\frac{g}{b}\big)^{\frac{1}{2}} \sin(\theta)  d\theta$$
$$-\frac{du}{\big( 1-\frac{g}{b}\big)^{\frac{1}{2}} \sin(\theta)}=   d\theta$$
when
$\theta=0 $  ;  $u = \big( 1-\frac{g}{b}\big)^{\frac{1}{2}} =u_0$
$\theta=\pi $  ;  $u = -\big( 1-\frac{g}{b}\big)^{\frac{1}{2}} =u_{\pi}$
$u_0 = - u_{\pi}$
Thus the integral becomes:
$$I(g,b) = \int_{-u_{\pi}}^{u_{\pi}}-  \frac{\sin(\theta)}{(1 - u^2)^{\frac{1}{2}}}\frac{du}{\big( 1-\frac{g}{b}\big)^{\frac{1}{2}} \sin(\theta)} = -\frac{1}{\big( 1-\frac{g}{b}\big)^{\frac{1}{2}} }\int_{-u_{\pi}}^{u_{\pi}} \frac{du}{(1 - u^2)^{\frac{1}{2}}} $$
Now, depending on whether the minus sign at the fron of the expresison is taken within the integral or not we can see that this is either arrccos or arcsin.
$$\int \frac{du}{(1-u^2)^{\frac{1}{2}}} =  \arccos(u)$$
$$\int \frac{-du}{(1-u^2)^{\frac{1}{2}}} =  \arcsin(u)$$
If g=b=1:
For arcsin:
$$I(1,1) = -\frac{1}{(1-\frac{1}{1})^{\frac{1}{2}}} \bigg(\arcsin(-(1-\frac{1}{1})^{\frac{1}{2}} ) -\arcsin((1-\frac{1}{1})^{\frac{1}{2}} )\bigg) =\frac{1}{(1-\frac{1}{1})^{\frac{1}{2}}}\bigg(2\arcsin((1-\frac{1}{1})^{\frac{1}{2}} ) \bigg) = -\frac{2}{0} \arcsin(0)= -\frac{0}{0} $$
For arccos:
$$I(1,1) = \frac{1}{(1-\frac{1}{1})^{\frac{1}{2}}} \bigg( \arccos(-(1-\frac{1}{1})^{\frac{1}{2}} ) -\arccos((1-\frac{1}{1})^{\frac{1}{2}} ) \bigg)= \frac{1}{0} \bigg(\arccos(0)-\arccos(0)\bigg)= \frac{\bigg(\pi-\pi\bigg)}{0} =\frac{0}{0}$$
This has been solved in published work of others (whom are now dead and thus cannot be asked), but without any steps other than an additional function being $ E(g,b)=E(1,1)= 1-I(1,1) = -1$.
Thus $$I(1,1) = 2$$.
I(1,1) MUST be 2, but I do not see how the arcsin and arcos integrals are "wrong", now how to solve this integral.
In general g is between 0 and 1.
b is any real positive number greater than g.
EDIT:
The solution to the $I(g,b)$ integral has to be directly applicable for all g values between 0 and 1 including 0 and 1.
 A: Case 1: $ \ $ Let $k=g/b>1$. The indefinite integral is
$$
\int{\sin t\over\sqrt{\sin^2 t + k \cos^2t}} dt = -\frac{\log(\sqrt{2(k - 1)} \cos t + \sqrt{(k - 1) \cos2t + k + 1})}{\sqrt{k - 1}} + C
$$
$$
= -{\sinh^{-1}(\sqrt{k-1} \cos t)\over\sqrt{k-1}} + C_1.
$$
The definite integral from $0$ to $\pi$ is
$$
\int_0^{\pi}{\sin t\over\sqrt{\sin^2 t + k \cos^2t}} dt =
{\log(\sqrt{k}+\sqrt{k-1}) - \log(\sqrt{k}-\sqrt{k-1})\over\sqrt{k-1}}
$$
$$
= {2 \sinh^{-1}\sqrt{k - 1}\over\sqrt{k - 1}}.
$$
This is not directly applicable to the case $k=g/b=1$; however,
$$
\lim_{k\to1} {2 \sinh^{-1}\sqrt{k - 1}\over\sqrt{k - 1}}=2
$$
as expected.
Case 2: $ \ $ Now consider $0<k<1$. We have
$$
\int{\sin t\over\sqrt{\sin^2 t + k \cos^2t}} dt = 
-\frac{\arcsin(\sqrt{1-k} \cdot\cos t)}{\sqrt{1-k}} 
+ C
$$
and the definite integral from $0$ to $\pi$ is
$$
\int_0^{\pi}{\sin t\over\sqrt{\sin^2 t + k \cos^2t}} dt =
 {2 \arcsin\sqrt{1-k}\over\sqrt{1-k}}=
 {2 \arccos\sqrt{k}\over\sqrt{1-k}}.
$$
Again, as $k\to1$, the limit is $2$ as expected:
$$
\lim_{k\to1}  {2 \arcsin\sqrt{1-k}\over\sqrt{1-k}} = 2.
$$
Case 3: $ \ $ For $k=0$, the definite integral is equal to $\pi$ (because the integrand is $1$).
Case 4: $ \ $ For $k=1$, the definite integral is equal to $2$ (as already explained in the question).
