Elliptic integrals



Raymond Toy wrote:
>> Here is what my current elliptic integral code does
>> (http://common-lisp.net/~rtoy/ellint3.mac).  It's really incomplete
>> because you have to do a lot of stuff by hand, but it produces something
>> reasonable.  Unfortunately, it gets the sign wrong sometimes.
>>
>>     
I've updated the code a bit (and it's at
http://common-lisp.net/~rtoy/maxima/ellint3.mac).  It seems to handle
elliptic integals of the first kind correctly now.   The reduction of
the general elliptic integral is mostly working, but some elliptic
integrals of the second kind aren't recognized as such because it thinks
they're integrals of the third kind.  But for the integrals of the
second kind that are recognized, the answer appears to be correct.  At
least the derivative produces the integrand.

Elliptic integrals of the third kind are not handled yet and are simply
returned as integrals.

ellintreduce is the main entry point:

ellintreduce(rxy, x, y, s1, s2, var)

rxy is the rational function R(x,y) where x and y are the variables of
the rational function and y^2 = s1*s2.  var is some temporary variable. 
The result is the simplified expression in terms of inverse Jacobi
functions, elliptic_eu (use make_elliptic_e to get it in terms of
elliptic_e). or an integral.  The second result is the substitution that
needs to be applied to get the result back in terms of x.

Of course, I'd like the "real" routine to take a rational expression and
be able to figure out R(x,y) for itself, along with the factors s1 and
s2, but that seems to be quite a bit of work to get maxima to recognize
that form.

Ray