Introduction to Elliptic Functions and Integrals
================================================

Maxima includes support for Jacobian elliptic functions and for complete and incomplete elliptic integrals.  This includes symbolic manipulation of these functions and numerical evaluation as well. Definitions of these functions and many of their properties can by found in Abramowitz and Stegun, Chapter 16, 567 and Chapter 17., 587  See also 22.2.  As much as possible, we use the definitions and relationships given in Abramowitz and Stegun.

In particular, all elliptic functions and integrals use the parameter m instead of the modulus k or the modular angle \alpha.  The following relationships are true:

m = k^2

k = sin(alpha)

Note that Abramowitz and Stegun uses the notation sn(u|m) where we use sn(u,m) instead.  The DLMF uses modulus k instead of the parameter m.

The elliptic functions and integrals are primarily intended to support symbolic computation.  Therefore, most of derivatives of the functions and integrals are known.  However, if floating-point values are given, a floating-point result is returned.

Support for most of the other properties of elliptic functions and integrals other than derivatives has not yet been written.

Some examples of elliptic functions:

     (%i1) jacobi_sn (u, m);
     (%o1)                    jacobi_sn(u, m)
     (%i2) jacobi_sn (u, 1);
     (%o2)                        tanh(u)
     (%i3) jacobi_sn (u, 0);
     (%o3)                        sin(u)
     (%i4) diff (jacobi_sn (u, m), u);
     (%o4)            jacobi_cn(u, m) jacobi_dn(u, m)
     (%i5) diff (jacobi_sn (u, m), m);
     (%o5) jacobi_cn(u, m) jacobi_dn(u, m)

           elliptic_e(asin(jacobi_sn(u, m)), m)
      (u - ------------------------------------)/(2 m)
                          1 - m

                 2
        jacobi_cn (u, m) jacobi_sn(u, m)
      + --------------------------------
                   2 (1 - m)

Some examples of elliptic integrals:

     (%i1) elliptic_f (phi, m);
     (%o1)                  elliptic_f(phi, m)
     (%i2) elliptic_f (phi, 0);
     (%o2)                          phi
     (%i3) elliptic_f (phi, 1);
                                    phi   %pi
     (%o3)                  log(tan(--- + ---))
                                     2     4
     (%i4) elliptic_e (phi, 1);
     (%o4)                       sin(phi)
     (%i5) elliptic_e (phi, 0);
     (%o5)                          phi
     (%i6) elliptic_kc (1/2);
                                          1
     (%o6)                    elliptic_kc(-)
                                          2
     (%i7) makegamma (%);
                                      2 1
                                 gamma (-)
                                        4
     (%o7)                      -----------
                                4 sqrt(%pi)
     (%i8) diff (elliptic_f (phi, m), phi);
                                     1
     (%o8)                 ---------------------
                                         2
                           sqrt(1 - m sin (phi))
     (%i9) diff (elliptic_f (phi, m), m);
            elliptic_e(phi, m) - (1 - m) elliptic_f(phi, m)
     (%o9) (-----------------------------------------------
                                   m

                                      cos(phi) sin(phi)
                                  - ---------------------)/(2 (1 - m))
                                                  2
                                    sqrt(1 - m sin (phi))

Support for elliptic functions and integrals was written by Raymond Toy.  It is placed under the terms of the General Public License (GPL) that governs the distribution of Maxima.

Categories: Elliptic functions

Functions and Variables for Elliptic Functions
==============================================

