[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

Mathematical Functions—Wolfram Language Documentation

Naming ConventionsFunctions That Do Not Have Unique Values
Generic and NonGeneric CasesMathematical Constants
Numerical FunctionsOrthogonal Polynomials
Piecewise FunctionsSpecial Functions
Pseudorandom NumbersElliptic Integrals and Elliptic Functions
Integer and Number Theoretic FunctionsMathieu and Related Functions
Combinatorial FunctionsWorking with Special Functions
Elementary Transcendental Functions
Mathematical functions in the Wolfram Language are given names according to definite rules. As with most Wolfram Language functions, the names are usually complete English words, fully spelled out. For a few very common functions, the Wolfram Language uses the traditional abbreviations. Thus the modulo function, for example, is Mod, not Modulo.
Mathematical functions that are usually referred to by a person's name have names in the Wolfram Language of the form PersonSymbol. Thus, for example, the Legendre polynomials are denoted LegendreP[n,x]. Although this convention does lead to longer function names, it avoids any ambiguity or confusion.
When the standard notation for a mathematical function involves both subscripts and superscripts, the subscripts are given before the superscripts in the Wolfram Language form. Thus, for example, the associated Legendre polynomials are denoted LegendreP[n,m,x].
Generic and NonGeneric Cases
For the special case of , however, the correct result is different:
If is equal to 0, however, then the true result is not 0:
If the Wolfram Language did not automatically replace by 0, then few symbolic computations would get very far. But you should realize that the practical necessity of making such replacements can cause misleading results to be obtained when exceptional values of parameters are used.
If it were, then the result here would be , which is incorrect:
This makes the assumption that is a positive real variable, and does the replacement:
IntegerPart[x]
integer part of x
FractionalPart[x]
fractional part of x
Round[x]
integer x closest to x
Floor[x]
greatest integer x not larger than x
Ceiling[x]
least integer x not smaller than x
Rationalize[x]
rational number approximation to x
Rationalize[x,dx]
rational approximation within tolerance dx
xIntegerPart[x]FractionalPart[x]Round[x]Floor[x]Ceiling[x]
2.420.4223
2.520.5223
2.620.6323
-2.4-2-0.4-2-3-2
-2.5-2-0.5-2-3-2
-2.6-2-0.6-3-3-2
IntegerPart[x] and FractionalPart[x] can be thought of as extracting digits to the left and right of the decimal point. Round[x] is often used for forcing numbers that are close to integers to be exactly integers. Floor[x] and Ceiling[x] often arise in working out how many elements there will be in sequences of numbers with noninteger spacings.
RealSign[x]
1 for x>0, -1 for x<0
UnitStep[x]
1 for x0, 0 for x<0
RealAbs[x]
absolute value x of x
Clip[x]
x clipped to be between -1 and +1
Rescale[x,{xmin,xmax}]
x rescaled to run from 0 to 1
Max[x1,x2,]
or
Max[{x1,x2,},]
the maximum of x1, x2,
Min[x1,x2,]
or
Min[{x1,x2,},]
the minimum of x1, x2,
x+Iy
the complex number x+iy
Re[z]
the real part Re z
Im[z]
the imaginary part Im z
Conjugate[z]
the complex conjugate z* or
Abs[z]
the absolute value z
Arg[z]
the argument ϕ such that z=zeiϕ
Sign[z]
the complex sign z/z for z0
Boole[expr]
give 1 if expr is True, and 0 if it is False
Boole[expr] is a basic function that turns True and False into 1 and 0. It is sometimes known as the characteristic function or indicator function.
Piecewise[{{val1,cond1},{val2,cond2},}]
give the first vali for which condi is True
Piecewise[{{val1,cond1},},val]
give val if all condi are False
It is often convenient to have functions with different forms in different regions. You can do this using Piecewise.
Piecewise functions appear in systems where there is discrete switching between different domains. They are also at the core of many computational methods, including splines and finite elements. Special cases include such functions as RealAbs, UnitStep, Clip, RealSign, Floor, and Max. The Wolfram Language handles piecewise functions in both symbolic and numerical situations.
RandomInteger[]
0 or 1 with probability
RandomInteger[{imin,imax}]
an integer between imin and imax, inclusive
RandomInteger[imax]
an integer between 0 and imax, inclusive
RandomReal[ ]
a real number between 0 and 1
RandomReal[{xmin, xmax}]
a real number between xmin and xmax
RandomReal[xmax]
a real number between 0 and xmax
RandomComplex[]
a complex number in the unit square
RandomComplex[{zmin,zmax}]
a complex number in the rectangle defined by zmin and zmax
RandomComplex[zmax]
a complex number in the rectangle defined by 0 and zmax
RandomReal[range,n]
,
RandomComplex[range,n]
,
RandomInteger[range,n]
a list of n pseudorandom numbers from the given range
RandomReal[range,{n1,n2,}]
,
RandomComplex[range,{n1,n2,}]
,
RandomInteger[range,{n1,n2,}]
an n1×n2× array of pseudorandom numbers
RandomReal and RandomComplex allow you to obtain pseudorandom numbers with any precision.
option name
default value
WorkingPrecisionMachinePrecision
precision to use for real or complex numbers
Here is a 30digit pseudorandom real number in the range 0 to 1:
Substituting in a random numerical value shows that the equation is not always True:
RandomInteger, RandomReal, and RandomComplex are unlike almost any other Wolfram Language functions in that every time you call them, you potentially get a different result. If you use them in a calculation, therefore, you may get different answers on different occasions.
The sequences that you get from RandomInteger, RandomReal, and RandomComplex are not in most senses "truly random", although they should be "random enough" for practical purposes. The sequences are in fact produced by applying a definite mathematical algorithm, starting from a particular "seed". If you give the same seed, then you get the same sequence.
If you want to make sure that you always get the same sequence of pseudorandom numbers, you can explicitly give a seed for the pseudorandom generator, using SeedRandom.
SeedRandom[]
reseed the pseudorandom generator, with the time of day
SeedRandom[s]
reseed with the integer s
Every single time RandomInteger, RandomReal, or RandomComplex is called, the internal state of the pseudorandom generator that it uses is changed. This means that subsequent calls to these functions made in subsidiary calculations will have an effect on the numbers returned in your main calculation. To avoid any problems associated with this, you can localize this effect of their use by doing the calculation inside of BlockRandom.
BlockRandom[expr]
evaluates expr with the current state of the pseudorandom generators localized
By localizing the calculation inside BlockRandom, the internal state of the pseudorandom generator is restored after generating the first list:
Many applications require random numbers from nonuniform distributions. The Wolfram Language has many distributions built into the system. You can give a distribution with appropriate parameters instead of a range to RandomInteger or RandomReal.
RandomInteger[dist]
,
RandomReal[dist]
a pseudorandom number distributed by the random distribution dist
RandomInteger[dist,n]
,
RandomReal[dist,n]
a list of n pseudorandom numbers distributed by the random distribution dist
RandomInteger[dist,{n1,n2,}]
,
RandomReal[dist,{n1,n2,}]
an n1×n2× array of pseudorandom numbers distributed by the random distribution dist
This generates a 4×4 matrix of real numbers using the standard normal distribution:
An additional use of pseudorandom numbers is for selecting from a list. RandomChoice selects with replacement and RandomSample samples without replacement.
RandomChoice[list, n]
choose n items at random from list
RandomChoice[list,{n1,n2,}]
an n1×n2× array of values chosen randomly from list
RandomSample[list, n]
a sample of size n from list
Mod[k,n]
k modulo n (remainder from dividing k by n)
Quotient[m,n]
the quotient of m and n (truncation of m/n)
QuotientRemainder[m,n]
a list of the quotient and the remainder
Divisible[m,n]
test whether m is divisible by n
CoprimeQ[n1,n2,]
test whether the ni are pairwise relatively prime
GCD[n1,n2,]
the greatest common divisor of n1, n2,
LCM[n1,n2,]
the least common multiple of n1, n2,
KroneckerDelta[n1,n2,]
the Kronecker delta equal to 1 if all the ni are equal, and 0 otherwise
IntegerDigits[n,b]
the digits of n in base b
IntegerExponent[n,b]
the highest power of b that divides n
Mod also works with real numbers:
The result from Mod always has the same sign as the second argument:
For any integers a and b, it is always true that b*Quotient[a,b]+Mod[a,b] is equal to a.
Mod[k,n]
result in the range 0 to n-1
Mod[k,n,1]
result in the range 1 to n
Mod[k,n,-n/2]
result in the range -n/2 to +n/2
Mod[k,n,d]
result in the range d to d+n-1
Particularly when you are using Mod to get indices for parts of objects, you will often find it convenient to specify an offset.
The greatest common divisor function GCD[n1,n2,] gives the largest integer that divides all the ni exactly. When you enter a ratio of two integers, the Wolfram Language effectively uses GCD to cancel out common factors and give a rational number in lowest terms.
The least common multiple function LCM[n1,n2,] gives the smallest integer that contains all the factors of each of the ni.
The Kronecker delta function KroneckerDelta[n1,n2,] is equal to 1 if all the ni are equal, and is 0 otherwise. can be thought of as a totally symmetric tensor.
FactorInteger[n]
a list of the prime factors of n, and their exponents
Divisors[n]
a list of the integers that divide n
Prime[k]
the k th prime number
PrimePi[x]
the number of primes less than or equal to x
PrimeQ[n]
give True if n is a prime, and False otherwise
PrimeNu[n]
the number of distinct primes in n
PrimeOmega[n]
the number of prime factors counting multiplicities in n
LiouvilleLambda[n]
the Liouville function
MangoldtLambda[n]
the von Mandgoldt function
FactorInteger[n,GaussianIntegers->True]
a list of the Gaussian prime factors of the Gaussian integer n, and their exponents
PrimeQ[n,GaussianIntegers->True]
give True if n is a Gaussian prime, and False otherwise
You should realize that according to current mathematical thinking, integer factoring is a fundamentally difficult computational problem. As a result, you can easily type in an integer that the Wolfram Language will not be able to factor in anything short of an astronomical length of time. But as long as the integers you give are less than about 50 digits long, FactorInteger should have no trouble. And in special cases it will be able to deal with much longer integers.
Although the Wolfram Language may not be able to factor a large integer, it can often still test whether or not the integer is a prime. In addition, the Wolfram Language has a fast way of finding the th prime number.
PrimeNu gives the number of distinct primes in the factorization of n:
PrimeOmega gives the number of prime factors counting multiplicities in n:
Over the Gaussian integers, 2 can be factored as :
PowerMod[a,b,n]
the power ab modulo n
DirichletCharacter[k,j,n]
the Dirichlet character
EulerPhi[n]
the Euler totient function
MoebiusMu[n]
the Möbius function
DivisorSigma[k,n]
the divisor function
DivisorSum[n,form]
the sum of form[i] for all i that divide n
DivisorSum[n,form,cond]
the sum for only those divisors for which cond[i] gives True
JacobiSymbol[n,m]
the Jacobi symbol
ExtendedGCD[n1,n2,]
the extended GCD of n1, n2,
MultiplicativeOrder[k,n]
the multiplicative order of k modulo n
MultiplicativeOrder[k,n,{r1,r2,}]
the generalized multiplicative order with residues ri
CarmichaelLambda[n]
the Carmichael function
PrimitiveRoot[n]
a primitive root of n
The modular power function PowerMod[a,b,n] gives exactly the same results as Mod[a^b,n] for b>0. PowerMod is much more efficient, however, because it avoids generating the full form of a^b.
If d does not have a square root modulo n, PowerMod[d,n] will remain unevaluated and PowerModList will return an empty list:
PowerMod[d,n] also works for composite :
There are distinct Dirichlet characters for a given modulus k, as labeled by the index j. Different conventions can give different orderings for the possible characters.
gives the total number of distinct divisors of 24:
The function DivisorSum[n,form] represents the sum of form[i] for all i that divide n. DivisorSum[n,form,cond] includes only those divisors for which cond[i] gives True.
This imposes the condition that the value of each divisor i must be less than 6:
The second pair of numbers satisfies :
The generalized multiplicative order function MultiplicativeOrder[k,n,{r1,r2,}] gives the smallest integer such that for some . MultiplicativeOrder[k,n,{-1,1}] is sometimes known as the suborder function of modulo , denoted . MultiplicativeOrder[k,n,{a}] is sometimes known as the discrete log of with respect to the base modulo .
ContinuedFraction[x,n]
generate the first n terms in the continued fraction representation of x
FromContinuedFraction[list]
reconstruct a number from its continued fraction representation
Rationalize[x,dx]
find a rational approximation to x with tolerance dx
This generates the first 10 terms in the continued fraction representation for :
The result is close to :
This gives directly a rational approximation to :
ContinuedFraction[x]
the complete continued fraction representation for a rational or quadratic irrational number
QuadraticIrrationalQ[x]
test whether x is a quadratic irrational
RealDigits[x]
the complete digit sequence for a rational number
RealDigits[x,b]
the complete digit sequence in base b
The continued fraction representation of starts with the term 8, then involves a sequence of terms that repeat forever:
This reconstructs from its continued fraction representation:
Convergents[x]
give a list of rational approximations of x
Convergents[x,n]
give only the first n approximations
This lists successive rational approximations to , until the numerical precision is exhausted:
LatticeReduce[{v1v2,}]
a reduced lattice basis for the set of integer vectors vi
HermiteDecomposition[{v1,v2,}]
the echelon form for the set of integer vectors vi
This gives the reduced basis for a lattice in fourdimensional space specified by three vectors:
Notice that in the last example, LatticeReduce replaces vectors that are nearly parallel by vectors that are more perpendicular. In the process, it finds some quite short basis vectors.
DigitCount[n,b,d]
the number of d digits in the base b representation of n
The plot of the digit count function is selfsimilar:
BitAnd[n1,n2,]
bitwise AND of the integers ni
BitOr[n1,n2,]
bitwise OR of the integers ni
BitXor[n1,n2,]
bitwise XOR of the integers ni
BitNot[n]
bitwise NOT of the integer n
BitLength[n]
number of binary bits in the integer n
BitSet[n,k]
set bit k to 1 in the integer n
BitGet[n,k]
get bit k from the integer n
BitClear[n,k]
set bit k to 0 in the integer n
BitShiftLeft[n,k]
shift the integer n to the left by k bits, padding with zeros
BitShiftRight[n,k]
shift to the right, dropping the last k bits
Bitwise operations act on integers represented as binary bits. BitAnd[n1,n2,] yields the integer whose binary bit representation has ones at positions where the binary bit representations of all of the ni have ones. BitOr[n1,n2,] yields the integer with ones at positions where any of the ni have ones. BitXor[n1,n2] yields the integer with ones at positions where n1 or n2 but not both have ones. BitXor[n1,n2,] has ones where an odd number of the ni have ones.
Bitwise operations are used in various combinatorial algorithms. They are also commonly used in manipulating bitfields in lowlevel computer languages. In such languages, however, integers normally have a limited number of digits, typically a multiple of 8. Bitwise operations in the Wolfram Language in effect allow integers to have an unlimited number of digits. When an integer is negative, it is taken to be represented in two's complement form, with an infinite sequence of ones on the left. This allows BitNot[n] to be equivalent simply to .
SquareFreeQ[n]
give True if n does not contain a squared factor, False otherwise
SquareFreeQ[n] checks to see if n has a square prime factor. This is done by computing MoebiusMu[n] and seeing if the result is zero; if it is, then n is not squarefree, otherwise it is. Computing MoebiusMu[n] involves finding the smallest prime factor q of n. If n has a small prime factor (less than or equal to ), this is very fast. Otherwise, FactorInteger is used to find q.
NextPrime[n]
give the smallest prime larger than n
RandomPrime[{min,max}]
return a random prime number between min and max
RandomPrime[max]
return a random prime number less than or equal to max
RandomPrime[{min,max},n]
return n random prime numbers between min and max
RandomPrime[max,n]
return n random prime numbers less than or equal to max
NextPrime[n] finds the smallest prime p such that p>n. The algorithm does a direct search using PrimeQ on the odd numbers greater than n.
For RandomPrime[{min,max}] and RandomPrime[max], a random prime p is obtained by randomly selecting from a prime lookup table if max is small and by a random search of integers in the range if max is large. If no prime exists in the specified range, the input is returned unevaluated with an error message.
PrimePowerQ[n]
determine whether n is a positive integer power of a rational prime
The algorithm for PrimePowerQ involves first computing the least prime factor p of n and then attempting division by p until either 1 is obtained, in which case n is a prime power, or until division is no longer possible, in which case n is not a prime power.
ChineseRemainder[list1,list2]
give the smallest non-negative integer r with Mod[r,list2]==list1
The Chinese remainder theorem states that a certain class of simultaneous congruences always has a solution. ChineseRemainder[list1,list2] finds the smallest nonnegative integer r such that Mod[r,list2] is list1. The solution is unique modulo the least common multiple of the elements of list2.
PrimitiveRoot[n]
give a primitive root of n, where n is a prime power or twice a prime power
PrimitiveRoot[n] returns a generator for the group of numbers relatively prime to n under multiplication . This has a generator if and only if n is 2, 4, a power of an odd prime, or twice a power of an odd prime. If n is a prime or prime power, the least positive primitive root will be returned.
SquaresR[d,n]
give the number of representations of an integer n as a sum of d squares
PowersRepresentations[n,k,p]
give the distinct representations of the integer n as a sum of k non-negative p th integer powers
n!
factorial
n!!
double factorial
Binomial[n,m]
binomial coefficient
Multinomial[n1,n2,]
multinomial coefficient
CatalanNumber[n]
Catalan number
Hyperfactorial[n]
hyperfactorial
BarnesG[n]
Barnes G-function
Subfactorial[n]
number of derangements of objects
Fibonacci[n]
Fibonacci number
Fibonacci[n,x]
Fibonacci polynomial
LucasL[n]
Lucas number
LucasL[n,x]
Lucas polynomial
HarmonicNumber[n]
harmonic number
HarmonicNumber[n,r]
harmonic number of order
BernoulliB[n]
Bernoulli number
BernoulliB[n,x]
Bernoulli polynomial
NorlundB[n,a]
Nörlund polynomial
NorlundB[n,a,x]
generalized Bernoulli polynomial
EulerE[n]
Euler number
EulerE[n,x]
Euler polynomial
StirlingS1[n,m]
Stirling number of the first kind
StirlingS2[n,m]
Stirling number of the second kind
BellB[n]
Bell number
BellB[n,x]
Bell polynomial
PartitionsP[n]
the number of unrestricted partitions of the integer
IntegerPartitions[n]
partitions of an integer
PartitionsQ[n]
the number of partitions of into distinct parts
Signature[{i1,i2,}]
the signature of a permutation
For nonintegers, the Wolfram Language evaluates factorials using the gamma function:
This gives the number of ways of partitioning objects into sets containing 6 and 5 objects:
The result is the same as :
Numerical values for Bernoulli numbers are needed in many numerical algorithms. You can always get these numerical values by first finding exact rational results using BernoulliB[n], and then applying N.
This gives the second Bernoulli polynomial :
BernoulliB[n] gives exact rationalnumber results for Bernoulli numbers:
IntegerPartitions[n] gives a list of the partitions of , with length PartitionsP[n].
Most of the functions here allow you to count various kinds of combinatorial objects. Functions like IntegerPartitions and Permutations allow you instead to generate lists of various combinations of elements.
ClebschGordan[{j1,m1},{j2,m2},{j,m}]
ClebschGordan coefficient
ThreeJSymbol[{j1,m1},{j2,m2},{j3,m3}]
Wigner 3j symbol
SixJSymbol[{j1,j2,j3},{j4,j5,j6}]
Racah 6j symbol
The 3j symbols or Wigner coefficients ThreeJSymbol[{j1,m1},{j2,m2},{j3,m3}] are a more symmetrical form of ClebschGordan coefficients. In the Wolfram Language, the ClebschGordan coefficients are given in terms of 3j symbols by .
The 6j symbols SixJSymbol[{j1,j2,j3},{j4,j5,j6}] give the couplings of three quantum mechanical angular momentum states. The Racah coefficients are related by a phase to the 6j symbols.
You can give symbolic parameters in 3j symbols:
Exp[z]
exponential function
Log[z]
logarithm
Log[b,z]
logarithm to base
Log2[z]
,
Log10[z]
logarithm to base 2 and 10
Sin[z]
,
Cos[z]
,
Tan[z]
,
Csc[z]
,
Sec[z]
,
Cot[z]
trigonometric functions (with arguments in radians)
ArcSin[z]
,
ArcCos[z]
,
ArcTan[z]
,
ArcCsc[z]
,
ArcSec[z]
,
ArcCot[z]
inverse trigonometric functions (giving results in radians)
ArcTan[x,y]
the argument of
Sinh[z]
,
Cosh[z]
,
Tanh[z]
,
Csch[z]
,
Sech[z]
,
Coth[z]
hyperbolic functions
ArcSinh[z]
,
ArcCosh[z]
,
ArcTanh[z]
,
ArcCsch[z]
,
ArcSech[z]
,
ArcCoth[z]
inverse hyperbolic functions
Sinc[z]
sinc function
Haversine[z]
haversine function
InverseHaversine[z]
inverse haversine function
Gudermannian[z]
Gudermannian function
InverseGudermannian[z]
inverse Gudermannian function
The Wolfram Language gives exact results for logarithms whenever it can. Here is :
You can convert from degrees by explicitly multiplying by the constant Degree:
The need to make one choice from two solutions means that Sqrt[x] cannot be a true inverse function for x^2. Taking a number, squaring it, and then taking the square root can give you a different number than you started with.
The branch cut in Sqrt along the negative real axis means that values of Sqrt[z] with just above and below the axis are very different:
The discontinuity along the negative real axis is quite clear in this threedimensional picture of the imaginary part of the square root function:
Sqrt[z]
and
z^s
for Re , for Re ( not an integer)
Exp[z]
none
Log[z]
trigonometric functions
none
ArcSin[z]
and
ArcCos[z]
and
ArcTan[z]
and
ArcCsc[z]
and
ArcSec[z]
ArcCot[z]
hyperbolic functions
none
ArcSinh[z]
and
ArcCosh[z]
ArcTanh[z]
and
ArcCsch[z]
ArcSech[z]
and
ArcCoth[z]
Some branchcut discontinuities in the complex plane.
ArcSin is a multiplevalued function, so there is no guarantee that it always gives the "inverse" of Sin:
Values of ArcSin[z] on opposite sides of the branch cut can be very different:
A threedimensional picture, showing the two branch cuts for the function :
I
Infinity
Pi
Degree
: degrees to radians conversion factor
GoldenRatio
E
EulerGamma
Euler's constant
Catalan
Catalan's constant
Khinchin
Khinchin's constant
Glaisher
Glaisher's constant
Khinchin's constant Khinchin (sometimes called Khintchine's constant) is given by . It gives the geometric mean of the terms in the continued fraction representation for a typical real number.
LegendreP[n,x]
Legendre polynomials
LegendreP[n,m,x]
associated Legendre polynomials
SphericalHarmonicY[l,m,θ,ϕ]
spherical harmonics
GegenbauerC[n,m,x]
Gegenbauer polynomials (x)
ChebyshevT[n,x]
,
ChebyshevU[n,x]
Chebyshev polynomials and of the first and second kinds
HermiteH[n,x]
Hermite polynomials
LaguerreL[n,x]
Laguerre polynomials
LaguerreL[n,a,x]
generalized Laguerre polynomials
ZernikeR[n,m,x]
Zernike radial polynomials
JacobiP[n,a,b,x]
Jacobi polynomials
This gives the algebraic form of the Legendre polynomial :
The integral gives zero by virtue of the orthogonality of the Legendre polynomials:
Highdegree Legendre polynomials oscillate rapidly:
Gegenbauer polynomials GegenbauerC[n,m,x] can be viewed as generalizations of the Legendre polynomials to systems with dimensional spherical symmetry. They are sometimes known as ultraspherical polynomials.
This gives the density for an excited state of a quantummechanical harmonic oscillator. The average of the wiggles is roughly the classical physics result:
You can get formulas for generalized Laguerre polynomials with arbitrary values of :
You can use FindRoot to find roots of special functions:

