Evaluate $\int_{0}^{2\pi} b|\sin(\theta)| \sqrt{a^2\sin^2(\theta) + b^2\cos^2(\theta)} \ d\theta$ Evaluate
$$\int_{0}^{2\pi} b|\sin(\theta)| \sqrt{a^2\sin^2(\theta) + b^2\cos^2(\theta)} \ d\theta$$
I transformed it into:
$$\int_{0}^{2\pi} b|\sin(\theta)| \sqrt{a^2(1-\cos^2(\theta)) + b^2\cos^2(\theta)} \ d\theta\\ \rightarrow \frac{b}{\sqrt{b^2-a^2}}\int_{0}^{2\pi} |\sin(\theta)| \sqrt{\frac{a^2}{b^2-a^2} + \cos^2(\theta)} \ d\theta$$
Using $u = \cos(\theta)$ I can make the substitution:
$$\frac{-b}{\sqrt{b^2-a^2}}\int_{1}^{0}  \sqrt{\frac{a^2}{b^2-a^2} + u^2} \ du$$
Now I want to use the formula for $\int \sqrt{x^2 + a^2} dx$ but that will give me an expression of $\ln(x)$ I somehow need to end up with :
$$b^2 +\frac{a^2b}{\sqrt{a^2-b^2}}\arcsin(\frac{\sqrt{a^2-b^2}}{a})$$
Does anyone see a route to get this?

Assuming $b^2-a^2>0$,
$$
\begin{align}
&\int_{0}^{2\pi} b|\sin(\theta)| \sqrt{a^2(1-\cos^2(\theta)) + b^2\cos^2(\theta)} \ d\theta\\
& =b\sqrt{b^2-a^2}\left[\int_{0}^{\pi} \sin(\theta) \sqrt{\frac{a^2}{b^2-a^2} + \cos^2(\theta)} \ d\theta+\int_{\pi}^{2\pi} \sin(\theta)\sqrt{\frac{a^2}{b^2-a^2} + \cos^2(\theta)} \ d\theta\right]\\
&=b\sqrt{b^2-a^2}\left[-\int_1^{-1}\mathrm{d}x\sqrt{\frac{a^2}{b^2-a^2}+x^2}-\int_{-1}^{0}\mathrm{d}x\sqrt{\frac{a^2}{b^2-a^2}+x^2} \right]\\
&=b\sqrt{b^2-a^2}\int_0^1\mathrm{d}x\sqrt{\frac{a^2}{b^2-a^2}+x^2}\\
&=b\sqrt{b^2-a^2}\frac{1}{\sqrt{b^2-a^2}}\left[b+a\log\left(\frac{b+\sqrt{b^2-a^2}}{a}\right)\right].
\end{align}
$$
The last equality can be safely left to the reader. Using the identity $i \arcsin x = \ln(i x + \sqrt {1 - x^2} )$ we get the expression you wrote in the bottom.
