Special functions
The 24 definitions of the special functions library, each with its Epsil spelling, its MathJSON name, its signature and its full description.
Infinite and NaN arguments
The special functions take a complex | infinity argument, a type that
includes +oo, -oo and NaN alongside the finite numbers. They are not
restricted to finite input the way the
number theory functions are.
An infinite argument is accepted. Where the function has a limit there, that
limit is the value. Where it has none, the result is NaN or the call stays
symbolic:
[erf(+oo), erfc(+oo), erf(-oo), gamma(+oo), airyAi(-oo)]
// ➔ [1,0,-1,+oo,0]
[gamma(-oo), zeta(-oo), polyLog(2, +oo)]
// ➔ [NaN,NaN,PolyLog(2, +oo)]
A NaN argument gives NaN, also without N: NaN is not an exact
value, so there is nothing to hold symbolically.
[erf(NaN), gamma(NaN), besselJ(0, NaN), lambertW(NaN)]
// ➔ [NaN,NaN,NaN,NaN]
A function can still be infinite at a finite point, such as K(1) = \infty.
The result is then +oo, or ~oo (complex infinity) at a pole of a
function of a complex variable:
[ellipticK(1), logGamma(0), gamma(0), zeta(1)]
// ➔ [+oo,+oo,~oo,~oo]
Elliptic integrals
The complete elliptic integrals arise in computing the arc length of an ellipse, the period of a pendulum, and throughout number theory.
These functions use the parameter m = k^2, where k is the modulus.
This is the convention of Mathematica, mpmath and
Fungrim. To evaluate in terms of the modulus k,
pass k^2.
Definitions
Each definition is listed under its Epsil spelling (the MathJSON name when it has none), with its signature in the engine's type syntax. The Standard Library page is the one-page index of every category.
agm
(broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> number
- argument 1 — The first number, or z in AGM(1, z) when it is the only argument; the value is 0 when either number is 0. Sample:
1. - argument 2 — The second number; a negative number gives the complex AGM. Sample:
2.
Arithmetic-geometric mean. AGM(z) is shorthand for AGM(1, z) (Fungrim convention).
N(agm(1, 2))
// ➔ 1.45679103104690686918
agm(3, 3)
// ➔ 3
The arithmetic-geometric mean of a and b is the common limit of the
sequences a_{n+1} = \frac{a_n + b_n}{2} and b_{n+1} = \sqrt{a_n b_n}.
agm(z) is agm(1, z). The value is exact when the two arguments are equal,
\operatorname{agm}(a, a) = a, or one of them is 0,
\operatorname{agm}(a, 0) = 0. Otherwise it is numeric: use N.
[agm(a, a), agm(a, 0), agm(1)]
// ➔ [a,0,1]
[agm(2), N(agm(2)), N(agm(1, 2))]
// ➔ [AGM(2),1.45679103104690686918,1.45679103104690686918]
N(agm(1, i))
// ➔ (0.5990701173677961 + 0.5990701173677961i)
See also: Arithmetic–geometric mean, DLMF 19.8.
MathJSON: AGM
["AGM", a, b] and ["AGM", z]. In LaTeX: \operatorname{agm}(a, b).
["N", ["AGM", 1, 2]]
// ➔ 1.45679103104690686918
appellF1
MathJSON AppellF1 · (a: broadcastable<complex | infinity>, b1: broadcastable<complex | infinity>, b2: broadcastable<complex | infinity>, c: broadcastable<complex | infinity>, x: broadcastable<complex | infinity>, y: broadcastable<complex | infinity>) -> number
a— The parameter a. Sample:1.b1— The parameter b₁, paired with x. Sample:1.b2— The parameter b₂, paired with y. Sample:1.c— The denominator parameter c. Sample:2.x— The first argument, |x| < 1; outside the disk the call stays unevaluated. Sample:1/2.y— The second argument, |y| < 1; outside the disk the call stays unevaluated. Sample:1/4.
Appell hypergeometric function F₁(a; b₁, b₂; c; x, y), double series for |x|, |y| < 1.
N(appellF1(1, 1, 1, 2, 1/2, 1/4))
// ➔ 1.6218604324326553
barnesG
(broadcastable<complex | infinity>) -> number
- argument 1 — The argument; the value is 0 at the non-positive integers. Sample:
5.
The Barnes G-function, the double gamma function G(z+1) = Γ(z)·G(z), G(1) = 1. G(n) is the superfactorial 1!·2!⋯(n−2)! at a positive integer n; G is entire, with zeros at the non-positive integers.
barnesG(5)
// ➔ 12
N(barnesG(1/2))
// ➔ 0.603244281209446206191
At a positive integer n, barnesG(n) is the superfactorial
\prod_{k=0}^{n-2} k!, an exact integer. A real argument is computed to
the engine precision, a complex argument in double precision.
[barnesG(10), barnesG(0), barnesG(-2)]
// ➔ [5056584744960000,0,0]
N(barnesG(1 + i))
// ➔ (1.8038767269253262 + 0.006717570579723474i)
MathJSON: BarnesG
["BarnesG", z].
["BarnesG", 5]
// ➔ 12
["N", ["BarnesG", ["Rational", 1, 2]]]
// ➔ 0.603244281209446206191
chebyshevT
(degree: broadcastable<real>, x: broadcastable<complex>) -> number
degree— The degree n; a negative degree gives T₋ₙ = Tₙ. A non-integer degree stays unevaluated. Sample:3.x— The point; a number gives the value, a symbol or an expression the expanded polynomial in it. Sample:1/2.
Chebyshev polynomial of the first kind Tₙ(x), with Tₙ(cos θ) = cos(nθ). T₋ₙ = Tₙ.
chebyshevT(3, x)
// ➔ 4x^3 - 3x
chebyshevT(3, 1/2)
// ➔ -1
The degree n is an integer. With a literal degree, a symbolic x gives
the polynomial, an exact rational x gives an exact value, and a float x
or N gives the value of the recurrence T_{n+1} = 2x T_n - T_{n-1}. A
negative degree gives T_{-n} = T_n. A degree that is not a literal stays
unevaluated.
chebyshevT(3, x)
// ➔ 4x^3 - 3x
chebyshevT(3, 1/2)
// ➔ -1
N(chebyshevT(50, 0.3))
// ➔ 0.890054977850745358766
chebyshevT(n, x)
// ➔ ChebyshevT(n, x)
chebyshevT compiles to JavaScript and GLSL for an integer degree and a
real x.
See also: Chebyshev polynomials, DLMF 18.3.
MathJSON: ChebyshevT
["ChebyshevT", n, x]. In LaTeX: \operatorname{ChebyshevT}(n, x).
["N", ["ChebyshevT", 3, ["Rational", 1, 2]]]
// ➔ -1
chebyshevU
(degree: broadcastable<real>, x: broadcastable<complex>) -> number
degree— The degree n; a negative degree gives U₋₁ = 0 and U₋ₙ = −Uₙ₋₂. A non-integer degree stays unevaluated. Sample:3.x— The point; a number gives the value, a symbol or an expression the expanded polynomial in it. Sample:1/2.
Chebyshev polynomial of the second kind Uₙ(x), with Uₙ(cos θ) = sin((n+1)θ)/sin θ. U₋₁ = 0 and U₋ₙ = −Uₙ₋₂.
chebyshevU(2, x)
// ➔ 4x^2 - 1
The Chebyshev polynomial of the second kind, with the same rules as
chebyshevT. A negative degree gives U_{-1} = 0 and
U_{-n} = -U_{n-2}.
chebyshevU(3, x)
// ➔ 8x^3 - 4x
chebyshevU(-1, x)
// ➔ 0
MathJSON: ChebyshevU
["ChebyshevU", n, x]. In LaTeX: \operatorname{ChebyshevU}(n, x).
["ChebyshevU", 3, "x"]
// ➔ ["Add", ["Multiply", 8, ["Power", "x", 3]], ["Multiply", -4, "x"]]
clausenCl
(n: broadcastable<integer>, theta: broadcastable<real>) -> number
n— The order n, at least 1; a smaller order stays unevaluated. Sample:2.theta— The angle θ, in radians; Cl₁ is+ooat θ = 0. Sample:pi / 2.
Clausen function Clₙ(θ) of integer order n ≥ 1 and real θ: Im Liₙ(e^{iθ}) = Σ sin(kθ)/kⁿ for even n, Re Liₙ(e^{iθ}) = Σ cos(kθ)/kⁿ for odd n. A real θ follows the engine precision.
[clausenCl(2, 1), clausenCl(3, 0), N(clausenCl(2, 1))]
// ➔ [ClausenCl(2, 1),Zeta(3),1.01395913236076850429]
The Clausen functions are the clsin and clcos functions of mpmath:
\operatorname{Cl}_n(\theta) = \sum_{k=1}^{\infty} \frac{\sin(k\theta)}{k^n}
\text{ for even } n, \qquad
\operatorname{Cl}_n(\theta) = \sum_{k=1}^{\infty} \frac{\cos(k\theta)}{k^n}
\text{ for odd } n
Some values at special points are exact:
[clausenCl(2, pi/2), clausenCl(2, pi), clausenCl(4, pi/2)]
// ➔ [catalanConstant,0,DirichletBeta(4)]
[clausenCl(1, pi/2), clausenCl(1, pi), clausenCl(3, pi)]
// ➔ [-1/2 * ln(2),-ln(2),-3/4 * Zeta(3)]
A real θ is computed to the engine precision for an order up to 40. An order above 40, an order of 0 or less, and a symbolic θ stay unevaluated. A non-integer order is a type error.
[clausenCl(41, 1), clausenCl(0, 1), clausenCl(2, x)]
// ➔ [ClausenCl(41, 1),ClausenCl(0, 1),ClausenCl(2, x)]
clausenCl(1/2, 1)
// ➔ error: Type error: expected `integer`, got `rational<0.5..0.5>` at `1 / 2` in `clausenCl(1 / 2, 1)`
At the zeros θ = π/3 and θ = 5π/3 of clausenCl(1, θ), the value is an
exact 0, also with N. A numeric value is given only when all its digits
reach the engine precision. At a float that is a zero to machine precision,
they cannot, and the call stays unevaluated. Close to a zero, the value is
given:
[clausenCl(1, pi/3), clausenCl(1, 5pi/3), N(clausenCl(1, pi/3))]
// ➔ [0,0,0]
[clausenCl(1, 1.05), clausenCl(1, 1.0471975511965976)]
// ➔ [-0.00242307133771859470069,ClausenCl(1, 1.0471975511965976)]
MathJSON: ClausenCl
["ClausenCl", n, theta]. In LaTeX: \operatorname{Cl}_n(\theta).
["ClausenCl", 2, ["Divide", "Pi", 2]]
// ➔ CatalanConstant
["ClausenCl", 3, 0]
// ➔ Zeta(3)
["N", ["ClausenCl", 2, 1]]
// ➔ 1.01395913236076850429
dedekindEta
(broadcastable<complex | infinity>) -> number
- argument 1 — The point τ of the upper half-plane; a τ with Im(τ) ≤ 0 stays unevaluated. Sample:
i.
Dedekind eta function η(τ), Im(τ) > 0.
N(dedekindEta(i))
// ➔ 0.768225422326056659003
On the upper half-plane, \operatorname{Im}(\tau) > 0:
\eta(\tau) = e^{i\pi\tau/12} \prod_{k=1}^{\infty} \left(1 - e^{2\pi i k
\tau}\right)
It is a modular form of weight \frac12, central to the theory of modular
functions and of integer partitions.
N computes a τ with \operatorname{Im}(\tau) \ge 0.001 to the engine
precision. \eta(i) is \Gamma(1/4)/(2\pi^{3/4}):
[N(dedekindEta(i)), N(gamma(1/4) / (2 * pi^(3/4)))]
// ➔ [0.768225422326056659003,0.768225422326056659002]
N(dedekindEta(1/2 + i))
// ➔ (0.764503166797142301409 + 0.100648751322317266587i)
Above machine precision, a τ closer to the real axis stays unevaluated,
and so does a τ in the lower half-plane:
[N(dedekindEta(0.0009i)), N(dedekindEta(-i))]
// ➔ [DedekindEta(0.0009i),DedekindEta(-i)]
See also: Dedekind eta function, DLMF 23.15.
MathJSON: DedekindEta
["DedekindEta", tau]. In LaTeX: \eta(\tau).
["N", ["DedekindEta", "ImaginaryUnit"]]
// ➔ 0.768225422326056659003
eisensteinE
MathJSON EisensteinE · (s: broadcastable<number>, tau: broadcastable<complex | infinity>) -> number
s— The weight s, an even integer at least 2; another value stays unevaluated. Sample:4.tau— The point τ of the upper half-plane; a τ with Im(τ) ≤ 0 stays unevaluated. Sample:i.
Normalized Eisenstein series Eₛ(τ) of even weight s ≥ 2, Im(τ) > 0.
N(eisensteinE(4, i))
// ➔ 1.4557628922687094
ellipticE
(broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> number
- argument 1 — Alone, the parameter m = k² of the complete integral; with a second argument, the amplitude φ, in radians. Sample:
1/2. - argument 2 — The parameter m = k² of the incomplete integral. Sample:
1/2.
Elliptic integral of the second kind: complete E(m) with one argument, incomplete E(φ|m) with two (amplitude first, parameter convention m = k², as in Mathematica).
N(ellipticE(1/2))
// ➔ 1.35064388104767550252
N(ellipticE(pi/4, 1/2))
// ➔ 0.748186504177661377454
The complete integral is
E(m) = \int_0^{\pi/2} \sqrt{1 - m \sin^2\theta} \, d\theta
The perimeter of an ellipse with semi-major axis a and eccentricity e
is 4aE(e^2). For a = 1 and e = 0.6:
N(4 * ellipticE(0.6^2))
// ➔ 5.67233357779489692628
E(0) = \pi/2 and E(1) = 1. For m > 1 the value is complex.
[ellipticE(0), ellipticE(1)]
// ➔ [1/2 * pi,1]
N(ellipticE(2))
// ➔ (0.5990701173677957 + 0.5990701173677964i)
See also: Complete elliptic integral of the second kind, DLMF 19.2.
MathJSON: EllipticE
["EllipticE", m] and ["EllipticE", phi, m]. In LaTeX: E(m).
["N", ["EllipticE", 0.5]]
// ➔ 1.35064388104767550252
ellipticF
MathJSON EllipticF · (phi: broadcastable<complex | infinity>, m: broadcastable<complex | infinity>) -> number
phi— The amplitude φ, in radians; the value is 0 at φ = 0, and N gives K(m) at φ = π/2. Sample:pi / 4.m— The parameter m = k². Sample:1/2.
Incomplete elliptic integral of the first kind F(φ|m) (amplitude first, parameter convention m = k², as in Mathematica). F(π/2|m) = K(m).
N(ellipticF(pi/4, 1/2))
// ➔ 0.826017876249245185456
ellipticK
(broadcastable<complex | infinity>) -> number
- argument 1 — The parameter m = k²; the value is real for m < 1,
+ooat m = 1 and complex for m > 1. Sample:1/2.
Complete elliptic integral of the first kind K(m), parameter convention m = k².
ellipticK(0)
// ➔ 1/2 * pi
N(ellipticK(1/2))
// ➔ 1.85407467730137191843
K(m) = \int_0^{\pi/2} \frac{d\theta}{\sqrt{1 - m \sin^2\theta}}
It is computed with the arithmetic-geometric mean:
K(m) = \dfrac{\pi}{2\operatorname{agm}(1, \sqrt{1-m})}.
[N(ellipticK(0.5)), N(pi / (2 * agm(1, sqrt(1 - 0.5))))]
// ➔ [1.85407467730137191843,1.85407467730137191843]
K(0) = \pi/2 and K(1) = \infty. For m > 1 the value is complex.
[ellipticK(0), ellipticK(1)]
// ➔ [1/2 * pi,+oo]
N(ellipticK(2))
// ➔ (1.3110287771460598 - 1.3110287771460598i)
See also: Complete elliptic integral of the first kind, DLMF 19.2.
MathJSON: EllipticK
["EllipticK", m]. In LaTeX: K(m).
["N", ["EllipticK", 0.5]]
// ➔ 1.85407467730137191843
ellipticPi
MathJSON EllipticPi · (broadcastable<complex | infinity>, broadcastable<complex | infinity>, broadcastable<complex | infinity>?) -> number
- argument 1 — The characteristic n; N of the complete integral is
+ooat n = 1. Sample:1/2. - argument 2 — With two arguments, the parameter m = k² of the complete integral; with three, the amplitude φ, in radians. Sample:
1/2. - argument 3 — The parameter m = k² of the incomplete integral. Sample:
1/2.
Elliptic integral of the third kind: complete Π(n|m) with two arguments, incomplete Π(n; φ|m) with three (characteristic first, amplitude second, parameter convention m = k², as in Mathematica).
N(ellipticPi(1/2, 1/2))
// ➔ 2.70128776209535100504
N(ellipticPi(1/2, pi/4, 1/2))
// ➔ 0.919022739165696990399
expIntegralEi
MathJSON ExpIntegralEi · (broadcastable<complex | infinity>) -> number
- argument 1 — The argument; the value is
-ooat 0,+ooat+ooand 0 at-oo. Sample:1.
Exponential integral Ei(x) = PV ∫_{−∞}^x eᵗ/t dt.
N(expIntegralEi(1))
// ➔ 1.89511781635593675547
expIntegralEi(0)
// ➔ -oo
hermiteH
(degree: broadcastable<real>, x: broadcastable<complex>) -> number
degree— The degree n, at least 0; a negative or non-integer degree stays unevaluated. Sample:3.x— The point; a number gives the value, a symbol or an expression the expanded polynomial in it. Sample:1/2.
Hermite polynomial Hₙ(x) of the physicists' convention, with H₀ = 1, H₁ = 2x and Hₙ₊₁ = 2x Hₙ − 2n Hₙ₋₁. A negative or non-integer degree stays unevaluated.
hermiteH(2, x)
// ➔ 4x^2 - 2
The Hermite polynomial of the physicists' convention, H_1 = 2x, with the
same rules as chebyshevT. A negative degree stays unevaluated.
hermiteH(4, x)
// ➔ 16x^4 - 48x^2 + 12
hermiteH(-1, x)
// ➔ HermiteH(-1, x)
See also: Hermite polynomials, DLMF 18.3.
MathJSON: HermiteH
["HermiteH", n, x]. In LaTeX: \operatorname{HermiteH}(n, x).
["HermiteH", 4, "x"]
// ➔ ["Add", ["Multiply", 16, ["Power", "x", 4]], ["Multiply", -48, ["Power", "x", 2]], 12]
hypergeometric1F1
(a: broadcastable<complex | infinity>, b: broadcastable<complex | infinity>, z: broadcastable<complex | infinity>) -> number
a— The numerator parameter. Sample:1.b— The denominator parameter. Sample:2.z— The argument; the value is 1 at z = 0. Sample:1.
Kummer confluent hypergeometric function ₁F₁(a; b; z) = M(a, b, z).
N(hypergeometric1F1(1, 2, 1))
// ➔ 1.71828182845904523536
hypergeometric1F1(2, 2, x)
// ➔ e^x
M(a, b, z) is another notation for this function:
{}_1F_1(a; b; z) = \sum_{n=0}^{\infty} \frac{(a)_n}{(b)_n} \frac{z^n}{n!}
It is an entire function of z, and N evaluates it at any real or
complex z. With a repeated parameter, hypergeometric1F1(a, a, z) is
e^z.
hypergeometric1F1(a, a, z)
// ➔ e^z
[N(hypergeometric1F1(1, 2, 2)), N((e^2 - 1)/2)]
// ➔ [3.19452804946532511362,3.19452804946532511362]
N(hypergeometric1F1(1, 2, 3 + 4i))
// ➔ (-4.127579483866333 + 0.43651115746579056i)
See also: Confluent hypergeometric function, DLMF 13.2.
MathJSON: Hypergeometric1F1
["Hypergeometric1F1", a, b, z]. In LaTeX: {}_1F_1(a; b; z).
["N", ["Hypergeometric1F1", 1, 2, 2]]
// ➔ 3.19452804946532511362
hypergeometric2F1
(a: broadcastable<complex | infinity>, b: broadcastable<complex | infinity>, c: broadcastable<complex | infinity>, z: broadcastable<complex | infinity>) -> number
a— The first numerator parameter. Sample:1.b— The second numerator parameter. Sample:1.c— The denominator parameter. Sample:2.z— The argument; the value is 1 at z = 0, and complex on the cut z > 1. Sample:1/2.
Gauss hypergeometric function ₂F₁(a, b; c; z).
N(hypergeometric2F1(1, 1, 2, 1/2))
// ➔ 1.38629436111989061883
hypergeometric2F1(1, 2, 2, x)
// ➔ 1 / (1 - x)
For |z| < 1 the function is the series
{}_2F_1(a, b; c; z) = \sum_{n=0}^{\infty} \frac{(a)_n (b)_n}{(c)_n}
\frac{z^n}{n!}
where (q)_n is the Pochhammer symbol (rising factorial). Elsewhere it is
continued analytically.
Many elementary and special functions are particular cases, such as
\ln(1+z) = z \cdot {}_2F_1(1, 1; 2; -z) and
K(m) = \frac{\pi}{2} \, {}_2F_1\big(\frac12, \frac12; 1; m\big):
[N(hypergeometric2F1(1, 1, 2, 0.5)), N(2 * ln(2))]
// ➔ [1.38629436111989061883,1.38629436111989061883]
N(pi/2 * hypergeometric2F1(1/2, 1/2, 1, 0.5))
// ➔ 1.85407467730137191844
With z = 0 the value is 1, and with a repeated parameter,
hypergeometric2F1(a, b, b, z) is (1 - z)^{-a}:
[hypergeometric2F1(a, b, c, 0), hypergeometric2F1(a, b, b, z)]
// ➔ [1,(1 - z)^(-a)]
When a or b is a non-positive integer, the series ends and the function
is a polynomial in z: N evaluates it at any z. Otherwise N evaluates
it for a real z and for a complex z in the unit disk and the region of
the Pfaff transformation. At z = 1 it can diverge.
[N(hypergeometric2F1(-2, 1, 1, 5)), N(hypergeometric2F1(1, 1, 2, 1))]
// ➔ [16,+oo]
N(hypergeometric2F1(1, 1, 2, 0.9i))
// ➔ (0.8142390019850076 + 0.32962602515429684i)
See also: Hypergeometric function, DLMF 15.2.
MathJSON: Hypergeometric2F1
["Hypergeometric2F1", a, b, c, z]. In LaTeX: {}_2F_1(a, b; c; z).
["N", ["Hypergeometric2F1", 1, 1, 2, 0.5]]
// ➔ 1.38629436111989061883
jacobiTheta
(j: broadcastable<number>, z: broadcastable<complex | infinity>, tau: broadcastable<complex | infinity>, r: broadcastable<number>?) -> number
j— The index j of the function, 1, 2, 3 or 4; another value stays unevaluated. Sample:3.z— The argument z; θ₃ and θ₄ have period 1 in z. Sample:0.tau— The lattice parameter τ, with Im(τ) > 0; the nome is q = e^{iπτ}. Sample:i.r— The order of the derivative in z; only 0 is implemented, another order stays unevaluated. Sample:0.
Jacobi theta function θⱼ(z, τ), j ∈ {1,2,3,4}, nome q = e^{iπτ} (Fungrim convention).
N(jacobiTheta(3, 0, i))
// ➔ 1.08643481121330801458
For \operatorname{Im}(\tau) > 0,
\theta_3(z, \tau) = 1 + 2\sum_{n=1}^{\infty} q^{n^2} \cos(2n\pi z)
and similarly for \theta_1, \theta_2 and \theta_4.
The trigonometric argument is a multiple of \pi z, so the functions have
period 1 in z. This is the convention of Fungrim
and mpmath, not the classical convention with period \pi.
N computes the value to the engine precision. At τ = i, \theta_3(0, i)
is \pi^{1/4}/\Gamma(3/4):
[N(jacobiTheta(3, 0, i)), N(pi^(1/4) / gamma(3/4))]
// ➔ [1.08643481121330801458,1.08643481121330801458]
The optional fourth argument is the order of differentiation with respect
to z. Only order 0 evaluates numerically. A τ with
\operatorname{Im}(\tau) \le 0, or an index other than 1 to 4, stays
unevaluated.
[N(jacobiTheta(3, 0, i, 1)), N(jacobiTheta(3, 0, -i))]
// ➔ [JacobiTheta(3, 0, i, 1),JacobiTheta(3, 0, -i)]
See also: Theta function, DLMF 20.2.
MathJSON: JacobiTheta
["JacobiTheta", j, z, tau] and ["JacobiTheta", j, z, tau, order]. In
LaTeX: \theta_j(z, \tau).
["N", ["JacobiTheta", 3, 0, "ImaginaryUnit"]]
// ➔ 1.086434811213308
laguerreL
(degree: broadcastable<real>, broadcastable<complex>, broadcastable<complex>?) -> number
degree— The degree n, at least 0; a negative or non-integer degree stays unevaluated. Sample:3.- argument 2 — With two arguments, the point x; with three, the parameter a of the generalized polynomial Lₙ⁽ᵃ⁾. Sample:
1/2. - argument 3 — The point; a number gives the value, a symbol or an expression the expanded polynomial in it. Sample:
1/2.
Laguerre polynomial Lₙ(x) = Σₖ (−1)ᵏ C(n, k) xᵏ/k!; with three arguments, the generalized Laguerre polynomial Lₙ⁽ᵃ⁾(x) = Σₖ (−1)ᵏ C(n+a, n−k) xᵏ/k!, with LaguerreL(n, 0, x) = LaguerreL(n, x). A negative or non-integer degree stays unevaluated.
laguerreL(2, x)
// ➔ 1/2 * x^2 - 2x + 1
laguerreL(2, a, x)
// ➔ 1/2 * a^2 + 1/2 * x^2 - a * x + 3/2 * a - 2x + 1
laguerreL(3, 1/2, 2)
// ➔ -43/48
The Laguerre polynomial L_n(x) = \sum_{k=0}^{n} (-1)^k \binom{n}{k} x^k/k!,
with the same rules as chebyshevT. A negative degree stays unevaluated.
laguerreL(3, x)
// ➔ -1/6 * x^3 + 3/2 * x^2 - 3x + 1
laguerreL(3, 2)
// ➔ -1/3
See also: Laguerre polynomials, DLMF 18.3.
MathJSON: LaguerreL
["LaguerreL", n, x]. In LaTeX: \operatorname{LaguerreL}(n, x).
["LaguerreL", 3, "x"]
// ➔ ["Add", ["Multiply", ["Rational", -1, 6], ["Power", "x", 3]], ["Multiply", ["Rational", 3, 2], ["Power", "x", 2]], ["Multiply", -3, "x"], 1]
legendreP
(degree: broadcastable<real>, x: broadcastable<complex>) -> number
degree— The degree n; a negative degree gives P₋ₙ = Pₙ₋₁. A non-integer degree stays unevaluated. Sample:3.x— The point; a number gives the value, a symbol or an expression the expanded polynomial in it. Sample:1/2.
Legendre polynomial Pₙ(x), with P₀ = 1, P₁ = x and (n+1)Pₙ₊₁ = (2n+1)x Pₙ − n Pₙ₋₁. P₋ₙ = Pₙ₋₁.
legendreP(2, x)
// ➔ 3/2 * x^2 - 1/2
The Legendre polynomial, with the same rules as chebyshevT. A negative
degree gives P_{-n} = P_{n-1}.
legendreP(3, x)
// ➔ 5/2 * x^3 - 3/2 * x
legendreP(3, 1/3)
// ➔ -11/27
N(legendreP(2, x))
// ➔ 1.5 * x^2 - 0.5
See also: Legendre polynomials, DLMF 18.3.
MathJSON: LegendreP
["LegendreP", n, x]. In LaTeX: \operatorname{LegendreP}(n, x).
["LegendreP", 3, "x"]
// ➔ ["Add", ["Multiply", ["Rational", 5, 2], ["Power", "x", 3]], ["Multiply", ["Rational", -3, 2], "x"]]
logBarnesG
(broadcastable<complex | infinity>) -> number
- argument 1 — The argument; the value is
-ooat the non-positive integers. Sample:5.
The logarithm of the Barnes G-function, continued analytically with logGamma: its imaginary part is not principal on the negative axis. −∞ at the zeros of G, the non-positive integers.
logBarnesG(5)
// ➔ 2ln(2) + ln(3)
N(logBarnesG(-1/2))
// ➔ (-1.7709451779743404 + 3.141592653589793i)
The continuation with logGamma is the one of Mathematica.
logBarnesG(0) is -oo:
[logBarnesG(1), logBarnesG(0)]
// ➔ [0,-oo]
N(logBarnesG(-2.5))
// ➔ (-2.574748476853131 + 18.84955592153876i)
MathJSON: LogBarnesG
["LogBarnesG", z].
["N", ["LogBarnesG", -2.5]]
// ➔ -2.574748476853131 + 18.84955592153876i
logGamma
(broadcastable<complex | infinity>) -> number
- argument 1 — The argument; the value is
+ooat the poles of Γ, the non-positive integers. Sample:5.
The analytic continuation of ln Γ(z), with its branch cut on (−∞, 0]; not gammaLn, the principal logarithm of Γ(z), which jumps by 2πi across the zeros of Im Γ.
logGamma(5)
// ➔ 3ln(2) + ln(3)
N(logGamma(-2.5 + 1.5i))
// ➔ (-3.7175134511917927 - 7.713065525834192i)
logGamma(z) is the LogGamma of Mathematica and the loggamma of
mpmath. It is exact where gamma is exact, and its poles at the
non-positive integers are +oo. A real argument is computed to the engine
precision, a complex argument in double precision.
[logGamma(1/2), logGamma(0), logGamma(-2)]
// ➔ [1/2 * ln(pi),+oo,+oo]
N(logGamma(1 + i))
// ➔ (-0.6509231993018556 - 0.30164032046753286i)
For a positive real argument logGamma and
gammaLn agree. Elsewhere they differ by
a multiple of 2\pi i:
N(gammaLn(-1.5))
// ➔ 0.860047015376481014511
N(logGamma(-1.5))
// ➔ (0.860047015376481014511 - 6.28318530717958647693i)
polyGamma(-1, z) is logGamma(z):
polyGamma(-1, z)
// ➔ LogGamma(z)
MathJSON: LogGamma
["LogGamma", z].
["LogGamma", 5]
// ➔ 3ln(2) + ln(3)
["LogGamma", ["Rational", 1, 2]]
// ➔ 1/2 * ln(pi)
["N", ["LogGamma", ["Complex", -2.5, 1.5]]]
// ➔ -3.7175134511917927 - 7.713065525834192i
logIntegral
(broadcastable<complex | infinity>) -> number
- argument 1 — The argument; the value is 0 at 0 and
-ooat 1, and a negative or non-real number stays unevaluated. Sample:10.
Logarithmic integral li(x) = PV ∫₀ˣ dt/ln t = Ei(ln x).
N(logIntegral(10))
// ➔ 6.16559950478729793752
logIntegral(1)
// ➔ -oo
MathJSON: LogIntegral • LaTeX: \operatorname{li}
polyLog
(s: broadcastable<complex | infinity>, z: broadcastable<complex | infinity>) -> number
s— The order s. Sample:2.z— The argument; the value is 0 at z = 0, ζ(s) at z = 1 when s > 1, and complex on the cut z > 1. Sample:1/2.
Polylogarithm Liₛ(z) = Σ_{k≥1} zᵏ/kˢ, at any real or complex order s.
polyLog(2, 1)
// ➔ 1/6 * pi^2
N(polyLog(2, 1/2))
// ➔ 0.582240526465012505903
MathJSON: PolyLog • LaTeX: \operatorname{Li}
stieltjesGamma
(n: broadcastable<integer>, a: broadcastable<number>?) -> number
n— The index n, at least 0; a negative index stays unevaluated. Sample:1.a— The shift a, 1 by default; the value is~ooat a non-positive integer. Sample:1/2.
Generalized Stieltjes constants γₙ(a), the Laurent coefficients of ζ(s, a) at s = 1: ζ(s, a) = 1/(s−1) + Σₙ (−1)ⁿ γₙ(a)(s−1)ⁿ/n!. StieltjesGamma(n) is γₙ = γₙ(1), and γ₀ is Euler's constant.
stieltjesGamma(0)
// ➔ eulerGamma
N(stieltjesGamma(1))
// ➔ -0.0728158454836767248606
N(stieltjesGamma(2, 1/2))
// ➔ 0.968864475220290711422
stieltjesGamma(n) is \gamma_n(1), the Stieltjes constant of the Riemann
zeta function. stieltjesGamma(0, a) is -polyGamma(0, a).
stieltjesGamma(0, a)
// ➔ -PolyGamma(0, a)
A non-positive integer a is a pole. A real a > 0 is computed to the
engine precision. A complex a, or a negative non-integer a, is computed
in double precision. An order above 30 stays unevaluated.
[stieltjesGamma(1, 0), stieltjesGamma(31)]
// ➔ [~oo,StieltjesGamma(31)]
N(stieltjesGamma(1, 1 + i))
// ➔ (0.5610186810578666 - 0.13447351896987797i)
MathJSON: StieltjesGamma
["StieltjesGamma", n] and ["StieltjesGamma", n, a]. In LaTeX:
\gamma_n(a).
["StieltjesGamma", 0]
// ➔ EulerGamma
["N", ["StieltjesGamma", 1]]
// ➔ -0.0728158454836767248606
["StieltjesGamma", 0, "a"]
// ➔ -PolyGamma(0, a)