Gamma and Related Functions

Beta[a,b]
Euler beta function
Beta[z,a,b]
incomplete beta function
BetaRegularized[z,a,b]
regularized incomplete beta function
Gamma[z]
Euler gamma function
Gamma[a,z]
incomplete gamma function
Gamma[a,z0,z1]
generalized incomplete gamma function
GammaRegularized[a,z]
regularized incomplete gamma function
InverseBetaRegularized[s,a,b]
inverse beta function
InverseGammaRegularized[a,s]
inverse gamma function
Pochhammer[a,n]
Pochhammer symbol
PolyGamma[z]
digamma function
PolyGamma[n,z]
th derivative of the digamma function
LogGamma[z]
Euler log-gamma function
LogBarnesG[z]
logarithm of Barnes G-function
BarnesG[z]
Barnes G-function
Hyperfactorial[n]
hyperfactorial function
There are some computations, particularly in number theory, where the logarithm of the gamma function often appears. For positive real arguments, you can evaluate this simply as Log[Gamma[z]]. For complex arguments, however, this form yields spurious discontinuities. The Wolfram System therefore includes the separate function LogGamma[z], which yields the logarithm of the gamma function with a single branch cut along the negative real axis.
The Euler beta function Beta[a,b] is .
The Pochhammer symbol or rising factorial Pochhammer[a,n] is . It often appears in series expansions for hypergeometric functions. Note that the Pochhammer symbol has a definite value even when the gamma functions that appear in its definition are infinite.
The alternative incomplete gamma function can therefore be obtained in the Wolfram System as Gamma[a,0,z].
BarnesG[z] is a generalization of the Gamma function and is defined by its functional identity BarnesG[z+1]=Gamma[z] BarnesG[z], where the third derivative of the logarithm of BarnesG is positive for positive z. BarnesG is an entire function in the complex plane.
LogBarnesG[z] is a holomorphic function with a branch cut along the negative real-axis such that Exp[LogBarnesG[z]]=BarnesG[z].
Hyperfactorial[n] is a generalization of to the complex plane.

