ellipticIntegralK

Evaluates the complete elliptic integral of the kind K(x).

Synopsis

ellipticIntegralK (x)

Required Arguments

float x (Input)
Argument for which the function value is desired.

Return Value

The complete elliptic integral \(K(x)\).

Description

The complete elliptic integral of the first kind is defined to be

\[K(x) = \int_0^{\pi/2} \frac{d \theta}{\left[1 - x \sin^2 \theta\right]^{1/2}} \text{ for } 0 \leq x < 1\]

The argument x must satisfy \(0\leq x<1\); otherwise, ellipticIntegralK returns machine(2), the largest representable floating-point number. For more information, see the description for machine.

The function \(K(x)\) is computed using the routine ellipticIntegralRF and the relation \(K(x)=R_F(0,1-x,1)\).

Example

The integral \(K(0)\) is evaluated.

from __future__ import print_function
from numpy import *
from pyimsl.math.ellipticIntegralK import ellipticIntegralK

x = 0.0
x = ellipticIntegralK(x)
print("K(0.0) = %f" % (x))

Output

K(0.0) = 1.570796