# Integrate with elliptic integral special function in result I'm trying to work with the following integral:

$$\int\sqrt{1-\frac14(\cosh x)^2}\mathrm dx$$

Feeding this to sage as integrate(sqrt(1-1/4*cosh(x)^2),x) leaves it pretty much as it stands. Feeding the same to Wolfram Alpha, I get a solution which at least at first glance looks better:

$$\int\sqrt{1-\frac14(\cosh x)^2}\mathrm dx=-\frac12i\sqrt3E\left(ix\Big\vert-\frac13\right)$$

So I wonder:

• Is there a way to obtain this kind of output using sage? (This is my main question.)
• In particular, is there a way to manually indicate that a given integral can likely be expressed in terms of elliptic integral functions, and that these would be of interest?
• Are these elliptic integral functions even available at all inside sage? If they are, under what name?
• Is there any benefit in using these special elliptic integral functions, as opposed to (a numeric_integral version of) the original integral, in terms of performance or accuracy when dealing with actual numeric data?
edit retag close merge delete

Sort by » oldest newest most voted

Answering your third question, yes they are! However, they are extremely loosely integrated in with the main symbolics.

As to the simplification question Thierry points out, it turns out that nearly all of the Maxima simplification methods yield this (though just sending it to Maxima and back, simplify, doesn't). (I also don't see this in Maxima proper, and I'm investigating this.) These are, of course, simplifications, which might only be valid over certain domains, but I haven't seen one involving an unevaluated integral before so I'm not sure what's going on there.

more

1

Got it - the Maxima abs_integrate package is to blame for this. Of course, there may be a branch issue involved. See [Trac 14591](http://trac.sagemath.org/sage_trac/ticket/14591).

1

Your link is for exponential integrals, which don't have that square root of sum involving square aspect of the integrand. Nevertheless, one topic down I found the special functions, and among these, [EllipticE](http://www.sagemath.org/doc/reference/functions/sage/functions/special.html#sage.functions.special.EllipticE) which should be the one Wolfram Alpha used.

Thank you, I didn't look very carefully at what this was supposed to be representing and thought it was [this guy](http://www.sagemath.org/doc/reference/functions/sage/functions/exp_integral.html#sage.functions.exp_integral.Function_exp_integral_e) with some unusual notation.

What makes me fear is the following:

sage: a = integrate(sqrt(1-1/4*cosh(x)^2),x)
sage: a.full_simplify()
cosh(x)


Which is definitely a wrong answer :(

Concerning your fourth question, the second component of the result of numerical_integral() is the error bound:

sage: numerical_integral(sqrt(1-1/4*cosh(x)^2),0,0.1)
(0.08655430733928117, 9.609458488855213e-16)

more

Apparently #13973 fixes this - thanks for checking to Jeroen.

Correct, http://trac.sagemath.org/ticket/13973 has not been implemented yet - there is a matrix issue we need to deal with.