Zeta and Related Functions

DirichletL[k,j,s]
Dirichlet L-function
LerchPhi[z,s,a]
Lerch's transcendent
PolyLog[n,z]
polylogarithm function
PolyLog[n,p,z]
Nielsen generalized polylogarithm function
RamanujanTau[n]
Ramanujan function
RamanujanTauL[n]
Ramanujan Dirichlet L-function
RamanujanTauTheta[n]
Ramanujan theta function
RamanujanTauZ[n]
Ramanujan Z-function
RiemannSiegelTheta[t]
RiemannSiegel function
RiemannSiegelZ[t]
RiemannSiegel function
StieltjesGamma[n]
Stieltjes constants
Zeta[s]
Riemann zeta function
Zeta[s,a]
generalized Riemann zeta function
HurwitzZeta[s,a]
Hurwitz zeta function
HurwitzLerchPhi[z,s,a]
HurwitzLerch transcendent
The Hurwitz zeta function HurwitzZeta[s,a] is implemented as .
Here is the numerical approximation for :
The Wolfram System gives exact results for :
Here is a threedimensional picture of the Riemann zeta function in the complex plane:
This is a plot of the absolute value of the Riemann zeta function on the critical line . You can see the first few zeros of the zeta function:
The Lerch transcendent is related to integrals of the FermiDirac distribution in statistical mechanics by .
LerchPhi[z,s,a,DoublyInfinite->True] gives the doubly infinite sum .
The HurwitzLerch transcendent HurwitzLerchPhi[z,s,a] generalizes HurwitzZeta[s,a] and is defined by .
ZetaZero[k]
the th zero of the zeta function on the critical line
ZetaZero[k,x0]
the th zero above height
ZetaZero[1] represents the first nontrivial zero of :

