Mathematical Functions
Mathematical 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, isMod, notModulo.
Mathematical functions that are usually referred to by a person's name have names in the Wolfram Language of the formPersonSymbol. Thus, for example, the Legendre polynomials
are denotedLegendreP[n,x]. Although this convention does lead to longer function names, it avoids any ambiguity or confusion.
are denotedLegendreP[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 givenbefore the superscripts in the Wolfram Language form. Thus, for example, the associated Legendre polynomials
are denotedLegendreP[n,m,x].
are denotedLegendreP[n,m,x].The overall goal of symbolic computation is typically to get formulas that are valid for many possible values of the variables that appear in them. It is however often not practical to try to get formulas that are valid for absolutely every possible value of each variable.


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.
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.The basic operations of the Wolfram Language are nevertheless carefully set up so that whenever possible the results obtained will be valid for almost all values of each variable.
| IntegerPart[x] | integer part ofx |
| FractionalPart[x] | fractional part ofx |
| Round[x] | integer〈x〉 closest tox |
| Floor[x] | greatest integer⌊x⌋ not larger thanx |
| Ceiling[x] | least integer⌈x⌉ not smaller thanx |
| Rationalize[x] | rational number approximation tox |
| Rationalize[x,dx] | rational approximation within tolerancedx |
| x | IntegerPart[x] | FractionalPart[x] | Round[x] | Floor[x] | Ceiling[x] |
| 2.4 | 2 | 0.4 | 2 | 2 | 3 |
| 2.5 | 2 | 0.5 | 2 | 2 | 3 |
| 2.6 | 2 | 0.6 | 3 | 2 | 3 |
| -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] andFractionalPart[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] andCeiling[x] often arise in working out how many elements there will be in sequences of numbers with non‐integer spacings.
| RealSign[x] | 1 forx>0, -1 forx<0 |
| UnitStep[x] | 1 forx≥0, 0 forx<0 |
| RealAbs[x] | absolute valuex ofx |
| 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 ofx1,x2,… | |
| Min[x1,x2,…] or Min[{x1,x2,…},…] | |
the minimum ofx1,x2,… | |
| x+I y | the complex numberx+iy |
| Re[z] | the real partRez |
| Im[z] | the imaginary partImz |
| Conjugate[z] | the complex conjugatez* or ![]() |
| Abs[z] | the absolute valuez |
| Arg[z] | the argumentϕ such thatz=zei ϕ |
| Sign[z] | the complex signz/z forz≠0 |
Boole[expr] is a basic function that turnsTrue andFalse into1 and0. It is sometimes known as thecharacteristic function orindicator function.
It is often convenient to have functions with different forms in different regions. You can do this usingPiecewise.
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 asRealAbs,UnitStep,Clip,RealSign,Floor, andMax. The Wolfram Language handles piecewise functions in both symbolic and numerical situations.
The Wolfram Language has three functions for generating pseudorandom numbers that are distributed uniformly over a range of values.
| RandomInteger[] | 0 or 1 with probability ![]() |
| RandomInteger[{imin,imax}] | an integer betweenimin andimax, inclusive |
| RandomInteger[imax] | an integer between 0 andimax, inclusive |
| RandomReal[] | a real number between 0 and 1 |
| RandomReal[{xmin,xmax}] | a real number betweenxmin andxmax |
| RandomReal[xmax] | a real number between 0 andxmax |
| RandomComplex[] | a complex number in the unit square |
| RandomComplex[{zmin,zmax}] | a complex number in the rectangle defined byzmin andzmax |
| RandomComplex[zmax] | a complex number in the rectangle defined by 0 andzmax |
| RandomReal[range,n] , RandomComplex[range,n], RandomInteger[range,n] | |
a list ofn pseudorandom numbers from the given range | |
| RandomReal[range,{n1,n2,…}] , RandomComplex[range,{n1,n2,…}], RandomInteger[range,{n1,n2,…}] | |
ann1×n2×… array of pseudorandom numbers | |
option name | default value | |
| WorkingPrecision | MachinePrecision | precision to use for real or complex numbers |
If you get arrays of pseudorandom numbers repeatedly, you should get a "typical" sequence of numbers, with no particular pattern. There are many ways to use such numbers.
One common way to use pseudorandom numbers is in making numerical tests of hypotheses. For example, if you believe that two symbolic expressions are mathematically equal, you can test this by plugging in "typical" numerical values for symbolic parameters, and then comparing the numerical results. (If you do this, you should be careful about numerical accuracy problems and about functions of complex variables that may not have unique values.)
Substituting in a random numerical value shows that the equation is not alwaysTrue:
Other common uses of pseudorandom numbers include simulating probabilistic processes, and sampling large spaces of possibilities. The pseudorandom numbers that the Wolfram Language generates for a range of numbers are always uniformly distributed over the range you specify.
RandomInteger,RandomReal, andRandomComplex 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 fromRandomInteger,RandomReal, andRandomComplex 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.
When the Wolfram Language starts up, it takes the time of day (measured in small fractions of a second) as the seed for the pseudorandom number generator. Two different Wolfram Language sessions will therefore almost always give different sequences of pseudorandom numbers.
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, usingSeedRandom.
| SeedRandom[] | reseed the pseudorandom generator, with the time of day |
| SeedRandom[s] | reseed with the integers |
If you reseed the pseudorandom generator with the same seed, you get the same sequence of pseudorandom numbers:
Every single timeRandomInteger,RandomReal, orRandomComplex 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 ofBlockRandom.
| BlockRandom[expr] | evaluatesexpr with the current state of the pseudorandom generators localized |
By localizing the calculation insideBlockRandom, the internal state of the pseudorandom generator is restored after generating the first list:
Many applications require random numbers from non‐uniform distributions. The Wolfram Language has many distributions built into the system. You can give a distribution with appropriate parameters instead of a range toRandomInteger orRandomReal.
| RandomInteger[dist] , RandomReal[dist] | |
a pseudorandom number distributed by the random distributiondist | |
| RandomInteger[dist,n] , RandomReal[dist,n] | |
a list ofn pseudorandom numbers distributed by the random distributiondist | |
| RandomInteger[dist,{n1,n2,…}] , RandomReal[dist,{n1,n2,…}] | |
ann1×n2×… array of pseudorandom numbers distributed by the random distributiondist | |
This generates five high-precision real numbers distributed normally with mean 2 and standard deviation 4:
An additional use of pseudorandom numbers is for selecting from a list.RandomChoice selects with replacement andRandomSample samples without replacement.
| RandomChoice[list,n] | choosen items at random fromlist |
| RandomChoice[list,{n1,n2,…}] | ann1×n2×… array of values chosen randomly fromlist |
| RandomSample[list,n] | a sample of sizen fromlist |
Chances are very high that at least one of the choices was repeated in the output. That is because when an element is chosen, it is immediately replaced. On the other hand, if you want to select from an actual set of elements, there should be no replacement.
Sample 10 items at random from the digits 0 through 9 without replacement. The result is a random permutation of the digits:
| Mod[k,n] | k modulon(remainder from dividingk byn) |
| Quotient[m,n] | the quotient ofm andn(truncation ofm/n) |
| QuotientRemainder[m,n] | a list of the quotient and the remainder |
| Divisible[m,n] | test whetherm is divisible byn |
| CoprimeQ[n1,n2,…] | test whether theni are pairwise relatively prime |
| GCD[n1,n2,…] | the greatest common divisor ofn1,n2,… |
| LCM[n1,n2,…] | the least common multiple ofn1,n2,… |
| KroneckerDelta[n1,n2,…] | the Kronecker delta equal to 1 if all theni are equal, and 0 otherwise |
| IntegerDigits[n,b] | the digits ofn in baseb |
| IntegerExponent[n,b] | the highest power ofb that dividesn |
Mod also works with real numbers:
The result fromMod always has the same sign as the second argument:
| Mod[k,n] | result in the range0 ton-1 |
| Mod[k,n,1] | result in the range1 ton |
| Mod[k,n,-n/2] | result in the range⌈-n/2⌉ to⌊+n/2⌋ |
| Mod[k,n,d] | result in the ranged tod+n-1 |
Particularly when you are usingMod to get indices for parts of objects, you will often find it convenient to specify an offset.
Thegreatest common divisor functionGCD[n1,n2,…] gives the largest integer that divides all theni exactly. When you enter a ratio of two integers, the Wolfram Language effectively usesGCD to cancel out common factors and give a rational number in lowest terms.
Theleast common multiple functionLCM[n1,n2,…] gives the smallest integer that contains all the factors of each of theni.
TheKronecker delta functionKroneckerDelta[n1,n2,…] is equal to 1 if all theni are equal, and is 0 otherwise.
can be thought of as a totally symmetric tensor.
can be thought of as a totally symmetric tensor.| FactorInteger[n] | a list of the prime factors ofn, and their exponents |
| Divisors[n] | a list of the integers that dividen |
| Prime[k] | thekth prime number |
| PrimePi[x] | the number of primes less than or equal tox |
| PrimeQ[n] | |
| PrimeNu[n] | the number of distinct primes inn |
| PrimeOmega[n] | the number of prime factors counting multiplicities inn |
| 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 integern, and their exponents | |
| PrimeQ[n,GaussianIntegers->True] | |
This gives the factors of 24 as
,
. The first element in each list is the factor; the second is its exponent:
,
. The first element in each list is the factor; the second is its exponent: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.
th prime number.Particularly in number theory, it is often more important to know the distribution of primes than their actual values. The functionPrimePi[x] gives the number of primes
that are less than or equal to
.
that are less than or equal to
.By default,FactorInteger allows only real integers. But with the option settingGaussianIntegers->True, it also handlesGaussian integers, which are complex numbers with integer real and imaginary parts. Just as it is possible to factor uniquely in terms of real primes, it is also possible to factor uniquely in terms of Gaussian primes. There is nevertheless some potential ambiguity in the choice of Gaussian primes. In the Wolfram Language, they are always chosen to have positive real parts, and non‐negative imaginary parts, except for a possible initial factor of
or
.
or
.| PowerMod[a,b,n] | the powerab modulon |
| 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 ofform[i] for alli that dividen |
| DivisorSum[n,form,cond] | the sum for only those divisors for whichcond[i] givesTrue |
| JacobiSymbol[n,m] | the Jacobi symbol ![]() |
| ExtendedGCD[n1,n2,…] | the extended GCD ofn1,n2,… |
| MultiplicativeOrder[k,n] | the multiplicative order ofk modulon |
| MultiplicativeOrder[k,n,{r1,r2,…}] | the generalized multiplicative order with residuesri |
| CarmichaelLambda[n] | the Carmichael function ![]() |
| PrimitiveRoot[n] | a primitive root ofn |
Themodular power functionPowerMod[a,b,n] gives exactly the same results asMod[a^b,n] forb>0.PowerMod is much more efficient, however, because it avoids generating the full form ofa^b.
You can usePowerMod not only to find positive modular powers, but also to findmodular inverses. For negativeb,PowerMod[a,b,n] gives, if possible, an integer
such that
. (Whenever such an integer exists, it is guaranteed to be unique modulon.) If no such integer
exists, the Wolfram Language leavesPowerMod unevaluated.
such that
. (Whenever such an integer exists, it is guaranteed to be unique modulon.) If no such integer
exists, the Wolfram Language leavesPowerMod unevaluated.Ifd does not have a square root modulon,PowerMod[d,n] will remain unevaluated andPowerModList will return an empty list:

There are
distinct Dirichlet characters for a given modulusk, as labeled by the indexj. Different conventions can give different orderings for the possible characters.
distinct Dirichlet characters for a given modulusk, as labeled by the indexj. Different conventions can give different orderings for the possible characters.DirichletCharacter works for very large numbers:
TheEuler totient function
gives the number of integers less than
that are relatively prime to
. An important relation (Fermat's little theorem) is that
for all
relatively prime to
.
gives the number of integers less than
that are relatively prime to
. An important relation (Fermat's little theorem) is that
for all
relatively prime to
.TheMöbius function
is defined to be
if
is a product of
distinct primes, and
if
contains a squared factor (other than 1). An important relation is the Möbius inversion formula, which states that if
for all
, then
, where the sums are over all positive integers
that divide
.
is defined to be
if
is a product of
distinct primes, and
if
contains a squared factor (other than 1). An important relation is the Möbius inversion formula, which states that if
for all
, then
, where the sums are over all positive integers
that divide
.Thedivisor function
is the sum of the
th powers of the divisors of
. The function
gives the total number of divisors of
, and is variously denoted
,
and
. The function
, equal to the sum of the divisors of
, is often denoted
.
is the sum of the
th powers of the divisors of
. The function
gives the total number of divisors of
, and is variously denoted
,
and
. The function
, equal to the sum of the divisors of
, is often denoted
.The functionDivisorSum[n,form] represents the sum ofform[i] for alli that dividen.DivisorSum[n,form,cond] includes only those divisors for whichcond[i] givesTrue.
TheJacobi symbolJacobiSymbol[n,m] reduces to theLegendre symbol
when
is an odd prime. The Legendre symbol is equal to zero if
is divisible by
; otherwise it is equal to
if
is a quadratic residue modulo the prime
, and to
if it is not. An integer
relatively prime to
is said to be a quadratic residue modulo
if there exists an integer
such that
. The full Jacobi symbol is a product of the Legendre symbols
for each of the prime factors
such that
.
when
is an odd prime. The Legendre symbol is equal to zero if
is divisible by
; otherwise it is equal to
if
is a quadratic residue modulo the prime
, and to
if it is not. An integer
relatively prime to
is said to be a quadratic residue modulo
if there exists an integer
such that
. The full Jacobi symbol is a product of the Legendre symbols
for each of the prime factors
such that
.Theextended GCDExtendedGCD[n1,n2,…] gives a list
where
is the greatest common divisor of the
, and the
are integers such that
. The extended GCD is important in finding integer solutions to linear Diophantine equations.
where
is the greatest common divisor of the
, and the
are integers such that
. The extended GCD is important in finding integer solutions to linear Diophantine equations.The multiplicative order functionMultiplicativeOrder[k,n] gives the smallest integer
such that
. Then
is known as the order of
modulo
. The notation
is occasionally used.
such that
. Then
is known as the order of
modulo
. The notation
is occasionally used.The generalized multiplicative order functionMultiplicativeOrder[k,n,{r1,r2,…}] gives the smallest integer
such that
for some
.MultiplicativeOrder[k,n,{-1,1}] is sometimes known as thesuborder function of
modulo
, denoted
.MultiplicativeOrder[k,n,{a}] is sometimes known as the discrete log of
with respect to the base
modulo
.
such that
for some
.MultiplicativeOrder[k,n,{-1,1}] is sometimes known as thesuborder function of
modulo
, denoted
.MultiplicativeOrder[k,n,{a}] is sometimes known as the discrete log of
with respect to the base
modulo
.TheCarmichael function orleast universal exponent
gives the smallest integer
such that
for all integers
relatively prime to
.
gives the smallest integer
such that
for all integers
relatively prime to
.| ContinuedFraction[x,n] | generate the firstn terms in the continued fraction representation ofx |
| FromContinuedFraction[list] | reconstruct a number from its continued fraction representation |
| Rationalize[x,dx] | find a rational approximation tox with tolerancedx |
Continued fractions appear in many number theoretic settings. Rational numbers have terminating continued fraction representations. Quadratic irrational numbers have continued fraction representations that become repetitive.
| ContinuedFraction[x] | the complete continued fraction representation for a rational or quadratic irrational number |
| QuadraticIrrationalQ[x] | test whetherx is a quadratic irrational |
| RealDigits[x] | the complete digit sequence for a rational number |
| RealDigits[x,b] | the complete digit sequence in baseb |
The continued fraction representation of
starts with the term 8, then involves a sequence of terms that repeat forever:
starts with the term 8, then involves a sequence of terms that repeat forever:FromDigits reconstructs the original number:
Continued fraction convergents are often used to approximate irrational numbers by rational ones. Those approximations alternate from above and below, and converge exponentially in the number of terms. Furthermore, a convergent
of a simple continued fraction is better than any other rational approximation with denominator less than or equal to
.
of a simple continued fraction is better than any other rational approximation with denominator less than or equal to
.| Convergents[x] | give a list of rational approximations ofx |
| Convergents[x,n] | give only the firstn approximations |
This gives a list of rational approximations of 101/9801, derived from its continued fraction expansion:
| LatticeReduce[{v1v2,…}] | a reduced lattice basis for the set of integer vectorsvi |
| HermiteDecomposition[{v1,v2,…}] | the echelon form for the set of integer vectorsvi |
The lattice reduction functionLatticeReduce[{v1,v2,…}] is used in several kinds of modern algorithms. The basic idea is to think of the vectors
of integers as defining a mathematicallattice. Any vector representing a point in the lattice can be written as a linear combination of the form
, where the
are integers. For a particular lattice, there are many possible choices of the "basis vectors"
. WhatLatticeReduce does is to find a reduced set of basis vectors
for the lattice, with certain special properties.
of integers as defining a mathematicallattice. Any vector representing a point in the lattice can be written as a linear combination of the form
, where the
are integers. For a particular lattice, there are many possible choices of the "basis vectors"
. WhatLatticeReduce does is to find a reduced set of basis vectors
for the lattice, with certain special properties.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.
For a matrix
,HermiteDecomposition gives matrices
and
such that
is unimodular,
, and
is in reduced row echelon form. In contrast toRowReduce, pivots may be larger than 1 because there are no fractions in the ring of integers. Entries above a pivot are minimized by subtracting appropriate multiples of the pivot row.
,HermiteDecomposition gives matrices
and
such that
is unimodular,
, and
is in reduced row echelon form. In contrast toRowReduce, pivots may be larger than 1 because there are no fractions in the ring of integers. Entries above a pivot are minimized by subtracting appropriate multiples of the pivot row.| DigitCount[n,b,d] | the number ofd digits in the baseb representation ofn |
| BitAnd[n1,n2,…] | bitwise AND of the integersni |
| BitOr[n1,n2,…] | bitwise OR of the integersni |
| BitXor[n1,n2,…] | bitwise XOR of the integersni |
| BitNot[n] | bitwise NOT of the integern |
| BitLength[n] | number of binary bits in the integern |
| BitSet[n,k] | set bitk to 1 in the integern |
| BitGet[n,k] | get bitk from the integern |
| BitClear[n,k] | set bitk to 0 in the integern |
| BitShiftLeft[n,k] | shift the integern to the left byk bits, padding with zeros |
| BitShiftRight[n,k] | shift to the right, dropping the lastk 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 theni have ones.BitOr[n1,n2,…] yields the integer with ones at positions where any of theni have ones.BitXor[n1,n2] yields the integer with ones at positions wheren1 orn2 but not both have ones.BitXor[n1,n2,…] has ones where an odd number of theni have ones.
Bitwise operations are used in various combinatorial algorithms. They are also commonly used in manipulating bitfields in low‐level 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 allowsBitNot[n] to be equivalent simply to
.
.| SquareFreeQ[n] |
SquareFreeQ[n] checks to see ifn has a square prime factor. This is done by computingMoebiusMu[n] and seeing if the result is zero; if it is, thenn is not squarefree, otherwise it is. ComputingMoebiusMu[n] involves finding the smallest prime factorq ofn. Ifn has a small prime factor (less than or equal to
), this is very fast. Otherwise,FactorInteger is used to findq.
), this is very fast. Otherwise,FactorInteger is used to findq.SquareFreeQ can handle large integers:
| NextPrime[n] | give the smallest prime larger thann |
| RandomPrime[{min,max}] | return a random prime number betweenmin andmax |
| RandomPrime[max] | return a random prime number less than or equal tomax |
| RandomPrime[{min,max},n] | returnn random prime numbers betweenmin andmax |
| RandomPrime[max,n] | returnn random prime numbers less than or equal tomax |
NextPrime[n] finds the smallest primep such thatp>n. The algorithm does a direct search usingPrimeQ on the odd numbers greater thann.
ForRandomPrime[{min,max}] andRandomPrime[max], a random primep is obtained by randomly selecting from a prime lookup table ifmax is small and by a random search of integers in the range ifmax is large. If no prime exists in the specified range, the input is returned unevaluated with an error message.
| PrimePowerQ[n] | determine whethern is a positive integer power of a rational prime |
The algorithm forPrimePowerQ involves first computing the least prime factorp ofn and then attempting division byp until either 1 is obtained, in which casen is a prime power, or until division is no longer possible, in which casen is not a prime power.
Over theGaussianIntegers this is a prime power:
| ChineseRemainder[list1,list2] | give the smallest non-negative integerr withMod[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 non‐negative integerr such thatMod[r,list2] islist1. The solution is unique modulo the least common multiple of the elements oflist2.
| PrimitiveRoot[n] | give a primitive root ofn, wheren is a prime power or twice a prime power |
PrimitiveRoot[n] returns a generator for the group of numbers relatively prime ton under multiplication
. This has a generator if and only ifn is 2, 4, a power of an odd prime, or twice a power of an odd prime. Ifn is a prime or prime power, the least positive primitive root will be returned.
. This has a generator if and only ifn is 2, 4, a power of an odd prime, or twice a power of an odd prime. Ifn is a prime or prime power, the least positive primitive root will be returned.If the argument is composite and not a prime power or twice a prime power, the function does not evaluate:
| SquaresR[d,n] | give the number of representations of an integern as a sum ofd squares |
| PowersRepresentations[n,k,p] | give the distinct representations of the integern as a sum ofk non-negativepth 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 |
Thefactorial function
gives the number of ways of ordering
objects. For non‐integer
, the numerical value of
is obtained from the gamma function, discussed in"Special Functions".
gives the number of ways of ordering
objects. For non‐integer
, the numerical value of
is obtained from the gamma function, discussed in"Special Functions".Thebinomial coefficientBinomial[n,m] can be written as
. It gives the number of ways of choosing
objects from a collection of
objects, without regard to order. TheCatalan numbers, which appear in various tree enumeration problems, are given in terms of binomial coefficients as
.
. It gives the number of ways of choosing
objects from a collection of
objects, without regard to order. TheCatalan numbers, which appear in various tree enumeration problems, are given in terms of binomial coefficients as
.ThesubfactorialSubfactorial[n] gives the number of permutations of
objects that leave no object fixed. Such a permutation is called a derangement. The subfactorial is given by
.
objects that leave no object fixed. Such a permutation is called a derangement. The subfactorial is given by
.Themultinomial coefficientMultinomial[n1,n2,…], denoted
, gives the number of ways of partitioning
distinct objects into
sets of sizes
(with
).
, gives the number of ways of partitioning
distinct objects into
sets of sizes
(with
).TheFibonacci numbersFibonacci[n] satisfy the recurrence relation
with
. They appear in a wide range of discrete mathematical problems. For large
,
approaches the golden ratio. TheLucas numbersLucasL[n] satisfy the same recurrence relation as the Fibonacci numbers do, but with initial conditions
and
.
with
. They appear in a wide range of discrete mathematical problems. For large
,
approaches the golden ratio. TheLucas numbersLucasL[n] satisfy the same recurrence relation as the Fibonacci numbers do, but with initial conditions
and
.Theharmonic numbersHarmonicNumber[n] are given by
; the harmonic numbers of order
HarmonicNumber[n,r] are given by
. Harmonic numbers appear in many combinatorial estimation problems, often playing the role of discrete analogs of logarithms.
; the harmonic numbers of order
HarmonicNumber[n,r] are given by
. Harmonic numbers appear in many combinatorial estimation problems, often playing the role of discrete analogs of logarithms.TheBernoulli polynomialsBernoulliB[n,x] satisfy the generating function relation
. TheBernoulli numbersBernoulliB[n] are given by
. The
appear as the coefficients of the terms in the Euler–Maclaurin summation formula for approximating integrals. The Bernoulli numbers are related to theGenocchi numbers by
.
. TheBernoulli numbersBernoulliB[n] are given by
. The
appear as the coefficients of the terms in the Euler–Maclaurin summation formula for approximating integrals. The Bernoulli numbers are related to theGenocchi numbers by
.Numerical values for Bernoulli numbers are needed in many numerical algorithms. You can always get these numerical values by first finding exact rational results usingBernoulliB[n], and then applyingN.
TheEuler polynomialsEulerE[n,x] have generating function
, and theEuler numbersEulerE[n] are given by
.
, and theEuler numbersEulerE[n] are given by
.TheNörlund polynomialsNorlundB[n,a] satisfy the generating function relation
. The Nörlund polynomials give the Bernoulli numbers when
. For other positive integer values of
, the Nörlund polynomials give higher-order Bernoulli numbers. Thegeneralized Bernoulli polynomialsNorlundB[n,a,x] satisfy the generating function relation
.
. The Nörlund polynomials give the Bernoulli numbers when
. For other positive integer values of
, the Nörlund polynomials give higher-order Bernoulli numbers. Thegeneralized Bernoulli polynomialsNorlundB[n,a,x] satisfy the generating function relation
.You can also get Bernoulli polynomials by explicitly computing the power series for the generating function:
Stirling numbers show up in many combinatorial enumeration problems. ForStirling numbers of the first kindStirlingS1[n,m],
gives the number of permutations of
elements which contain exactly
cycles. These Stirling numbers satisfy the generating function relation
. Note that some definitions of the
differ by a factor
from what is used in the Wolfram Language.
gives the number of permutations of
elements which contain exactly
cycles. These Stirling numbers satisfy the generating function relation
. Note that some definitions of the
differ by a factor
from what is used in the Wolfram Language.Stirling numbers of the second kindStirlingS2[n,m], sometimes denoted
, give the number of ways of partitioning a set of
elements into
non‐empty subsets. They satisfy the relation
.
, give the number of ways of partitioning a set of
elements into
non‐empty subsets. They satisfy the relation
.TheBell numbersBellB[n] give the total number of ways that a set of
elements can be partitioned into non‐empty subsets. TheBell polynomialsBellB[n,x] satisfy the generating function relation
.
elements can be partitioned into non‐empty subsets. TheBell polynomialsBellB[n,x] satisfy the generating function relation
.Thepartition functionPartitionsP[n] gives the number of ways of writing the integer
as a sum of positive integers, without regard to order.PartitionsQ[n] gives the number of ways of writing
as a sum of positive integers, with the constraint that all the integers in each sum are distinct.
as a sum of positive integers, without regard to order.PartitionsQ[n] gives the number of ways of writing
as a sum of positive integers, with the constraint that all the integers in each sum are distinct.The number of partitions is given byPartitionsP[4]:
This gives the number of partitions of 100, with and without the constraint that the terms should be distinct:
The partition function
increases asymptotically like
. Note that you cannot simply usePlot to generate a plot of a function likePartitionsP because the function can only be evaluated with integer arguments:
increases asymptotically like
. Note that you cannot simply usePlot to generate a plot of a function likePartitionsP because the function can only be evaluated with integer arguments:Most of the functions here allow you tocount various kinds of combinatorial objects. Functions likeIntegerPartitions andPermutations allow you instead togenerate lists of various combinations of elements.
Thesignature functionSignature[{i1,i2,…}] gives the signature of a permutation. It is equal to
for even permutations (composed of an even number of transpositions), and to
for odd permutations. The signature function can be thought of as a totally antisymmetric tensor,Levi‐Civita symbol orepsilon symbol.
for even permutations (composed of an even number of transpositions), and to
for odd permutations. The signature function can be thought of as a totally antisymmetric tensor,Levi‐Civita symbol orepsilon symbol.| ClebschGordan[{j1,m1},{j2,m2},{j,m}] | Clebsch–Gordan coefficient |
| ThreeJSymbol[{j1,m1},{j2,m2},{j3,m3}] | Wigner 3‐j symbol |
| SixJSymbol[{j1,j2,j3},{j4,j5,j6}] | Racah 6‐j symbol |
Clebsch–Gordan coefficients and
‐j symbols arise in the study of angular momenta in quantum mechanics, and in other applications of the rotation group. TheClebsch–Gordan coefficientsClebschGordan[{j1,m1},{j2,m2},{j,m}] give the coefficients in the expansion of the quantum mechanical angular momentum state
in terms of products of states
.
‐j symbols arise in the study of angular momenta in quantum mechanics, and in other applications of the rotation group. TheClebsch–Gordan coefficientsClebschGordan[{j1,m1},{j2,m2},{j,m}] give the coefficients in the expansion of the quantum mechanical angular momentum state
in terms of products of states
.The3‐j symbols orWigner coefficientsThreeJSymbol[{j1,m1},{j2,m2},{j3,m3}] are a more symmetrical form of Clebsch–Gordan coefficients. In the Wolfram Language, the Clebsch–Gordan coefficients are given in terms of 3‐j symbols by
.
.The6‐j symbolsSixJSymbol[{j1,j2,j3},{j4,j5,j6}] give the couplings of three quantum mechanical angular momentum states. TheRacah coefficients are related by a phase to the 6‐j 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 ![]() |
You can convert from degrees by explicitly multiplying by the constantDegree:
Thehaversine functionHaversine[z] is defined by
. Theinverse haversine functionInverseHaversine[z] is defined by
. TheGudermannian functionGudermannian[z] is defined as
. Theinverse Gudermannian functionInverseGudermannian[z] is defined by
. The Gudermannian satisfies such relations as
. Thesinc functionSinc[z] is the Fourier transform of a square signal.
. Theinverse haversine functionInverseHaversine[z] is defined by
. TheGudermannian functionGudermannian[z] is defined as
. Theinverse Gudermannian functionInverseGudermannian[z] is defined by
. The Gudermannian satisfies such relations as
. Thesinc functionSinc[z] is the Fourier transform of a square signal.There are a number of additional trigonometric and hyperbolic functions that are sometimes used. Theversine function is sometimes encountered in the literature and simply is
. Thecoversine function is defined as
. The complex exponential
is sometimes written as
.
. Thecoversine function is defined as
. The complex exponential
is sometimes written as
.When you ask for the square root
of a number
, you are effectively asking for the solution to the equation
. This equation, however, in general has two different solutions. Both
and
are, for example, solutions to the equation
. When you evaluate the "function"
, however, you usually want to get a single number, and so you have to choose one of these two solutions. A standard choice is that
should be positive for
. This is what the Wolfram Language functionSqrt[x] does.
of a number
, you are effectively asking for the solution to the equation
. This equation, however, in general has two different solutions. Both
and
are, for example, solutions to the equation
. When you evaluate the "function"
, however, you usually want to get a single number, and so you have to choose one of these two solutions. A standard choice is that
should be positive for
. This is what the Wolfram Language functionSqrt[x] does.The need to make one choice from two solutions means thatSqrt[x] cannot be a trueinverse function forx^2. Taking a number, squaring it, and then taking the square root can give you a different number than you started with.
When you evaluate
, there are again two possible answers:
and
. In this case, however, it is less clear which one to choose.
, there are again two possible answers:
and
. In this case, however, it is less clear which one to choose.There is in fact no way to choose
so that it is continuous for all complex values of
. There has to be a "branch cut"—a line in the complex plane across which the function
is discontinuous. The Wolfram Language adopts the usual convention of taking the branch cut for
to be along the negative real axis.
so that it is continuous for all complex values of
. There has to be a "branch cut"—a line in the complex plane across which the function
is discontinuous. The Wolfram Language adopts the usual convention of taking the branch cut for
to be along the negative real axis.The branch cut inSqrt along the negative real axis means that values ofSqrt[z] with
just above and below the axis are very different:
just above and below the axis are very different:The discontinuity along the negative real axis is quite clear in this three‐dimensional picture of the imaginary part of the square root function:
When you find an
th root using
, there are, in principle,
possible results. To get a single value, you have to choose a particularprincipal root. There is absolutely no guarantee that taking the
th root of an
th power will leave you with the same number.
th root using
, there are, in principle,
possible results. To get a single value, you have to choose a particularprincipal root. There is absolutely no guarantee that taking the
th root of an
th power will leave you with the same number.There are 10 possible tenth roots. The Wolfram Language chooses one of them. In this case it is not the number whose tenth power you took:
There are many mathematical functions which, like roots, essentially give solutions to equations. The logarithm function and the inverse trigonometric functions are examples. In almost all cases, there are many possible solutions to the equations. Unique "principal" values nevertheless have to be chosen for the functions. The choices cannot be made continuous over the whole complex plane. Instead, lines of discontinuity, or branch cuts, must occur. The positions of these branch cuts are often quite arbitrary. The Wolfram Language makes the most standard mathematical choices for them.
| Sqrt[z] and z^s | |
| 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] | ![]() |
ArcSin is a multiple‐valued function, so there is no guarantee that it always gives the "inverse" ofSin:
Values ofArcSin[z] on opposite sides of the branch cut can be very different:
| 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 ![]() |
Euler's constantEulerGamma is given by the limit
. It appears in many integrals, and asymptotic formulas. It is sometimes known as the Euler–Mascheroni constant, and denoted
.
. It appears in many integrals, and asymptotic formulas. It is sometimes known as the Euler–Mascheroni constant, and denoted
.Catalan's constantCatalan is given by the sum
. It often appears in asymptotic estimates of combinatorial functions. It is variously denoted by
,
, or
.
. It often appears in asymptotic estimates of combinatorial functions. It is variously denoted by
,
, or
.Khinchin's constantKhinchin (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.
. It gives the geometric mean of the terms in the continued fraction representation for a typical real number.Glaisher's constantGlaisher
(sometimes called the Glaisher–Kinkelin constant) satisfies
, where
is the Riemann zeta function. It appears in various sums and integrals, particularly those involving gamma and zeta functions.
(sometimes called the Glaisher–Kinkelin constant) satisfies
, where
is the Riemann zeta function. It appears in various sums and integrals, particularly those involving gamma and zeta functions.| 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 ![]() |
Legendre polynomialsLegendreP[n,x] arise in studies of systems with three‐dimensional spherical symmetry. They satisfy the differential equation
, and the orthogonality relation
for
.
, and the orthogonality relation
for
.Theassociated Legendre polynomialsLegendreP[n,m,x] are obtained from derivatives of the Legendre polynomials according to
. Notice that for odd integers
, the
contain powers of
, and are therefore not strictly polynomials. The
reduce to
when
.
. Notice that for odd integers
, the
contain powers of
, and are therefore not strictly polynomials. The
reduce to
when
.Thespherical harmonicsSphericalHarmonicY[l,m,θ,ϕ] are related to associated Legendre polynomials. They satisfy the orthogonality relation
for
or
, where
represents integration over the surface of the unit sphere.
for
or
, where
represents integration over the surface of the unit sphere."Special Functions" discusses the generalization of Legendre polynomials to Legendre functions, which can have noninteger degrees:
Gegenbauer polynomialsGegenbauerC[n,m,x] can be viewed as generalizations of the Legendre polynomials to systems with
‐dimensional spherical symmetry. They are sometimes known asultraspherical polynomials.
‐dimensional spherical symmetry. They are sometimes known asultraspherical polynomials.GegenbauerC[n,0,x] is always equal to zero.GegenbauerC[n,x] is however given by the limit
. This form is sometimes denoted
.
. This form is sometimes denoted
.Series of Chebyshev polynomials are often used in making numerical approximations to functions. TheChebyshev polynomials of the first kindChebyshevT[n,x] are defined by
. They are normalized so that
. They satisfy the orthogonality relation
for
. The
also satisfy an orthogonality relation under summation at discrete points in
corresponding to the roots of
.
. They are normalized so that
. They satisfy the orthogonality relation
for
. The
also satisfy an orthogonality relation under summation at discrete points in
corresponding to the roots of
.TheChebyshev polynomials of the second kindChebyshevU[n,z] are defined by
. With this definition,
. The
satisfy the orthogonality relation
for
.
. With this definition,
. The
satisfy the orthogonality relation
for
.The name "Chebyshev" is a transliteration from the Cyrillic alphabet; several other spellings, such as "Tschebyscheff", are sometimes used.
Hermite polynomialsHermiteH[n,x] arise as the quantum‐mechanical wave functions for a harmonic oscillator. They satisfy the differential equation
, and the orthogonality relation
for
. An alternative form of Hermite polynomials sometimes used is
(a different overall normalization of the
is also sometimes used).
, and the orthogonality relation
for
. An alternative form of Hermite polynomials sometimes used is
(a different overall normalization of the
is also sometimes used).This gives the density for an excited state of a quantum‐mechanical harmonic oscillator. The average of the wiggles is roughly the classical physics result:
Generalized Laguerre polynomialsLaguerreL[n,a,x] are related to hydrogen atom wave functions in quantum mechanics. They satisfy the differential equation
, and the orthogonality relation
for
. TheLaguerre polynomialsLaguerreL[n,x] correspond to the special case
.
, and the orthogonality relation
for
. TheLaguerre polynomialsLaguerreL[n,x] correspond to the special case
.Zernike radial polynomialsZernikeR[n,m,x] are used in studies of aberrations in optics. They satisfy the orthogonality relation
for
.
for
.Jacobi polynomialsJacobiP[n,a,b,x] occur in studies of the rotation group, particularly in quantum mechanics. They satisfy the orthogonality relation
for
. Legendre, Gegenbauer, Chebyshev and Zernike polynomials can all be viewed as special cases of Jacobi polynomials. The Jacobi polynomials are sometimes given in the alternative form
.
for
. Legendre, Gegenbauer, Chebyshev and Zernike polynomials can all be viewed as special cases of Jacobi polynomials. The Jacobi polynomials are sometimes given in the alternative form
.The Wolfram System includes all the common special functions of mathematical physics found in standard handbooks. Each of the various classes of functions is discussed in turn.
One point you should realize is that in the technical literature there are often several conflicting definitions of any particular special function. When you use a special function in the Wolfram System, therefore, you should be sure to look at the definition given here to confirm that it is exactly what you want.
You can useFindRoot to find roots of special functions:
Special functions in the Wolfram System can usually be evaluated for arbitrary complex values of their arguments. Often, however, the defining relations given in this tutorial apply only for some special choices of arguments. In these cases, the full function corresponds to a suitable extension or analytic continuation of these defining relations. Thus, for example, integral representations of functions are valid only when the integral exists, but the functions themselves can usually be defined elsewhere by analytic continuation.
As a simple example of how the domain of a function can be extended, consider the function represented by the sum
. This sum converges only when
. Nevertheless, it is easy to show analytically that for any
, the complete function is equal to
. Using this form, you can easily find a value of the function for any
, at least so long as
.
. This sum converges only when
. Nevertheless, it is easy to show analytically that for any
, the complete function is equal to
. Using this form, you can easily find a value of the function for any
, at least so long as
.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 ![]() |
TheEuler gamma functionGamma[z] is defined by the integral
. For positive integer
,
.
can be viewed as a generalization of the factorial function, valid for complex arguments
.
. For positive integer
,
.
can be viewed as a generalization of the factorial function, valid for complex arguments
.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 asLog[Gamma[z]]. For complex arguments, however, this form yields spurious discontinuities. The Wolfram System therefore includes the separate functionLogGamma[z], which yields thelogarithm of the gamma function with a single branch cut along the negative real axis.
ThePochhammer symbol orrising factorialPochhammer[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.
. 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.Theincomplete gamma functionGamma[a,z] is defined by the integral
. The Wolfram System includes a generalized incomplete gamma functionGamma[a,z0,z1] defined as
.
. The Wolfram System includes a generalized incomplete gamma functionGamma[a,z0,z1] defined as
.The alternative incomplete gamma function
can therefore be obtained in the Wolfram System asGamma[a,0,z].
can therefore be obtained in the Wolfram System asGamma[a,0,z].Theincomplete beta functionBeta[z,a,b] is given by
. Notice that in the incomplete beta function, the parameter
is anupper limit of integration, and appears as thefirst argument of the function. In the incomplete gamma function, on the other hand,
is alower limit of integration, and appears as thesecond argument of the function.
. Notice that in the incomplete beta function, the parameter
is anupper limit of integration, and appears as thefirst argument of the function. In the incomplete gamma function, on the other hand,
is alower limit of integration, and appears as thesecond argument of the function.In certain cases, it is convenient not to compute the incomplete beta and gamma functions on their own, but instead to computeregularized forms in which these functions are divided by complete beta and gamma functions. The Wolfram System includes theregularized incomplete beta functionBetaRegularized[z,a,b] defined for most arguments by
, but taking into account singular cases. The Wolfram System also includes theregularized incomplete gamma functionGammaRegularized[a,z] defined by
, with singular cases taken into account.
, but taking into account singular cases. The Wolfram System also includes theregularized incomplete gamma functionGammaRegularized[a,z] defined by
, with singular cases taken into account.The incomplete beta and gamma functions, and their inverses, are common in statistics. Theinverse beta functionInverseBetaRegularized[s,a,b] is the solution for
in
. Theinverse gamma functionInverseGammaRegularized[a,s] is similarly the solution for
in
.
in
. Theinverse gamma functionInverseGammaRegularized[a,s] is similarly the solution for
in
.Derivatives of the gamma function often appear in summing rational series. Thedigamma functionPolyGamma[z] is the logarithmic derivative of the gamma function, given by
. For integer arguments, the digamma function satisfies the relation
, where
is Euler's constant (EulerGamma in the Wolfram System) and
are the harmonic numbers.
. For integer arguments, the digamma function satisfies the relation
, where
is Euler's constant (EulerGamma in the Wolfram System) and
are the harmonic numbers.Thepolygamma functionsPolyGamma[n,z] are given by
. Notice that the digamma function corresponds to
. The general form
is the
th, not the
th, logarithmic derivative of the gamma function. The polygamma functions satisfy the relation
.PolyGamma[ν,z] is defined for arbitrary complex
by fractional calculus analytic continuation.
. Notice that the digamma function corresponds to
. The general form
is the
th, not the
th, logarithmic derivative of the gamma function. The polygamma functions satisfy the relation
.PolyGamma[ν,z] is defined for arbitrary complex
by fractional calculus analytic continuation.BarnesG[z] is a generalization of theGamma function and is defined by its functional identityBarnesG[z+1]=Gamma[z]BarnesG[z], where the third derivative of the logarithm ofBarnesG is positive for positivez.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 thatExp[LogBarnesG[z]]=BarnesG[z].
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] | Riemann–Siegel function ![]() |
| RiemannSiegelZ[t] | Riemann–Siegel 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] | Hurwitz–Lerch transcendent ![]() |
The Dirichlet-L functionDirichletL[k,j,s] is implemented as
(for
) where
is a Dirichlet character with modulus
and index
.
(for
) where
is a Dirichlet character with modulus
and index
.TheRiemann zeta functionZeta[s] is defined by the relation
(for
). Zeta functions with integer arguments arise in evaluating various sums and integrals. The Wolfram System gives exact results when possible for zeta functions with integer arguments.
(for
). Zeta functions with integer arguments arise in evaluating various sums and integrals. The Wolfram System gives exact results when possible for zeta functions with integer arguments.There is an analytic continuation of
for arbitrary complex
. The zeta function for complex arguments is central to number theoretic studies of the distribution of primes. Of particular importance are the values on the critical line
.
for arbitrary complex
. The zeta function for complex arguments is central to number theoretic studies of the distribution of primes. Of particular importance are the values on the critical line
.In studying
, it is often convenient to define the twoRiemann–Siegel functionsRiemannSiegelZ[t] andRiemannSiegelTheta[t] according to
and
(for
real). Note that the Riemann–Siegel functions are both real as long as
is real.
, it is often convenient to define the twoRiemann–Siegel functionsRiemannSiegelZ[t] andRiemannSiegelTheta[t] according to
and
(for
real). Note that the Riemann–Siegel functions are both real as long as
is real.TheStieltjes constantsStieltjesGamma[n] are generalizations of Euler's constant that appear in the series expansion of
around its pole at
; the coefficient of
is
. Euler's constant is
.
around its pole at
; the coefficient of
is
. Euler's constant is
.The Ramanujan
Dirichlet L-functionRamanujanTauL[s] is defined byL(s)
(for
), with coefficientsRamanujanTau[n]. In analogy with theRiemann zeta function, it is again convenient to define the functionsRamanujanTauZ[t] andRamanujanTauTheta[t].
Dirichlet L-functionRamanujanTauL[s] is defined byL(s)
(for
), with coefficientsRamanujanTau[n]. In analogy with theRiemann zeta function, it is again convenient to define the functionsRamanujanTauZ[t] andRamanujanTauTheta[t].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:
. You can see the first few zeros of the zeta function:Thepolylogarithm functionsPolyLog[n,z] are given by
. The polylogarithm function is sometimes known asJonquière's function. ThedilogarithmPolyLog[2,z] satisfies
. Sometimes
is known asSpence's integral. TheNielsen generalized polylogarithm functions orhyperlogarithmsPolyLog[n,p,z] are given by
. Polylogarithm functions appear in Feynman diagram integrals in elementary particle physics, as well as in algebraic K‐theory.
. The polylogarithm function is sometimes known asJonquière's function. ThedilogarithmPolyLog[2,z] satisfies
. Sometimes
is known asSpence's integral. TheNielsen generalized polylogarithm functions orhyperlogarithmsPolyLog[n,p,z] are given by
. Polylogarithm functions appear in Feynman diagram integrals in elementary particle physics, as well as in algebraic K‐theory.TheLerch transcendentLerchPhi[z,s,a] is a generalization of the zeta and polylogarithm functions, given by
, where any term with
is excluded. Many sums of reciprocal powers can be expressed in terms of the Lerch transcendent. For example, theCatalan beta function
can be obtained as
.
, where any term with
is excluded. Many sums of reciprocal powers can be expressed in terms of the Lerch transcendent. For example, theCatalan beta function
can be obtained as
.The Lerch transcendent is related to integrals of theFermi–Dirac distribution in statistical mechanics by
.
.The Lerch transcendent can also be used to evaluateDirichlet L‐series that appear in number theory. The basicL‐series has the form
, where the "character"
is an integer function with period
.L‐series of this kind can be written as sums of Lerch functions with
a power of
.
, where the "character"
is an integer function with period
.L‐series of this kind can be written as sums of Lerch functions with
a power of
.| ZetaZero[k] | the th zero of the zeta function on the critical line |
| ZetaZero[k,x0] | the th zero above height![]() |
Exponential Integral and Related Functions
| CosIntegral[z] | cosine integral function ![]() |
| CoshIntegral[z] | hyperbolic cosine integral function ![]() |
| ExpIntegralE[n,z] | exponential integralEn(z) |
| ExpIntegralEi[z] | exponential integral ![]() |
| LogIntegral[z] | logarithmic integral ![]() |
| SinIntegral[z] | sine integral function ![]() |
| SinhIntegral[z] | hyperbolic sine integral function ![]() |
The secondexponential integral functionExpIntegralEi[z] is defined by
(for
), where the principal value of the integral is taken.
(for
), where the principal value of the integral is taken.Thelogarithmic integral functionLogIntegral[z] is given by
(for
), where the principal value of the integral is taken.
is central to the study of the distribution of primes in number theory. The logarithmic integral function is sometimes also denoted by
. In some number theoretic applications,
is defined as
, with no principal value taken. This differs from the definition used in the Wolfram System by the constant
.
(for
), where the principal value of the integral is taken.
is central to the study of the distribution of primes in number theory. The logarithmic integral function is sometimes also denoted by
. In some number theoretic applications,
is defined as
, with no principal value taken. This differs from the definition used in the Wolfram System by the constant
.Thesine and cosine integral functionsSinIntegral[z] andCosIntegral[z] are defined by
and
. Thehyperbolic sine and cosine integral functionsSinhIntegral[z] andCoshIntegral[z] are defined by
and
.
and
. Thehyperbolic sine and cosine integral functionsSinhIntegral[z] andCoshIntegral[z] are defined by
and
.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 integralC(z) |
| FresnelS[z] | Fresnel integral ![]() |
| InverseErf[s] | inverse error function |
| InverseErfc[s] | inverse complementary error function |
Theerror functionErf[z] is the integral of the Gaussian distribution, given by
. Thecomplementary error functionErfc[z] is given simply by
. Theimaginary error functionErfi[z] is given by
. The generalized error functionErf[z0,z1] is defined by the integral
. The error function is central to many calculations in statistics.
. Thecomplementary error functionErfc[z] is given simply by
. Theimaginary error functionErfi[z] is given by
. The generalized error functionErf[z0,z1] is defined by the integral
. The error function is central to many calculations in statistics.Theinverse error functionInverseErf[s] is defined as the solution for
in the equation
. The inverse error function appears in computing confidence intervals in statistics as well as in some algorithms for generating Gaussian random numbers.
in the equation
. The inverse error function appears in computing confidence intervals in statistics as well as in some algorithms for generating Gaussian random numbers.Closely related to the error function are theFresnel integralsFresnelC[z] defined by
andFresnelS[z] defined by
. Fresnel integrals occur in diffraction theory.
andFresnelS[z] defined by
. Fresnel integrals occur in diffraction theory.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![]() |
TheBessel functionsBesselJ[n,z] andBesselY[n,z] are linearly independent solutions to the differential equation
. For integer
, the
are regular at
, while the
have a logarithmic divergence at
.
. For integer
, the
are regular at
, while the
have a logarithmic divergence at
.
is often called theBessel function of the first kind, or simplythe Bessel function.
is referred to as theBessel function of the second kind, theWeber function, or theNeumann function (denoted
).TheHankel functions (orBessel functions of the third kind)HankelH1[n,z] andHankelH2[n,z] give an alternative pair of solutions to the Bessel differential equation, related according to
.
.Thespherical Bessel functionsSphericalBesselJ[n,z] andSphericalBesselY[n,z], as well as thespherical Hankel functionsSphericalHankelH1[n,z] andSphericalHankelH2[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 usingFunctionExpand.
, where
and
can be
and
,
and
, or
and
. For integer
, spherical Bessel functions can be expanded in terms of elementary functions by usingFunctionExpand.Themodified Bessel functionsBesselI[n,z] andBesselK[n,z] are solutions to the differential equation
. For integer
,
is regular at
;
always has a logarithmic divergence at
. The
are sometimes known ashyperbolic Bessel functions.
. For integer
,
is regular at
;
always has a logarithmic divergence at
. The
are sometimes known ashyperbolic Bessel functions.Particularly in electrical engineering, one often defines theKelvin functionsKelvinBer[n,z],KelvinBei[n,z],KelvinKer[n,z] andKelvinKei[n,z]. These are related to the ordinary Bessel functions by
,
.
,
.TheAiry functionsAiryAi[z] andAiryBi[z] are the two independent solutions
and
to the differential equation
.
tends to zero for large positive
, while
increases unboundedly. The Airy functions are related to modified Bessel functions with one‐third‐integer orders. The Airy functions often appear as the solutions to boundary value problems in electromagnetic theory and quantum mechanics. In many cases thederivatives of the Airy functionsAiryAiPrime[z] andAiryBiPrime[z] also appear.
and
to the differential equation
.
tends to zero for large positive
, while
increases unboundedly. The Airy functions are related to modified Bessel functions with one‐third‐integer orders. The Airy functions often appear as the solutions to boundary value problems in electromagnetic theory and quantum mechanics. In many cases thederivatives of the Airy functionsAiryAiPrime[z] andAiryBiPrime[z] also appear.TheStruve functionStruveH[n,z] appears in the solution of the inhomogeneous Bessel equation, which for integer
has the form
; the general solution to this equation consists of a linear combination of Bessel functions with the Struve function
added. Themodified Struve functionStruveL[n,z] is given in terms of the ordinary Struve function by
. Struve functions appear particularly in electromagnetic theory.
has the form
; the general solution to this equation consists of a linear combination of Bessel functions with the Struve function
added. Themodified Struve functionStruveL[n,z] is given in terms of the ordinary Struve function by
. Struve functions appear particularly in electromagnetic theory.Here is a plot of
. This is a curve that an idealized chain hanging from one end can form when you wiggle it:
. This is a curve that an idealized chain hanging from one end can form when you wiggle it:The Airy function plotted here gives the quantum‐mechanical 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 ![]() |
TheLegendre functions andassociated Legendre functions satisfy the differential equation
. TheLegendre functions of the first kind,LegendreP[n,z] andLegendreP[n,m,z], reduce to Legendre polynomials when
and
are integers. TheLegendre functions of the second kindLegendreQ[n,z] andLegendreQ[n,m,z] give the second linearly independent solution to the differential equation. For integer
they have logarithmic singularities at
. The
and
solve the differential equation with
.
. TheLegendre functions of the first kind,LegendreP[n,z] andLegendreP[n,m,z], reduce to Legendre polynomials when
and
are integers. TheLegendre functions of the second kindLegendreQ[n,z] andLegendreQ[n,m,z] give the second linearly independent solution to the differential equation. For integer
they have logarithmic singularities at
. The
and
solve the differential equation with
.| 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 forLegendreQ.
Legendre functions of type 1 andLegendre functions of type 2 have different symbolic forms, but the same numerical values. They have branch cuts from
to
and from
to
.Legendre functions of type 3, sometimes denoted
and
, have a single branch cut from
to
.
to
and from
to
.Legendre functions of type 3, sometimes denoted
and
, have a single branch cut from
to
.Toroidal functions orring functions, which arise in studying systems with toroidal symmetry, can be expressed in terms of the Legendre functions
and
.
and
.When you use the functionLegendreP[n,x] with an integer
, you get a Legendre polynomial. If you take
to be an arbitrary complex number, you get, in general, a Legendre function.
, you get a Legendre polynomial. If you take
to be an arbitrary complex number, you get, in general, a Legendre function.In the same way, you can use the functionsGegenbauerC and so on with arbitrary complex indices to getGegenbauer functions,Chebyshev functions,Hermite functions,Jacobi functions andLaguerre 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 ![]() |
| CoulombF[l,η,ρ] | regular Coulomb wavefunction ![]() |
| CoulombG[l,η,ρ] | irregular Coulomb wavefunction ![]() |
Many of the special functions that have been discussed so far can be viewed as special cases of theconfluent hypergeometric functionHypergeometric1F1[a,b,z].
The confluent hypergeometric function can be obtained from the series expansion
. Some special results are obtained when
and
are both integers. If
, and either
or
, the series yields a polynomial with a finite number of terms.
. Some special results are obtained when
and
are both integers. If
, and either
or
, the series yields a polynomial with a finite number of terms.If
is zero or a negative integer, then
itself is infinite. But theregularized confluent hypergeometric functionHypergeometric1F1Regularized[a,b,z] given by
has a finite value in all cases.
is zero or a negative integer, then
itself is infinite. But theregularized confluent hypergeometric functionHypergeometric1F1Regularized[a,b,z] given by
has a finite value in all cases.Among the functions that can be obtained from
are the Bessel functions, error function, incomplete gamma function, and Hermite and Laguerre polynomials.
are the Bessel functions, error function, incomplete gamma function, and Hermite and Laguerre polynomials.The
confluent hypergeometric function is a solution to Kummer's differential equation
, with the boundary conditions
and
.
confluent hypergeometric function is a solution to Kummer's differential equation
, with the boundary conditions
and
.The functionHypergeometricU[a,b,z] gives a second linearly independent solution to Kummer's equation. For
this function behaves like
for small
. It has a branch cut along the negative real axis in the complex
plane.
this function behaves like
for small
. It has a branch cut along the negative real axis in the complex
plane.TheWhittaker functionsWhittakerM[k,m,z] andWhittakerW[k,m,z] give a pair of solutions to the normalized Kummer differential equation, known as Whittaker's differential equation. The Whittaker function
is related to
by
. The second Whittaker function
obeys the same relation, with
replaced by
.
is related to
by
. The second Whittaker function
obeys the same relation, with
replaced by
.TheCoulomb wavefunctionsCoulombF[l,η,ρ] andCoulombG[l,η,ρ] are also special cases of the confluent hypergeometric function. Coulomb wavefunctions give solutions to the radial Schrödinger equation in the Coulomb potential of a point nucleus. The regular Coulomb wavefunction is given by
, where
. The irregular Coulomb wavefunction
is given by a similar expression, with
replaced by
.
, where
. The irregular Coulomb wavefunction
is given by a similar expression, with
replaced by
.Theoutgoing and incoming irregular Coulomb wavefunctionsCoulombH1[l,η,ρ] andCoulombH2[l,η,ρ] are a linear combination of the regular and irregular Coulomb wavefunctions, related according to
.
.Other special cases of the confluent hypergeometric function include theToronto functions
,Poisson–Charlier polynomials
,Cunningham functions
, andBateman functions
.
,Poisson–Charlier polynomials
,Cunningham functions
, andBateman functions
.A limiting form of the confluent hypergeometric function that often appears isHypergeometric0F1[a,z]. This function is obtained as the limit
.
.| 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 ![]() |
Thehypergeometric functionHypergeometric2F1[a,b,c,z] has series expansion
. The function is a solution of the hypergeometric differential equation
.
. The function is a solution of the hypergeometric differential equation
.The hypergeometric function is also sometimes denoted by
, and is known as theGauss series or theKummer series.
, and is known as theGauss series or theKummer 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.
function.TheRiemann P function, which gives solutions to Riemann's differential equation, is also a
function.
function.Thegeneralized hypergeometric function orBarnes extended hypergeometric functionHypergeometricPFQ[{a1,…,ap},{b1,…,bq},z] has series expansion
.
.TheMeijer G-functionMeijerG[{{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.

, 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.TheAppell hypergeometric function of two variablesAppellF1[a,b1,b2,c,x,y] has series expansion
. This function appears for example in integrating cubic polynomials to arbitrary powers.
. This function appears for example in integrating cubic polynomials to arbitrary powers.Theq-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 | |
The
-Pochhammer symbol is a natural object in the calculus of
-differences, playing the same role as the power function in infinitesimal calculus or the falling factorial in the calculus of finite differences.
-Pochhammer symbol is a natural object in the calculus of
-differences, playing the same role as the power function in infinitesimal calculus or the falling factorial in the calculus of finite differences.The finite
-Pochhammer symbol
is defined as the product
. The limit
defines the
-Pochhammer symbol
when
<1. The
-Pochhammer symbol
is the
-analog of the Pochhammer
symbol, which is recovered in the limit

/(1-q)n.
-Pochhammer symbol
is defined as the product
. The limit
defines the
-Pochhammer symbol
when
<1. The
-Pochhammer symbol
is the
-analog of the Pochhammer
symbol, which is recovered in the limit

/(1-q)n.The
-factorial
is defined as
/(1-q)z and is a
-analog of the factorial function, which is recovered as
. The relationship
between the
-factorial and the
-gamma functions has the same functional form as the relationshipz!
between the factorial and the Euler gamma function.
-factorial
is defined as
/(1-q)z and is a
-analog of the factorial function, which is recovered as
. The relationship
between the
-factorial and the
-gamma functions has the same functional form as the relationshipz!
between the factorial and the Euler gamma function.The
-digamma function is defined as the logarithmic derivative of the
-gamma function

. The
-polygamma function
of order
is defined as the
th derivative with respect to
of the
-digamma function.
-digamma function is defined as the logarithmic derivative of the
-gamma function

. The
-polygamma function
of order
is defined as the
th derivative with respect to
of the
-digamma function.The basic hypergeometric series is a
-analog of the generalized hypergeometric series. It was introduced by Heine as a
-analog of Gauss hypergeometric series and arises in combinatorics.
-analog of the generalized hypergeometric series. It was introduced by Heine as a
-analog of Gauss hypergeometric series and arises in combinatorics.The Product Log Function
| ProductLog[z] | product log function ![]() |
Theproduct log function gives the solution for
in
. The function can be viewed as a generalization of a logarithm. It can be used to represent solutions to a variety of transcendental equations. Thetree generating function for counting distinct oriented trees is related to the product log by
.
in
. The function can be viewed as a generalization of a logarithm. It can be used to represent solutions to a variety of transcendental equations. Thetree generating function for counting distinct oriented trees is related to the product log by
.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 degreen and orderm |
Theradial spheroidal functionsSpheroidalS1[n,m,γ,z] andSpheroidalS2[n,m,γ,z] andangular spheroidal functionsSpheroidalPS[n,m,γ,z] andSpheroidalQS[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 aspheroidal eigenvalue given bySpheroidalEigenvalue[n,m,γ]. The spheroidal functions also appear as eigenfunctions of finite analogs of Fourier transforms.
. This equation has normalizable solutions only when
is aspheroidal eigenvalue given bySpheroidalEigenvalue[n,m,γ]. The spheroidal functions also appear as eigenfunctions of finite analogs of Fourier transforms.SpheroidalS1 andSpheroidalS2 are effectively spheroidal analogs of the spherical Bessel functions
and
, whileSpheroidalPS andSpheroidalQS are effectively spheroidal analogs of the Legendre functions
and
.
corresponds to aprolate spheroidal geometry, while
corresponds to anoblate spheroidalgeometry.
and
, whileSpheroidalPS andSpheroidalQS are effectively spheroidal analogs of the Legendre functions
and
.
corresponds to aprolate spheroidal geometry, while
corresponds to anoblate spheroidalgeometry.Many different normalizations for spheroidal functions are used in the literature. The Wolfram Systemuses the Meixner–Schäfke normalization scheme.
Even more so than for other special functions, you need to be very careful about the arguments you give to elliptic integrals and elliptic functions. There are several incompatible conventions in common use, and often these conventions are distinguished only by the specific names given to arguments or by the presence of separators other than commas between arguments.
■ Amplitude (used bythe Wolfram Language, in radians) |
■ Argument (used bythe Wolfram Language): related to amplitude by![]() |
■ Delta amplitude :![]() |
■ Coordinate :![]() |
■ Characteristic (used bythe Wolfram Language in elliptic integrals of the third kind) |
■ Parameter (used bythe 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 bythe Wolfram Language) |
■ Half‐periods , : , , where![]() |
■ Ratio of periods :![]() |
■ Discriminant :![]() |
■ Parameters of curve , (used bythe Wolfram Language) |
■ Coordinate (used bythe Wolfram Language): related by![]() |
| JacobiAmplitude[u,m] | give the amplitudeϕ corresponding to argumentu and parameterm |
| EllipticNomeQ[m] | give the nomeq corresponding to parameterm |
| InverseEllipticNomeQ[q] | give the parameterm corresponding to nomeq |
| WeierstrassInvariants[{ω,ω′}] | give the invariants{g2,g3} corresponding to the half‐periods{ω,ω′} |
| WeierstrassHalfPeriods[{g2,g3}] | give the half‐periods{ω,ω′} 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 kindE(m) |
| EllipticE[ϕ,m] | elliptic integral of the second kindE(ϕ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 ![]() |
Integrals of the form
, where
is a rational function, and
is a cubic or quartic polynomial in
, are known aselliptic integrals. Any elliptic integral can be expressed in terms of the three standard kinds ofLegendre–Jacobi elliptic integrals.
, where
is a rational function, and
is a cubic or quartic polynomial in
, are known aselliptic integrals. Any elliptic integral can be expressed in terms of the three standard kinds ofLegendre–Jacobi elliptic integrals.Theelliptic integral of the first kindEllipticF[ϕ,m] is given for
by
. This elliptic integral arises in solving the equations of motion for a simple pendulum. It is sometimes known as anincomplete elliptic integral of the first kind.
by
. This elliptic integral arises in solving the equations of motion for a simple pendulum. It is sometimes known as anincomplete elliptic integral of the first kind.Note that the arguments of the elliptic integrals are sometimes given in the opposite order from what is used in the Wolfram Language.
Thecomplete elliptic integral of the first kindEllipticK[m] is given by
. Note that
is used to denote thecomplete elliptic integral of the first kind, while
is used for its incomplete form. In many applications, the parameter
is not given explicitly, and
is denoted simply by
. Thecomplementary complete elliptic integral of the first kind
is given by
. It is often denoted
.
and
give the "real" and "imaginary" quarter‐periods of the corresponding Jacobi elliptic functions discussed in "Elliptic Functions".
. Note that
is used to denote thecomplete elliptic integral of the first kind, while
is used for its incomplete form. In many applications, the parameter
is not given explicitly, and
is denoted simply by
. Thecomplementary complete elliptic integral of the first kind
is given by
. It is often denoted
.
and
give the "real" and "imaginary" quarter‐periods of the corresponding Jacobi elliptic functions discussed in "Elliptic Functions".Thecomplete elliptic integral of the second kindEllipticE[m] is given by
. It is often denoted
. The complementary form is
.
. It is often denoted
. The complementary form is
.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 ![]() |
Rational functions involving square roots of quadratic forms can be integrated in terms of inverse trigonometric functions. The trigonometric functions can thus be defined as inverses of the functions obtained from these integrals.
By analogy,elliptic functions are defined as inverses of the functions obtained from elliptic integrals.
Theamplitude for Jacobi elliptic functionsJacobiAmplitude[u,m] is the inverse of the elliptic integral of the first kind. If
, then
. In working with Jacobi elliptic functions, the argument
is often dropped, so
is written as
.
, then
. In working with Jacobi elliptic functions, the argument
is often dropped, so
is written as
.TheJacobi elliptic functionsJacobiSN[u,m] andJacobiCN[u,m] are given respectively by
and
, where
. In addition,JacobiDN[u,m] is given by
.
and
, where
. In addition,JacobiDN[u,m] is given by
.There are a total of twelve Jacobi elliptic functionsJacobiPQ[u,m], with the lettersP andQ chosen from the setS,C,D andN. Each Jacobi elliptic functionJacobiPQ[u,m] satisfies the relation
, where for these purposes
.
, where for these purposes
.There are many relations between the Jacobi elliptic functions, somewhat analogous to those between trigonometric functions. In limiting cases, in fact, the Jacobi elliptic functions reduce to trigonometric functions. So, for example,
,
,
,
,
and
.
,
,
,
,
and
.The notation
is often used for the integrals
. These integrals can be expressed in terms of the Jacobi zeta function defined in "Elliptic Integrals".
is often used for the integrals
. These integrals can be expressed in terms of the Jacobi zeta function defined in "Elliptic Integrals".One of the most important properties of elliptic functions is that they aredoubly periodic in the complex values of their arguments. Ordinary trigonometric functions are singly periodic, in the sense that
for any integer
. The elliptic functions are doubly periodic, so that
for any pair of integers
and
.
for any integer
. The elliptic functions are doubly periodic, so that
for any pair of integers
and
.The Jacobi elliptic functions
, etc. are doubly periodic in the complex
plane. Their periods include
and
, where
is the complete elliptic integral of the first kind.
, etc. are doubly periodic in the complex
plane. Their periods include
and
, where
is the complete elliptic integral of the first kind.The choice of "p" and "q" in the notation
for Jacobi elliptic functions can be understood in terms of the values of the functions at the quarter periods
and
.
for Jacobi elliptic functions can be understood in terms of the values of the functions at the quarter periods
and
.This shows two complete periods in each direction of the absolute value of the Jacobi elliptic function
:
:Also built into the Wolfram Language are theinverse Jacobi elliptic functionsInverseJacobiSN[v,m],InverseJacobiCN[v,m], etc. The inverse function
, for example, gives the value of
for which
. The inverse Jacobi elliptic functions are related to elliptic integrals.
, for example, gives the value of
for which
. The inverse Jacobi elliptic functions are related to elliptic integrals.The fourtheta functions
are obtained fromEllipticTheta[a,u,q] by takinga to be1,2,3, or4. 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 diffusion‐like differential equation
.
are obtained fromEllipticTheta[a,u,q] by takinga to be1,2,3, or4. 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 diffusion‐like differential equation
.The Siegel theta functionSiegelTheta[τ,s] with Riemann square modular matrix
of dimensionp and vectors generalizes the elliptic theta functions to complex dimensionp. It is defined by
, wheren runs over allp-dimensional integer vectors. The Siegel theta function with characteristicSiegelTheta[ν,τ,s] is defined by
, where the characteristicν is a pair ofp-dimensional vectors{α,β}.
of dimensionp and vectors generalizes the elliptic theta functions to complex dimensionp. It is defined by
, wheren runs over allp-dimensional integer vectors. The Siegel theta function with characteristicSiegelTheta[ν,τ,s] is defined by
, where the characteristicν is a pair ofp-dimensional vectors{α,β}.TheNeville theta functions can be defined in terms of the theta functions as
,
,
,
, where
. The Jacobi elliptic functions can be represented as ratios of the Neville theta functions.

,
,
,
, where
. The Jacobi elliptic functions can be represented as ratios of the Neville theta functions.TheWeierstrass elliptic functionWeierstrassP[u,{g2,g3}] can be considered as the inverse of an elliptic integral. The Weierstrass function
gives the value of
for which
. The functionWeierstrassPPrime[u,{g2,g3}] is given by
.
gives the value of
for which
. The functionWeierstrassPPrime[u,{g2,g3}] is given by
.The Weierstrass functions are also sometimes written in terms of theirfundamental half‐periods
and
, obtained from the invariants
and
usingWeierstrassHalfPeriods[{u,{g2,g3}].
and
, obtained from the invariants
and
usingWeierstrassHalfPeriods[{u,{g2,g3}].The functionInverseWeierstrassP[p,{g2,g3}] finds one of the two values of
for which
. This value always lies in the parallelogram defined by the complex number half‐periods
and
.
for which
. This value always lies in the parallelogram defined by the complex number half‐periods
and
.InverseWeierstrassP[{p,q},{g2,g3}] finds the unique value of
for which
and
. In order for any such value of
to exist,
and
must be related by
.
for which
and
. In order for any such value of
to exist,
and
must be related by
.TheWeierstrass zeta functionWeierstrassZeta[u,{g2,g3}] andWeierstrass sigma functionWeierstrassSigma[u,{g2,g3}] are related to the Weierstrass elliptic functions by
and
.
and
.The Weierstrass zeta and sigma functions are not strictly elliptic functions since they are not periodic.
Elliptic Modular Functions
| DedekindEta[τ] | Dedekind eta function ![]() |
| KleinInvariantJ[τ] | Klein invariant modular function ![]() |
| ModularLambda[τ] | modular lambda function ![]() |
Themodular lambda functionModularLambda[τ] relates the ratio of half‐periods
to the parameter according to
.
to the parameter according to
.TheKlein invariant modular functionKleinInvariantJ[τ] and theDedekind eta functionDedekindEta[τ] satisfy the relations
.
.Modular elliptic functions are defined to be invariant under certain fractional linear transformations of their arguments. Thus for example
is invariant under any combination of the transformations
and
.
is invariant under any combination of the transformations
and
.Generalized Elliptic Integrals and Functions
| ArithmeticGeometricMean[a,b] | the arithmetic‐geometric 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 definitions for elliptic integrals and functions given above are based on traditional usage. For modern algebraic geometry, it is convenient to use slightly more general definitions.
The functionEllipticLog[{x,y},{a,b}] is defined as the value of the integral
, where the sign of the square root is specified by giving the value of
such that
. Integrals of the form
can be expressed in terms of the ordinary logarithm (and inverse trigonometric functions). You can think ofEllipticLog as giving a generalization of this, where the polynomial under the square root is now of degree three.
, where the sign of the square root is specified by giving the value of
such that
. Integrals of the form
can be expressed in terms of the ordinary logarithm (and inverse trigonometric functions). You can think ofEllipticLog as giving a generalization of this, where the polynomial under the square root is now of degree three.The functionEllipticExp[u,{a,b}] is the inverse ofEllipticLog. It returns the list{x,y} that appears inEllipticLog.EllipticExp is an elliptic function, doubly periodic in the complex
plane.
plane.ArithmeticGeometricMean[a,b] gives thearithmetic‐geometric mean (AGM) of two numbers
and
. This quantity is central to many numerical algorithms for computing elliptic integrals and other functions. For positive reals
and
the AGM is obtained by starting with
,
, then iterating the transformation
,
until
to the precision required.
and
. This quantity is central to many numerical algorithms for computing elliptic integrals and other functions. For positive reals
and
the AGM is obtained by starting with
,
, then iterating the transformation
,
until
to the precision required.| MathieuC[a,q,z] | even Mathieu functions with characteristic valuea and parameterq |
| MathieuS[b,q,z] | odd Mathieu functions with characteristic valueb and parameterq |
| MathieuCPrime[a,q,z] and MathieuSPrime[b,q,z] | z derivatives of Mathieu functions |
| MathieuCharacteristicA[r,q] | characteristic valuear for even Mathieu functions with characteristic exponentr and parameterq |
| MathieuCharacteristicB[r,q] | characteristic valuebr for odd Mathieu functions with characteristic exponentr and parameterq |
| MathieuCharacteristicExponent[a,q] | characteristic exponentr for Mathieu functions with characteristic valuea and parameterq |
TheMathieu functionsMathieuC[a,q,z] andMathieuS[a,q,z] are solutions to the equation
. This equation appears in many physical situations that involve elliptical shapes or periodic potentials. The functionMathieuC is defined to be even in
, whileMathieuS is odd.
. This equation appears in many physical situations that involve elliptical shapes or periodic potentials. The functionMathieuC is defined to be even in
, whileMathieuS is odd.When
the Mathieu functions are simply
and
. For nonzero
, the Mathieu functions are only periodic in
for certain values of
. SuchMathieu characteristic values are given byMathieuCharacteristicA[r,q] andMathieuCharacteristicB[r,q] with
an integer or rational number. These values are often denoted by
and
.
the Mathieu functions are simply
and
. For nonzero
, the Mathieu functions are only periodic in
for certain values of
. SuchMathieu characteristic values are given byMathieuCharacteristicA[r,q] andMathieuCharacteristicB[r,q] with
an integer or rational number. These values are often denoted by
and
.For integer
, the even and odd Mathieu functions with characteristic values
and
are often denoted
and
, respectively. Note the reversed order of the arguments
and
.
, the even and odd Mathieu functions with characteristic values
and
are often denoted
and
, respectively. Note the reversed order of the arguments
and
.According to Floquet's theorem, any Mathieu function can be written in the form
, where
has period
and
is theMathieu characteristic exponentMathieuCharacteristicExponent[a,q]. When the characteristic exponent
is an integer or rational number, the Mathieu function is therefore periodic. In general, however, when
is not a real integer,
and
turn out to be equal.
, where
has period
and
is theMathieu characteristic exponentMathieuCharacteristicExponent[a,q]. When the characteristic exponent
is an integer or rational number, the Mathieu function is therefore periodic. In general, however, when
is not a real integer,
and
turn out to be equal.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 |
Most special functions have simpler forms when given certain specific arguments. The Wolfram System will automatically simplify special functions in such cases.
Here again the Wolfram System reduces a special case of the Airy function to an expression involving gamma functions:
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 parameters—real and complex—for 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 useN to find numerical approximations to derivatives.
ApplyingN gives a numerical approximation:
The Wolfram System incorporates a vast amount of knowledge about special functions—including 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.
One feature of working with special functions is that there are a large number of relations between different functions, and these relations can often be used in simplifying expressions.
| FullSimplify[expr] | try to simplifyexpr using a range of transformation rules |
| FunctionExpand[expr] | try to expand out special functions |
In this case the final result does not even involvePolyGamma:
Related Guides
- ▪
- Bitwise Operations ▪
- Cryptographic Number Theory ▪
- Elementary Functions ▪
- Hyperbolic Functions ▪
- Trigonometric Functions ▪
- Special Functions ▪
- Bessel-Related Functions ▪
- Error and Exponential Integral Functions ▪
- Hypergeometric Functions ▪
- Zeta Functions & Polylogarithms ▪
- Spheroidal and Related Functions ▪
- Elliptic Integrals ▪
- Elliptic Functions ▪
- Mathieu and Related Functions
[8]ページ先頭
©2009-2025 Movatter.jp


















































































































































































































































































































































































































