Special functions

The library includes routines for calculating the values of Airy functions, Bessel functions, Clausen functions, Coulomb wave functions, Coupling coefficients, the Dawson function, Debye functions, Dilogarithms, Elliptic integrals, Jacobi elliptic functions, Error functions, Exponential integrals, Fermi-Dirac functions, Gamma functions, Gegenbauer functions, Hypergeometric functions, Laguerre functions, Legendre functions and Spherical Harmonics, the Psi (Digamma) Function, Synchrotron functions, Transport functions, Trigonometric functions and Zeta functions. Each routine also computes an estimate of the numerical error in the calculated value of the function.

Functions

airyAi(x)
airyBi(x)

The Airy functions Ai(x) and Bi(x) are defined by the integral representations,

Ai(x) = {1 \over \pi} \int_0^\infty \cos({1 \over 3} t^3 + xt) dt

Bi(x) = {1 \over \pi} \int_0^\infty \left( e^{-{1 \over 3} t^3} + \sin(1/3 \, t^3 + xt) \right) dt

For further information see Abramowitz & Stegun, Section 10.4.

airyAizero(n)
airyBizero(n)

Return the n-th zero of the respectives functions.

_images/examples-airy-functions-plot.png

Airy functions Ai and Bi.

besselJ(n, x)

These routines compute the regular cylindrical Bessel function of n-th order, J0(x)

_images/sf-besselJ-functions.png

Bessel functions J0(red), J1(green), J2(blue)

besselJzero(n, s)
Return the s-th zero of the Bessel Jn function.
besselY(n, x)

These routines compute the irregular cylindrical Bessel function of n-th order, Y0(x)

_images/sf-bessel-Y.png

Bessel functions Y0(red), Y1(green), Y2(blue)

besselI(n, x)
Regular modified cylindrical Bessel function.
besselK(n, x)
Irregular modified cylindrical Bessel function.
clausen(x)

The Clausen function is defined by the following integral,

Cl_2(x) = - \int_0^x dt \log(2 \sin(t/2))

It is related to the dilogarithm by Cl_2(\theta) = \Im Li_2(\exp(i\theta)).

dawson(x)

The Dawson integral is defined by

\exp(-x^2) \int_0^x dt \exp(t^2)

A table of Dawson’s integral can be found in Abramowitz & Stegun, Table 7.5.

laguerre(n, a, x)

The generalized Laguerre polynomials are defined in terms of confluent hypergeometric functions as

L^a_n(x) = {(a+1)_n \over n!} {}_1 F_1(-n,a+1,x)

and are sometimes referred to as the associated Laguerre polynomials. They are related to the plain Laguerre polynomials L_n(x) by

L^0_n(x) = L_n(x)

and

L^k_n(x) = (-1)^k {d^k \over dx^k} L_{n+k}(x)

For more information see Abramowitz & Stegun, Chapter 22.

debye(n, x)

The Debye functions Dn(x) are defined by the following integral,

D_n(x) = {n \over x^n} \int_0^x dt {t^n \over e^t - 1}

For further information see Abramowitz & Stegun, Section 27.1.

fermi_dirac(n, x)

The complete Fermi-Dirac integral Fn(x) is given by,

F_n(x) = {1 \over \Gamma(n+1)} \int_0^\infty dt {t^n \over e^{t-x} + 1}

Note that the Fermi-Dirac integral is sometimes defined without the normalisation factor in other texts.

dilog(x)

These routines compute the dilogarithm for a real argument. In Lewin’s notation this is Li2(x), the real part of the dilogarithm of a real x. It is defined by the integral representation

Li_2(x) = - \Re \int_0^x ds {\log(1-s) \over s}

Note that Im(Li2(x)) = 0 for x <= 1, and -π log(x) for x > 1.

Note that Abramowitz & Stegun refer to the Spence integral S(x)= Li2(1-x) as the dilogarithm rather than Li2(x).

cdilog(z)
Compute the dilogarithm for a complex argument.
erf(x)

The error function erf(x)

{2 \over \sqrt{\pi}} \int_0^x dt e^{-t^2}

expintE1(x)
expintE2(x)
expintEn(n, x)
expintEi(x)
expint3(x)
Shi(x)
Chi(x)
Si(x)
Ci(x)
atanint(x)
fact(n)
doublefact(n)
lnfact(n)
lndoublefact(n)
choose(n, k)
lnchoose(n, k)
gamma(x)
lngamma(x)
beta(a, b)
lnbeta(a, b)
legendreP1(x)
legendreP2(x)
legendreP3(x)
legendrePl(n, x)
legendreQ0(x)
legendreQ1(x)
legendreQl(n, x)
hyperg0F1(a, b)
hyperg1F1(m, n, x)
hypergU(m, n, x)
zeta(n)

Table Of Contents

Previous topic

Numerical Integration

Next topic

Graphics

This Page