Exponential Integral and Related Functions

CosIntegral[z]
cosine integral function
CoshIntegral[z]
hyperbolic cosine integral function
ExpIntegralE[n,z]
exponential integral En(z)
ExpIntegralEi[z]
exponential integral
LogIntegral[z]
logarithmic integral
SinIntegral[z]
sine integral function
SinhIntegral[z]
hyperbolic sine integral function
The Wolfram System has two forms of exponential integral: ExpIntegralE and ExpIntegralEi.
The exponential integral function ExpIntegralE[n,z] is defined by .

Error Function and Related Functions

Erf[z]
error function
Erf[z0,z1]
generalized error function
Erfc[z]
complementary error function
Erfi[z]
imaginary error function
FresnelC[z]
Fresnel integral C(z)
FresnelS[z]
Fresnel integral
InverseErf[s]
inverse error function
InverseErfc[s]
inverse complementary error function

Bessel and Related Functions

AiryAi[z]
and
AiryBi[z]
Airy functions and
AiryAiPrime[z]
and
AiryBiPrime[z]
derivatives of Airy functions and
BesselJ[n,z]
and
BesselY[n,z]
Bessel functions and
BesselI[n,z]
and
BesselK[n,z]
modified Bessel functions and
KelvinBer[n,z]
and
KelvinBei[n,z]
Kelvin functions and
KelvinKer[n,z]
and
KelvinKei[n,z]
Kelvin functions and
HankelH1[n,z]
and
HankelH2[n,z]
Hankel functions and
SphericalBesselJ[n,z]
and
SphericalBesselY[n,z]
spherical Bessel functions and
SphericalHankelH1[n,z]
and
SphericalHankelH2[n,z]
spherical Hankel functions and
StruveH[n,z]
and
StruveL[n,z]
Struve function and modified Struve function
The Hankel functions (or Bessel functions of the third kind) HankelH1[n,z] and HankelH2[n,z] give an alternative pair of solutions to the Bessel differential equation, related according to .
The spherical Bessel functions SphericalBesselJ[n,z] and SphericalBesselY[n,z], as well as the spherical Hankel functions SphericalHankelH1[n,z] and SphericalHankelH2[n,z], arise in studying wave phenomena with spherical symmetry. These are related to the ordinary functions by , where and can be and , and , or and . For integer , spherical Bessel functions can be expanded in terms of elementary functions by using FunctionExpand.
Here is a plot of . This is a curve that an idealized chain hanging from one end can form when you wiggle it:
The Wolfram System generates explicit formulas for halfintegerorder Bessel functions:
The Airy function plotted here gives the quantummechanical amplitude for a particle in a potential that increases linearly from left to right. The amplitude is exponentially damped in the classically inaccessible region on the right:
BesselJZero[n,k]
the th zero of the Bessel function
BesselJZero[n,k,x0]
the th zero greater than
BesselYZero[n,k]
the th zero of the Bessel function
BesselYZero[n,k,x0]
the th zero greater than
AiryAiZero[k]
the th zero of the Airy function
AiryAiZero[k,x0]
the th zero less than
AiryBiZero[k]
the th zero of the Airy function
AiryBiZero[k,x0]
the th zero less than