See Section 6.12, 569 and 22.2 for more information.

 -- Function: jacobi_sn (U, M)
     The Jacobian elliptic function sn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_cn (U, M)
     The Jacobian elliptic function cn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_dn (U, M)
     The Jacobian elliptic function dn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_ns (U, M)
     The Jacobian elliptic function ns(u,m) = 1/sn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_sc (U, M)
     The Jacobian elliptic function sc(u,m) = sn(u,m)/cn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_sd (U, M)
     The Jacobian elliptic function sd(u,m) = sn(u,m)/dn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_nc (U, M)
     The Jacobian elliptic function nc(u,m) = 1/cn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_cs (U, M)
     The Jacobian elliptic function cs(u,m) = cn(u,m)/sn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_cd (U, M)
     The Jacobian elliptic function cd(u,m) = cn(u,m)/dn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_nd (U, M)
     The Jacobian elliptic function nd(u,m) = 1/dn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_ds (U, M)
     The Jacobian elliptic function ds(u,m) = dn(u,m)/sn(u,m).

     Categories: Elliptic functions

 -- Function: jacobi_dc (U, M)
     The Jacobian elliptic function dc(u,m) = dn(u,m)/cn(u,m).

     Categories: Elliptic functions

 -- Function: inverse_jacobi_sn (U, M)
     The inverse of the Jacobian elliptic function sn(u,m). For -1 <= u <= 1, it can also be written (22.15.E12):

                                           u
                                          /
                                          [              1
                inverse_jacobi_sn(u, m) = I  ------------------------- dt
                                          ]             2          2
                                          /  sqrt((1 - t ) (1 - m t ))
                                           0

     Categories: Elliptic functions

 -- Function: inverse_jacobi_cn (U, M)
     The inverse of the Jacobian elliptic function cn(u,m). For -1 <= u <= 1, it can also be written (22.15.E13):

                                         1
                                        /
                                        [                1
              inverse_jacobi_cn(u, m) = I  ----------------------------- dt
                                        ]             2      2
                                        /  sqrt((1 - t ) (m t  - m + 1))
                                         u

     Categories: Elliptic functions

 -- Function: inverse_jacobi_dn (U, M)
     The inverse of the Jacobian elliptic function dn(u,m). For sqrt(1-m) <= u <= 1, it can also be written (22.15.E14):

                                          1
                                         /
                                         [               1
               inverse_jacobi_dn(u, m) = I  --------------------------- dt
                                         ]             2    2
                                         /  sqrt((1 - t ) (t  + m - 1))
                                          u

     Categories: Elliptic functions

 -- Function: inverse_jacobi_ns (U, M)
     The inverse of the Jacobian elliptic function ns(u,m). For 1 <= u, it can also be written (22.15.E121):

                                           inf
                                          /
                                          [               1
                inverse_jacobi_ns(u, m) = I    ----------------------- dt
                                          ]               2    2
                                          /    sqrt((1 - t ) (t  - m))
                                           u

     Categories: Elliptic functions

 -- Function: inverse_jacobi_sc (U, M)
     The inverse of the Jacobian elliptic function sc(u,m). For all u it can also be written (22.15.E20):

                                        u
                                       /
                                       [                 1
             inverse_jacobi_sc(u, m) = I  ------------------------------- dt
                                       ]             2                2
                                       /  sqrt((1 - t ) (1 - (1 - m) t ))
                                        0

     Categories: Elliptic functions

 -- Function: inverse_jacobi_sd (U, M)
     The inverse of the Jacobian elliptic function sd(u,m). For -1/sqrt(1-m) <= 1/sqrt(1-m), it can also be written (22.15.E16):

                                      u
                                     /
                                     [                  1
           inverse_jacobi_sd(u, m) = I  --------------------------------- dt
                                     ]                     2      2
                                     /  sqrt((1 - (1 - m) t ) (m t  + 1))
                                      0

     Categories: Elliptic functions

 -- Function: inverse_jacobi_nc (U, M)
     The inverse of the Jacobian elliptic function nc(u,m). For 1 <= u, it can also be written (22.15.E19):

                                        1
                                       /
                                       [                 1
           inverse_jacobi_nc(u, m) = - I  ------------------------------- dt
                                       ]         2                2
                                       /  sqrt((t  - 1) ((1 - m) t  + m))
                                        u

     Categories: Elliptic functions

 -- Function: inverse_jacobi_cs (U, M)
     The inverse of the Jacobian elliptic function cs(u,m). For all u it can also be written (22.15.E23):

                                       inf
                                      /
                                      [                  1
            inverse_jacobi_cs(u, m) = I    ----------------------------- dt
                                      ]          2            2
                                      /    sqrt(t  + 1) sqrt(t  - m + 1)
                                       u

     Categories: Elliptic functions

 -- Function: inverse_jacobi_cd (U, M)
     The inverse of the Jacobian elliptic function cd(u,m). For -1 <= u <= 1, it can also be written (22.15.E15):

                                          1
                                         /
                                         [              1
               inverse_jacobi_cd(u, m) = I  ------------------------- dt
                                         ]             2          2
                                         /  sqrt((1 - t ) (1 - m t ))
                                          u

     Categories: Elliptic functions

 -- Function: inverse_jacobi_nd (U, M)
     The inverse of the Jacobian elliptic function nd(u,m). For 1 <= u <= 1/sqrt(1-m), it can also be written (22.15.E17):

                                        1
                                       /
                                       [                 1
           inverse_jacobi_nd(u, m) = - I  ------------------------------- dt
                                       ]         2                    2
                                       /  sqrt((t  - 1) (1 - (1 - m) t ))
                                        u

     Categories: Elliptic functions

 -- Function: inverse_jacobi_ds (U, M)
     The inverse of the Jacobian elliptic function ds(u,m). For sqrt(1-m) <= u, it can also be written (22.15.E22):

                                        inf
                                       /
                                       [                 1
             inverse_jacobi_ds(u, m) = I    --------------------------- dt
                                       ]           2            2
                                       /    sqrt((t  + m - 1) (t  + m))
                                        u

     Categories: Elliptic functions

 -- Function: inverse_jacobi_dc (U, M)
     The inverse of the Jacobian elliptic function dc(u,m). For 1 <= u, it can also be written (22.15.E18):

                                            u
                                           /
                                           [             1
               inverse_jacobi_dc(u, m) =   I  ----------------------- dt
                                           ]         2        2
                                           /  sqrt((t  - 1) (t  - m))
                                            1

     Categories: Elliptic functions

