


Elliptic Integrals
==================

Information about the elliptic integrals can be found in
Abramowitz & Stegun, Chapter 17.

.. index:: elliptic integral

Definition of Legendre Forms
----------------------------

The Legendre forms of elliptic integrals :math:`F(\phi,k)`, :math:`E(\phi,k)` and
:math:`\Pi(\phi,k,n)` are defined by,

.. math::
  F(\phi,k) = \int_0^\phi 1/\sqrt{1 - k^2 \sin^2(t)} dt \\
  E(\phi,k) = \int_0^\phi \sqrt{1 - k^2 \sin^2(t)} dt \\
  \Pi(\phi,k,n) =
    \int_0^\phi 1/((1 + n \sin^2(t))\sqrt{1 - k^2 \sin^2(t)}) dt

The complete Legendre forms are denoted by :math:`K(k) = F(\pi/2, k)` and
:math:`E(k) = E(\pi/2, k)`.

The notation used here is based on Carlson, Numerische Mathematik 33
(1979) 1 and differs slightly from that used by Abramowitz & Stegun,
where the functions are given in terms of the parameter :math:`m = k^2` and
:math:`n` is replaced by :math:`-n`.

Definition of Carlson Forms
---------------------------

The Carlson symmetric forms of elliptical integrals :math:`RC(x,y)`,
:math:`RD(x,y,z)`, :math:`RF(x,y,z)` and :math:`RJ(x,y,z,p)` are defined by,

.. math::
  RC(x,y) = 1/2 \int_0^\infty (t+x)^{-1/2} (t+y)^{-1} dt \\
  RD(x,y,z) = 3/2 \int_0^\infty
    (t+x)^{-1/2} (t+y)^{-1/2} (t+z)^{-3/2} dt \\
  RF(x,y,z) = 1/2 \int_0^\infty
    (t+x)^{-1/2} (t+y)^{-1/2} (t+z)^{-1/2} dt \\
  RJ(x,y,z,p) = 3/2 \int_0^\infty
    (t+x)^{-1/2} (t+y)^{-1/2} (t+z)^{-1/2} (t+p)^{-1} dt

Legendre Form of Complete Elliptic Integrals
--------------------------------------------

.. function:: gsl_sf_ellint_Kcomp(k)

 This routine computes the complete elliptic integral :math:`K(k)`.
 Note that Abramowitz & Stegun define this function in terms
 of the parameter :math:`m = k^2`.

.. function:: gsl_sf_ellint_Ecomp(k)

 This routine computes the complete elliptic integral :math:`E(k)`.
 Note that Abramowitz & Stegun define this function in terms
 of the parameter :math:`m = k^2`.

.. function:: gsl_sf_ellint_Pcomp(k, n)

 This routine computes the complete elliptic integral :math:`\Pi(k,n)`.
 Note that Abramowitz & Stegun define this function in terms
 of the parameters :math:`m = k^2` and :math:`\sin^2(\alpha) = k^2`, with the
 change of sign :math:`n \to -n`.

Legendre Form of Incomplete Elliptic Integrals
----------------------------------------------

.. function:: gsl_sf_ellint_F(phi, k)

 This routine computes the incomplete elliptic integral :math:`F(\phi,k)`.
 Note that Abramowitz & Stegun define this function in terms of the
 parameter :math:`m = k^2`.

.. function:: gsl_sf_ellint_E(phi, k)

 This routine computes the incomplete elliptic integral :math:`E(\phi,k)`.
 Note that Abramowitz & Stegun define this function in terms of the
 parameter :math:`m = k^2`.

.. function:: gsl_sf_ellint_P(phi, k, n)

 This routine computes the incomplete elliptic integral :math:`\Pi(\phi,k,n)`.
 Note that Abramowitz & Stegun define this function in terms of the
 parameters :math:`m = k^2` and :math:`\sin^2(\alpha) = k^2`, with the change of
 sign :math:`n \to -n`.

.. function:: gsl_sf_ellint_D(phi, k)

 This routine computes the incomplete elliptic integral :math:`D(\phi,k)`
 which is defined through the Carlson form :math:`RD(x,y,z)` by the following
 relation,

 .. math::
   D(\phi,k) = (1/3)(\sin(\phi))^3
     RD (1-\sin^2(\phi), 1-k^2 \sin^2(\phi), 1).

Carlson Forms
-------------

.. function:: gsl_sf_ellint_RC(x, y)

 This routine computes the incomplete elliptic integral :math:`RC(x,y)`.

.. function:: gsl_sf_ellint_RD(x, y, z)

 This routine computes the incomplete elliptic integral :math:`RD(x,y,z)`.

.. function:: gsl_sf_ellint_RF(x, y, z)

 This routine computes the incomplete elliptic integral :math:`RF(x,y,z)`.

.. function:: gsl_sf_ellint_RJ(x, y, z, p)

 This routine computes the incomplete elliptic integral :math:`RJ(x,y,z,p)`.