Legendre and Related Functions

LegendreP[n,z]
Legendre functions of the first kind
LegendreP[n,m,z]
associated Legendre functions of the first kind
LegendreQ[n,z]
Legendre functions of the second kind
LegendreQ[n,m,z]
associated Legendre functions of the second kind
Legendre functions arise in studies of quantummechanical scattering processes.
LegendreP[n,m,z]
or
LegendreP[n,m,1,z]
type 1 function containing
LegendreP[n,m,2,z]
type 2 function containing
LegendreP[n,m,3,z]
type 3 function containing
Types of Legendre functions. Analogous types exist for LegendreQ.
In the same way, you can use the functions GegenbauerC and so on with arbitrary complex indices to get Gegenbauer functions, Chebyshev functions, Hermite functions, Jacobi functions and Laguerre functions. Unlike for associated Legendre functions, however, there is no need to distinguish different types in such cases.

Hypergeometric Functions and Generalizations

Hypergeometric0F1[a,z]
hypergeometric function
Hypergeometric0F1Regularized[a,z]
regularized hypergeometric function
Hypergeometric1F1[a,b,z]
Kummer confluent hypergeometric function
Hypergeometric1F1Regularized[a,b,z]
regularized confluent hypergeometric function
HypergeometricU[a,b,z]
confluent hypergeometric function
WhittakerM[k,m,z]
and
WhittakerW[k,m,z]
Whittaker functions and
ParabolicCylinderD[ν,z]
parabolic cylinder function
Many of the special functions that have been discussed so far can be viewed as special cases of the confluent hypergeometric function Hypergeometric1F1[a,b,z].
Among the functions that can be obtained from are the Bessel functions, error function, incomplete gamma function, and Hermite and Laguerre polynomials.
The parabolic cylinder functions ParabolicCylinderD[ν,z] are related to the Hermite functions by .
A limiting form of the confluent hypergeometric function that often appears is Hypergeometric0F1[a,z]. This function is obtained as the limit .
Bessel functions of the first kind can be expressed in terms of the function.
Hypergeometric2F1[a,b,c,z]
hypergeometric function
Hypergeometric2F1Regularized[a,b,c,z]
regularized hypergeometric function
HypergeometricPFQ[{a1,,ap},{b1,,bq},z]
generalized hypergeometric function
HypergeometricPFQRegularized[{a1,,ap},{b1,,bq},z]
regularized generalized hypergeometric function
MeijerG[{{a1,,an},{an+1,,ap}},{{b1,,bm},{bm+1,,bq}},z]
Meijer G function
AppellF1[a,b1,b2,c,x,y]
Appell hypergeometric function of two variables
The hypergeometric function can also be written as an integral: .
The hypergeometric function is also sometimes denoted by , and is known as the Gauss series or the Kummer series.
The Legendre functions, and the functions that give generalizations of other orthogonal polynomials, can be expressed in terms of the hypergeometric function. Complete elliptic integrals can also be expressed in terms of the function.
The Riemann P function, which gives solutions to Riemann's differential equation, is also a function.
The generalized hypergeometric function or Barnes extended hypergeometric function HypergeometricPFQ[{a1,,ap},{b1,,bq},z] has series expansion .
The Meijer G function MeijerG[{{a1,,an},{an+1,,ap}},{{b1,,bm},{bm+1,,bq}},z] is defined by the contour integral representation , where the contour of integration is set up to lie between the poles of and the poles of . MeijerG is a very general function whose special cases cover most of the functions discussed in the past few sections.
The Appell hypergeometric function of two variables AppellF1[a,b1,b2,c,x,y] has series expansion . This function appears for example in integrating cubic polynomials to arbitrary powers.

