# Why doesn't Integrate evaluate an elliptic integral?

My code is

Integrate[ 1/Sqrt[(x - a) (x - b) (x - c) (x - d)], {x, a,  ∞},
Assumptions -> 0 < d < c < b < a]


I know this can be expressed be the incomplete elliptic integral of first kind (EllipticF), but the output remains unevaluated

Integrate[ 1/Sqrt[(-a + x) (-b + x) (-c + x) (-d + x)], {x, a,  ∞},
Assumptions -> 0 < d < c < b < a]


Why does this happen? I am desperate

• If the output is echoed, it means Mathematica doesn't know what to do with it. – J. M.'s torpor May 20 '20 at 12:02
• Seems to work OK for the indefinite integral. And the result can be evaluated at a and Infinity using the Limit function – Gustavo Delfino May 20 '20 at 12:09
• But isn't it strange Mathematica can't calculate it? I also tried changing the integration from a to a generic M but the result is the same. From Gradshteyn Ryzhik I know this is equal to EllipticF(...,...), should I doubt the tables of Gradshteyn Ryzhik or is it common that Mathematica can't do integrals like this one? – Filippo Caleca May 20 '20 at 12:11

Actually V 12.1 can do it directly, you just have to wait a little bit long:

Clear["Global*"];

int = Integrate[1/Sqrt[(x - a) (x - b) (x - c) (x - d)], {x, a, Infinity},
Assumptions -> 0 < d < c < b < a]


May be OP used different Mathematica version? It will be good to post which version was used. Screen shot below:

A Workaround for now: (assuming proper integral)

 int = Integrate[1/Sqrt[(x - a) (x - b) (x - c) (x - d)], x]


low = Assuming[0 < d < c < b < a, Limit[int, x -> a]]
(* 0 *)

high = Assuming[0 < d < c < b < a, Limit[int, x -> Infinity]]


The above is then the final result.

• Thank you! I am using 11.3 – Filippo Caleca May 20 '20 at 12:52
• @FilippoCaleca integrate in V12.1 has improved over 11.3 – Nasser May 20 '20 at 12:56
• my output is different, in fact writing: int = Integrate[1/Sqrt[(x - a) (x - b) (x - c) (x - d)], x] the output is -((2 (-a + x) (-b + x) Sqrt[((a - b) (-c + x))/((b - c) (a - x))] Sqrt[((a - b) (-d + x))/((b - d) (a - x))] EllipticF[ ArcSin[Sqrt[((a - d) (-b + x))/((b - d) (-a + x))]], ((a - c) (b - d))/((b - c) (a - d))])/((a - b) Sqrt[((a - d) (b - x))/((b - d) (a - x))] Sqrt[(-a + x) (-b + x) (-c + x) (-d + x)])) the argument of EllipticF are different, how is it? – Filippo Caleca May 20 '20 at 13:09
• Note that you shouldn't expect the technique used in your workaround to work in all cases. See this old Wolfram blog post for some of the mathematical nitty-gritty as to why. – Michael Seifert May 20 '20 at 19:58
• Sure, if you go back to the concept of "area under a curve", then one might expect that an antiderivative ought to be continuous if the original function is continuous. But yes, it's not always easy to do. That's why Mathematica has to try harder for definite integrals, tho it has been known to still make mistakes sometimes. – J. M.'s torpor May 21 '20 at 1:41

In the newest version (i.e. 12.1) this integral evaluates a bit long, however changing the variable $$x \mapsto t = x-a\;$$ this can be evaluated a few times faster.

int2 = Integrate[ 1/Sqrt[t (t + a - b) (t + a - c) (t + a - d)], {t, 0, ∞},
Assumptions -> 0 < d < c < b < a]

2 EllipticF[ ArcSin[ Sqrt[(b - d)/(a - d)]],
((b - c)(a - d))/((a - c)(b - d))]/Sqrt[(a - c)(b - d)]

TraditionalForm[%]


I'm working with the system in cloud and sometimes it appears that the integral in question may remain unevaluated while int2 evaluates well even in version 11.2 on my machine.

