# Different results with or without Assumptions in Integrate for an elliptic integral

Here are 2 examples I have examined.

1. Assumptions in Integrate.

Integrate[ Sqrt[1 + (b^2 x^2)/(a^4 - a^2 x^2)], {x, 0, a},
Assumptions -> a > b > 0]

Integrate[ Sqrt[1 + (b^2 x^2)/(a^4 - a^2 x^2)], {x, 0, a},
Assumptions -> a > b > 0]


2. Without Assumptions in Integrate.

Integrate[ Sqrt[1 + (b^2 x^2)/(a^4 - a^2 x^2)], {x, 0, a}]

ConditionalExpression[
(Sqrt[-(1/a)] a Sqrt[-(b^2/a)] EllipticE[1 - b^2/a^2])/Sqrt[b^2/a^2],
Re[a/Sqrt[a^2 - b^2]] > 1 || Re[a/Sqrt[a^2 - b^2]] < -1 ||
a/Sqrt[a^2 - b^2] \[NotElement] Reals]


Is there anyone who can explain this phenomenon?

• Mathematica's handling of elliptic integrals is not always optimal, but it has improved over the last couple of versions. For the record, which version of Mathematica are you using? Commented Aug 7, 2020 at 13:28
• @MichaelSeifert Mathematica 12 on Windows10
– kile
Commented Aug 8, 2020 at 0:48

This type of an integral can be rewritten more explicitly as the complete elliptic integral of the second kind, namely using change of the independent variable $$x\to \frac{x}{a}$$ and the integral will be equal (assuming $$a\neq 0$$): $$\int_0^{a}\sqrt{1+\frac{b^2 x^2}{a^4- a^2 x^2}} dx= a \int_0^{1}\sqrt{1+\frac{b^2 x^2}{a^2(1- x^2)}} dx$$

a Integrate[Sqrt[1 + (b^2 x^2)/(a^2(1-x^2))], {x, 0, 1}, Assumptions -> a > b > 0]

a EllipticE[1- b^2/a^2]


Elliptic integrals have branch cuts, e.g. the complete elliptic integral of the second kind $$E(m)$$ has a branch cut discontinuity from $$1$$ to $$\infty$$. This is the main reason why elliptic integrals not always evaluate seamlessly on the symbolic level (see this answer) and one has to rewrite given integrals into more familiar forms (see e.g. Why doesn't Integrate evaluate an elliptic integral? where one finds a more extended discussion). It is reasonable to avoid generic (and sometimes unexpectedly incorrect in exceptional cases) symbolic results and provide more special symbolic cases when one can deal with numerics instead. Dealing with Integrate without Assumptions one gets generically correct reasult (unless there might be a bug), however using Assumptions one would expect perfectly correct output and so then the system appears to be more cautious.

We can also evaluate our integral with a bit more general assumptions

a Integrate[ Sqrt[1 + (b^2 x^2)/(a^2(1 - x^2))], {x, 0, 1},
Assumptions-> a > 0 && b > 0 && a != b]


Quite analogous issue one can find in this question Assumptions allowing to calculate an elliptic integral.

For some reason, Mathematica takes a wrong turn in evaluating this integral if the integrand is $$\sqrt{1 + \frac{b^2 x^2}{a^4 - a^2 x^2}}.$$ However, if the expression under the radical is combined into a single square root, i.e. $$\sqrt{\frac{a^4 - a^2x^2 + b^2 x^2}{a^4 - a^2 x^2}},$$ Mathematica happily integrates it. This can be accomplished by the Together function applied under the square root:

Integrate[Sqrt[Together[1 + (b^2 x^2)/(a^4 - a^2 x^2)]], {x, 0, a}, Assumptions -> a > b > 0]

(* a EllipticE[1 - b^2/a^2] *)


(For the record, I am using Mathematica 12.0.0 on Mac OS. Elliptic-integral handling may be different under different recent versions.)