Gamma, Bessel, and Associated Functions

As a general reference to the functions described in this section (and much more), we refer the reader to Whittaker and Watson [WW15].

Gamma(f): RngSerElt -> RngSerElt

Return the Gamma function \(\Gamma(f)\) of the series \(f\). The series \(f\) must be defined over the free real or complex field, the valuation of \(f\) must be 0 and the constant term of \(f\) must be 1.

Gamma(r): FldReElt -> FldReElt
Gamma(r): FldComElt -> FldComElt

Given a real or complex number \(s\) (not equal to \(0, -1, -2, \ldots\)), calculate the value \(\Gamma(s)\) of the gamma function at \(s\). For \(s\) with positive real part this is the value of

\[\Gamma(s)=\int_0^{\infty}u^{s-1}e^{-u}du.\]

For other \(s\) (not a non-positive integer) the function is defined by analytic continuation, and it satisfies the product formula

\[{1\over s\Gamma(s)}=e^{\gamma s}\prod_{n=1}^\infty (1+{s\over n})e^{-s/n}.\]

The function \(\Gamma\) also satisfies

\[\Gamma(s)\Gamma(1-s)={\pi\over{\sin(\pi s)}},\]

and

\[\Gamma(s+1)=s\Gamma(s).\]
Gamma(s, t): FldReElt, FldReElt -> FldReElt
Complementary: BoolElt                     Default: false
Gamma        : FldReElt                    Default: 

For real numbers \(s, t\) this returns the value of the incomplete gamma function

\[\gamma(s, t)=\int_0^t u^{s-1}e^{-u}du.\]

The optional argument Complementary can be used to find the complement

\[\int_t^\infty u^{s-1}e^{-u}du\]

instead. There is a second optional argument that may be used in the computation of the incomplete gamma value; the free real value of Gamma should be the value of \(\Gamma(s)\), in which case \(\gamma(s, t)\) may be computed as the difference between the given value for \(\Gamma(s)\) and that of the complementary \(\gamma\) at \(s, t\). Pari is used here.

GammaD(s): FldReElt -> FldReElt

For free real \(s\) (such that \(s+{1\over2}\) is not a non-positive integer) this returns the value of \(\Gamma(s+{1\over2})\). For integer values of \(s\) this is faster than Gamma(s+(1/2)), because Legendre’s doubling formula

\[\Gamma(s+{1\over2})=2^{1-2s}\sqrt{\pi}{\Gamma(2s)\over\Gamma(s)}\]

is used. Pari is used here.

LogGamma(f): RngSerElt -> RngSerElt

Return the Log-Gamma function \({\rm Log}(\Gamma(f))\) of the series \(f\). \(f\) must be defined over a real or complex field, the valuation of \(f\) must be 0 and the constant term of \(f\) must be 1.

LogGamma(r): FldReElt -> FldReElt
LogGamma(r): FldComElt -> FldComElt

For real or complex \(s\) (not a non-positive integer) return the value of the principal branch of the logarithm of the gamma function of \(s\).

LogDerivative(s): FldReElt -> FldReElt
LogDerivative(s): FldComElt -> FldComElt
Psi(s): FldReElt -> FldReElt
Psi(s): FldComElt -> FldComElt

For real or complex \(s\) (not a non-positive integer) return the principal value of the logarithmic derivative

\[\Psi(s)={d \log\Gamma(s)\over ds}={\Gamma'(s)\over\Gamma(s)},\]

of the gamma function, which allows the expansion

\[\Psi(s)=-\gamma-{1\over s}+s\sum_{n=1}^\infty{1\over n(s+n)};\]

here \(\gamma\) is Euler’s gamma. Pari is used here.

BesselFunction(n, r): RngIntElt, FldReElt -> FldReElt

Given a small integer \(n\) and a real number \(r\), calculate the value of the Bessel function \(y\) = \(J_n(r)\), of the first kind of order \(n\). Results for negative arguments are defined by: \(J_{-n}(r) = J_n(-r) = (-1)^n J_n(r)\). The Bessel function of the first kind of order \(n\) is defined by

\[J_n(x)={1\over2\pi{\mathrm{i}}}\left({z\over2}\right)^n\int_{-\infty}^{0^+} u^{-n-1}e^{u-{z^2\over4t}}du,\]

and satisfies

\[J_n(x)=\sum_{k=0}^\infty {(-1)^kz^{n+2k}\over 2^{n+2k}k!\Gamma(n+k+1)}.\]
BesselFunctionSecondKind(n, r): RngIntElt, FldReElt -> FldReElt

Given a small integer \(n\) and a real number \(r\), calculate the value of the Bessel function \(y\) = \(Y_n(r)\), of the second kind of order \(n\). Results for negative arguments are defined by: \(Y_{-n}(r) = -(-1)^n Y_n(r)\), \(Y_n(-r)\) is not a real number. The Bessel function of the second kind of order \(n\) satisfies the Bessel differential equation.

JBessel(n, s): RngIntElt, FldReElt -> FldReElt
JBessel(n, s): FldReElt, FldReElt -> FldReElt

Given a small integer \(n\) and a real number \(s\), calculate the value of the Bessel function of the first kind of half integral index \(n+{1\over2}\), \(J_{n+{1\over2}}\), defined as above. Pari is used here.

KBessel(n, s): FldReElt, FldReElt -> FldReElt
KBessel(n, s): FldComElt, FldReElt -> FldComElt
KBessel2(n, s): FldReElt, FldReElt -> FldReElt
KBessel2(n, s): FldComElt, FldReElt -> FldComElt

Given a complex \(n\) and a positive real \(s\), compute the value of the modified Bessel function of the second kind \(K_n(s)\), which may be defined by

\[K_n(s)={\pi\over 2}\left({\mathrm{i}}^nJ_{-n}({\mathrm{i}}s)-{\mathrm{i}}^{-n}J_n(s)\right)\cot(n\pi).\]

The function KBessel2 is an alternative (often faster) implementation of this function. Pari is used here.