Mathematica functions evolve with time even if its usage remains tha same. This aspect of the system is perhaps the most obvious in case of symbolic integration (Integrate), exact solutions of differential equations (DSolve) and the special functions (among them EllipticF). Elliptic functions and integrals appeared in Mathematica 1, however since then many new related functionalities would have been added later e.g. EllipticF was introduced in version 1.0 year 1988 and updated in 3.0 (1996). WeierstrassP was introduced in version 1.0 and updated in 3.0 (1996), however several new functionalities related appeared in version 11.2 (2017) like e.g. WeierstrassHalfPeriodW1 or WeierstrassE1 see e.g. this answer Integrate yields complex value, while after variable transformation the result is real. Bug?. Inspecting another answers therein one can see how Integrate can be sensitive when new functions or functionalities appear. It relates not only to new functionalities but also to widening domain of existing functions (in documentation pages one finds information when a function was introduced and when it was last updated, nevertheless there are also hiden changes that are not reported, however they may be crucial when certain different functions involved were updated). One should take attention to this aspect related to better handling of symbolic input of e.g. WeierstrssHalfPeriodW1 in version 12.1 with respect to 11.2 and it is advantageous to pay atention to this post. Elliptic functions and integrals play very important role in mathematics, physics, engineering and they are still better handled in newer versions of the system. This does not mean that Mathematica is defective but rather that perfect handling of special functions can be approached asymptotically and it is still in interest of developers of the system, e.g. one of leading experts in the field of special functions Oleg Marichev is a member of the special functions group in WRI. Having said that we can accept the state of art and the fact that things can change at least on the symbolic level.

Let's come back to version 11.2 with help of a simple change of variables: $$x \mapsto t+a$$

int3 = Integrate[ 1/Sqrt[t (t + a - b) (t + a - c) (t + a - d)], {t, 0, ∞},
Assumptions -> 0 < d < c < b < a]

(2 (EllipticF[ ArcSin[Sqrt[(a - d)/(b - d)]], ((a - c) (b - d))/((b - c) (a - d))]
+ I EllipticK[((a - b) (c - d))/((-b + c) (a - d))]))/Sqrt[(b - c) (a - d)]

TraditionalForm[%]


This might seem strange that there appears an imaginary number however the full integral is indeed real even though FullSimplify cannot demonstrate (in 11.2) that both results are equal. In 12.1 this still cannot be done, although a simpler identity can be proved, assuming that parameters are related somehow (in 12.1 not in 11.2), e.g.

FullSimplify[(8(EllipticF[ArcSin[Sqrt[3/2]], 4/3] +
I EllipticK[-(1/3)]))/(Sqrt[3] Sqrt[a^2])
- (4 EllipticF[ArcSin[Sqrt[2/3]], 3/4])/Sqrt[a^2], a > 0]


0

We can show that this is the case evaluating numerically, e.g.

With[{a = 4, b = 3, c = 2, d = 1}, {
(2 (EllipticF[ ArcSin[Sqrt[(a - d)/(b - d)]], ((a - c) (b - d))/((b - c) (a - d))]
+ I EllipticK[((a - b) (c - d))/((-b + c) (a - d))]))/Sqrt[(b - c) (a - d)],
( 2 (EllipticF[ ArcSin[Sqrt[(b - d)/(a - d)]],
((b - c)(a - d))/((a - c)(b - d))]))/Sqrt[(a - c)(b - d)]} // N // Chop]

{1.07826, 1.07826}


For example of a bit more testy case see e.g. Why does Integrate declare a convergent integral divergent?

Making appropriate plot of the functions and their difference might be helpful as well:

Plot[{#, # - (4 EllipticF[ArcSin[Sqrt[2/3]], 3/4])/Sqrt[a^2]}, {a, 0, 6},
PlotStyle -> Thick, AxesOrigin -> {0, 0}] &[ (
8(EllipticF[ArcSin[Sqrt[3/2]], 4/3] + I EllipticK[-1/3]))/(Sqrt[3]Sqrt[a^2])]
`