# Integral looks like fraction of elliptic integrals but Mathematica cannot solve it.

I would like to obtain an analytical solution of this integral: \begin{equation} I=\int_{0}^{2\pi}\sqrt{\frac{a^{2}\sin^{2}(\theta)+b^{2}\cos^{2}(\theta)}{\hat{a}^{2}\sin^{2}(\theta)+\hat{b}^{2}\cos^{2}(\theta)}}\mathrm{d}\theta \end{equation} We have $a>0, b>0, \hat{a}>0, \hat{b}>0$ and $0\leq \theta \leq 2\pi$.

I have tried solving it in Mathematica with the appropriate assumptions, but it just returns the same integral back after a few minutes of computation:

Integrate[Sqrt[(b^2 Cos[\[Theta]]^2 + a^2 Sin[\[Theta]]^2)/(
bh^2 Cos[\[Theta]]^2 + ah^2 Sin[\[Theta]]^2)], {\[Theta], 0, 2 Pi},
Assumptions -> {a > 0, b > 0, ah > 0, bh > 0, 0 < \[Theta] < 2 Pi}]


As this integral looks like a fraction of elliptic integrals, I was hoping that perhaps an integration wizzard here may bring it to a form which Mathematica can handle or solve it altogether.

• I think it's not that simple, which is why Mathematica is struggling. The indefinite integral is indeterminate at $\pi/2$, for example. Also, according to the indefinite integral, the definite integral from $0$ to $2 \pi$ would always vanishes, which it clearly does not. – Alexander Erlich Oct 22 '15 at 13:33
• @keenPenguin: Of course it's $0$, if you evaluate it like that ! Write first $\displaystyle\int_0^{2\pi}=4\int_0^\tfrac\pi2$ , then evaluate. And if $\dfrac\pi2$ creates any problems, replace it with $\dfrac\pi2-\epsilon$, where $\epsilon=10^{-n}$, and n is the desired precision. – Lucian Oct 22 '15 at 23:27