The q-Series and Related Functions

QPochhammer[z,q]
-Pochhammer symbol
QPochhammer[z,q,n]
-Pochhammer symbol
QFactorial[z,q]
-analog of factorial
QBinomial[n,m,q]
-analog of binomial coefficient
QGamma[z,q]
-analog of Euler gamma function
QPolyGamma[z,q]
-digamma function
QPolyGamma[n,z,q]
th derivative of the -digamma function
QHypergeometricPFQ[{a1,,ap},{b1,,bq},q,z]
basic hypergeometric series
-series and related functions.

The Product Log Function

ProductLog[z]
product log function

Spheroidal Functions

SpheroidalS1[n,m,γ,z]
and
SpheroidalS2[n,m,γ,z]
radial spheroidal functions and
SpheroidalS1Prime[n,m,γ,z]
and
SpheroidalS2Prime[n,m,γ,z]
z derivatives of radial spheroidal functions
SpheroidalPS[n,m,γ,z]
and
SpheroidalQS[n,m,γ,z]
angular spheroidal functions and
SpheroidalPSPrime[n,m,γ,z]
and
SpheroidalQSPrime[n,m,γ,z]
z derivatives of angular spheroidal functions
SpheroidalEigenvalue[n,m,γ]
spheroidal eigenvalue of degree n and order m
The radial spheroidal functions SpheroidalS1[n,m,γ,z] and SpheroidalS2[n,m,γ,z] and angular spheroidal functions SpheroidalPS[n,m,γ,z] and SpheroidalQS[n,m,γ,z] appear in solutions to the wave equation in spheroidal regions. Both types of functions are solutions to the equation . This equation has normalizable solutions only when is a spheroidal eigenvalue given by SpheroidalEigenvalue[n,m,γ]. The spheroidal functions also appear as eigenfunctions of finite analogs of Fourier transforms.
function
γ
z
range
name
angular prolate
radial prolate
angular oblate
radial oblate
Many different normalizations for spheroidal functions are used in the literature. The Wolfram System uses the MeixnerSchäfke normalization scheme.
An angular spheroidal function with gives Mathieu angular functions:
Amplitude (used by the Wolfram Language, in radians)
Argument (used by the Wolfram Language): related to amplitude by
Delta amplitude :
Coordinate :
Characteristic (used by the Wolfram Language in elliptic integrals of the third kind)
Parameter (used by the Wolfram Language): preceded by , as in
Complementary parameter :
Modulus : preceded by comma, as in ;
Modular angle : preceded by , as in ;
Nome : preceded by comma in functions;
Invariants , (used by the Wolfram Language)
Halfperiods , : , , where
Ratio of periods :
Discriminant :
Parameters of curve , (used by the Wolfram Language)
Coordinate (used by the Wolfram Language): related by
JacobiAmplitude[u,m]
give the amplitude ϕ corresponding to argument u and parameter m
EllipticNomeQ[m]
give the nome q corresponding to parameter m
InverseEllipticNomeQ[q]
give the parameter m corresponding to nome q
WeierstrassInvariants[{ω,ω}]
give the invariants {g2,g3} corresponding to the halfperiods {ω,ω}
WeierstrassHalfPeriods[{g2,g3}]
give the halfperiods {ω,ω} corresponding to the invariants {g2,g3}

