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?
 A: Let $$F(a,b)=\int_0^{2\pi}|\sin(x)|\sqrt{a^2\sin^2(x)+b^2\cos^2(x)}\,dx.$$
Symmetry of the integrand gives
$$F(a,b)=4\int_0^{\pi/2}|\sin(x)|\sqrt{a^2\sin^2(x)+b^2\cos^2(x)}\,dx.$$
For $x\in[0,\pi/2]$, $|\sin x|=\sin x$, so the integral is
$$F(a,b)=4\int_0^{\pi/2}\sin(x)\sqrt{a^2\sin^2(x)+b^2\cos^2(x)}\,dx.$$
Then the trick is to assume $a^2>b^2$, then we have
$$F(a,b)=4\int_0^{\pi/2}\sin(x)\sqrt{a^2-(a^2-b^2)\cos^2(x)}\,dx,$$
which is
$$F(a,b)=\frac{4}{\sqrt{a^2-b^2}}\int_0^{\pi/2}\sin(x)\sqrt{q^2-\cos^2(x)}\,dx,$$
where $$q=\frac{a}{\sqrt{a^2-b^2}}.$$
Take $u=\cos x$,
$$F(a,b)=\frac{4q}{a}\int_0^1\sqrt{q^2-u^2}\,du.$$
Can you take it from here?
A: 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.