Functions and Variables for Elliptic Integrals
==============================================

 -- Function: elliptic_f (PHI, M)
     The incomplete elliptic integral of the first kind, defined as

     integrate(1/sqrt(1 - m*sin(x)^2), x, 0, phi)

     See also elliptic_e and elliptic_kc.

     Categories: Elliptic integrals

 -- Function: elliptic_e (PHI, M)
     The incomplete elliptic integral of the second kind, defined as

     elliptic_e(phi, m) = integrate(sqrt(1 - m*sin(x)^2), x, 0, phi)

     See also elliptic_f and elliptic_ec.

     Categories: Elliptic integrals

 -- Function: elliptic_eu (U, M)
     The incomplete elliptic integral of the second kind, defined as

     elliptic_eu(u, m) = integrate(dn(v,m)^2,v,0,u) = integrate(sqrt(1-m*t^2)/sqrt(1-t^2), t, 0, tau)

     where tau = sn(u,m) .

     This is related to elliptic_e by

     elliptic_eu(u, m) = elliptic_e(asin(sn(u,m)),m)

     See also elliptic_e. Categories: Elliptic integrals

 -- Function: elliptic_pi (N, PHI, M)
     The incomplete elliptic integral of the third kind, defined as

     integrate(1/(1-n*sin(x)^2)/sqrt(1 - m*sin(x)^2), x, 0, phi)

     Categories: Elliptic integrals

 -- Function: elliptic_kc (M)
     The complete elliptic integral of the first kind, defined as

     integrate(1/sqrt(1 - m*sin(x)^2), x, 0, pi/2)

     For certain values of m, the value of the integral is known in terms of Gamma functions.  Use makegamma to evaluate them.

     Categories: Elliptic integrals

 -- Function: elliptic_ec (M)
     The complete elliptic integral of the second kind, defined as

     integrate(sqrt(1 - m*sin(x)^2), x, 0, pi/2)

     For certain values of m, the value of the integral is known in terms of Gamma functions.  Use makegamma to evaluate them.

     Categories: Elliptic integrals

 -- Function: carlson_rc (X, Y)
     Carlson's RC integral is defined by

     integrate(1/2*(t+x)^(-1/2)/(t+y), t, 0, inf)

     This integral is related to many elementary functions in the following way:

     log(x)  = (x-1)*rc(((1+x)/2)^2, x), x > 0

     asin(x) = x * rc(1-x^2, 1), |x|<= 1

     acos(x) = sqrt(1-x^2)*rc(x^2,1), 0 <= x <=1

     atan(x) = x * rc(1,1+x^2)

     asinh(x) = x * rc(1+x^2,1)

     acosh(x) = sqrt(x^2-1) * rc(x^2,1), x >= 1

     atanh(x) = x * rc(1,1-x^2), |x|<=1

     Also, we have the relationship

     R_C(x,y) = R_F(x,y,y)

     Some special values: R_C(0,1) = pi/2

     R_C(0,1/4) = pi

     R_C(2,1) = log(sqrt(2)+1)

     R_C(i, i+1) = pi/4 + i/2*log(sqrt(2)+1)

     R_C(0, i) = (1-i)*pi/(2*sqrt(2))

     Categories: Elliptic integrals

 -- Function: carlson_rd (X, Y, Z)
     Carlson's RD integral is defined by

     R_D(x,y,z) = 3/2*integrate(1/(sqrt(t+x)*sqrt(t+y)*sqrt(t+z)*(t+z)), t, 0, inf)

     We also have the special values

     R_D(x,x,x) = x^(-3/2)

     R_D(0,y,y) = 3/4*pi*y^(-3/2)

     R_D(0,2,1) = 3 sqrt(pi) gamma(3/4)/gamma(1/4)

     It is also related to the complete elliptic E function as follows

     E(m) = R_F(0, 1 - m, 1) - (m/3)* R_D(0, 1 - m, 1)

     Categories: Elliptic integrals

 -- Function: carlson_rf (X, Y, Z)
     Carlson's RF integral is defined by

     R_F(x,y,z) = 1/2*integrate(1/(sqrt(t+x)*sqrt(t+y)*sqrt(t+z)), t, 0, inf)

     We also have the special values

     R_F(0,1,2) = gamma(1/4)^2/(4*sqrt(2*pi))

     R_F(i,-i,0) = gamma(1/4)^2/(4*sqrt(pi))

     It is also related to the complete elliptic E function as follows

     E(m) = R_F(0, 1 - m, 1) - (m/3)* R_D(0, 1 - m, 1)

     Categories: Elliptic integrals

 -- Function: carlson_rj (X, Y, Z, P)
     Carlson's RJ integral is defined by

     R_J(x,y,z) = 1/2*integrate(1/(sqrt(t+x)*sqrt(t+y)*sqrt(t+z)*(t+p)), t, 0, inf)

     Categories: Elliptic integrals