Elliptic Integrals

EllipticK[m]
complete elliptic integral of the first kind
EllipticF[ϕ,m]
elliptic integral of the first kind
EllipticE[m]
complete elliptic integral of the second kind E(m)
EllipticE[ϕ,m]
elliptic integral of the second kind E(ϕm)
EllipticPi[n,m]
complete elliptic integral of the third kind
EllipticPi[n,ϕ,m]
elliptic integral of the third kind
JacobiZeta[ϕ,m]
Jacobi zeta function
The Jacobi zeta function JacobiZeta[ϕ,m] is given by .
The Heuman lambda function is given by .
The elliptic integral of the third kind EllipticPi[n,ϕ,m] is given by .
The complete elliptic integral of the third kind EllipticPi[n,m] is given by .
Here is a plot of the complete elliptic integral of the second kind :

Elliptic Functions

JacobiAmplitude[u,m]
amplitude function
JacobiSN[u,m]
,
JacobiCN[u,m]
, etc.
Jacobi elliptic functions , etc.
InverseJacobiSN[v,m]
,
InverseJacobiCN[v,m]
, etc.
inverse Jacobi elliptic functions , etc.
EllipticTheta[a,u,q]
theta functions (, , )
EllipticThetaPrime[a,u,q]
derivatives of theta functions (, , )
SiegelTheta[τ,s]
Siegel theta function
SiegelTheta[v,τ,s]
Siegel theta function
WeierstrassP[u,{g2,g3}]
Weierstrass elliptic function
WeierstrassPPrime[u,{g2,g3}]
derivative of Weierstrass elliptic function
InverseWeierstrassP[p,{g2,g3}]
inverse Weierstrass elliptic function
WeierstrassSigma[u,{g2,g3}]
Weierstrass sigma function
WeierstrassZeta[u,{g2,g3}]
Weierstrass zeta function
This shows two complete periods in each direction of the absolute value of the Jacobi elliptic function :
The four theta functions are obtained from EllipticTheta[a,u,q] by taking a to be 1, 2, 3, or 4. The functions are defined by , , , . The theta functions are often written as with the parameter not explicitly given. The theta functions are sometimes written in the form , where is related to by . In addition, is sometimes replaced by , given by . All the theta functions satisfy a diffusionlike differential equation .

Elliptic Modular Functions

DedekindEta[τ]
Dedekind eta function
KleinInvariantJ[τ]
Klein invariant modular function
ModularLambda[τ]
modular lambda function
The Klein invariant modular function KleinInvariantJ[τ] and the Dedekind eta function DedekindEta[τ] satisfy the relations .

Generalized Elliptic Integrals and Functions

ArithmeticGeometricMean[a,b]
the arithmeticgeometric mean of and
EllipticExp[u,{a,b}]
generalized exponential associated with the elliptic curve
EllipticLog[{x,y},{a,b}]
generalized logarithm associated with the elliptic curve
The function EllipticExp[u,{a,b}] is the inverse of EllipticLog. It returns the list {x,y} that appears in EllipticLog. EllipticExp is an elliptic function, doubly periodic in the complex plane.
MathieuC[a,q,z]
even Mathieu functions with characteristic value a and parameter q
MathieuS[b,q,z]
odd Mathieu functions with characteristic value b and parameter q
MathieuCPrime[a,q,z]
and
MathieuSPrime[b,q,z]
z derivatives of Mathieu functions
MathieuCharacteristicA[r,q]
characteristic value ar for even Mathieu functions with characteristic exponent r and parameter q
MathieuCharacteristicB[r,q]
characteristic value br for odd Mathieu functions with characteristic exponent r and parameter q
MathieuCharacteristicExponent[a,q]
characteristic exponent r for Mathieu functions with characteristic value a and parameter q
automatic evaluation
exact results for specific arguments
N[expr,n]
numerical approximations to any precision
D[expr,x]
exact results for derivatives
N[D[expr,x]]
numerical approximations to derivatives
Series[expr,{x,x0,n}]
series expansions
Integrate[expr,x]
exact results for integrals
NIntegrate[expr,x]
numerical approximations to integrals
FindRoot[expr==0,{x,x0}]
numerical approximations to roots
For most choices of arguments, no exact reductions of special functions are possible. But in such cases, the Wolfram System allows you to find numerical approximations to any degree of precision. The algorithms that are built into the Wolfram System cover essentially all values of parametersreal and complexfor which the special functions are defined.
Most special functions have derivatives that can be expressed in terms of elementary functions or other special functions. But even in cases where this is not so, you can still use N to find numerical approximations to derivatives.
Applying N gives a numerical approximation:
The Wolfram System incorporates a vast amount of knowledge about special functionsincluding essentially all the results that have been derived over the years. You access this knowledge whenever you do operations on special functions in the Wolfram System.
FullSimplify[expr]
try to simplify expr using a range of transformation rules
FunctionExpand[expr]
try to expand out special functions
In this case the final result does not even involve PolyGamma: