PolyGamma
Details
- Mathematical function, suitable for both symbolic and numerical manipulation.
- PolyGamma[z] is the logarithmic derivative of the gamma function, given by
. - PolyGamma[n,z] is given for positive integer
by
. - For arbitrary complex n, the polygamma function is defined by fractional calculus analytic continuation.
- PolyGamma[z] and PolyGamma[n,z] are meromorphic functions of z with no branch cut discontinuities.
- For certain special arguments, PolyGamma automatically evaluates to exact values.
- PolyGamma can be evaluated to arbitrary numerical precision.
- PolyGamma automatically threads over lists.
- PolyGamma can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (7)
Evaluate the digamma function:
PolyGamma[5]Evaluate the pentagamma function:
PolyGamma[3, 5]Evaluate the second derivative of the gamma function:
D[Gamma[z], {z, 2}]Plot the digamma function over a subset of the reals:
Plot[PolyGamma[x], {x, -3, 3}]Plot over a subset of the complexes:
ComplexPlot3D[PolyGamma[z], {z, -2 - 2I, 2 + 2I}, PlotLegends -> Automatic]Series expansion at the origin:
Series[PolyGamma[z], {z, 0, 2}]Series expansion at Infinity:
Series[PolyGamma[z], {z, ∞, 4}]Series expansion at a singular point:
Series[PolyGamma[x], {x, -1, 3}]Scope (47)
Numerical Evaluation (7)
PolyGamma[100.5]Evaluate for integer arguments of any size:
PolyGamma[100]Evaluate for complex arguments and orders:
PolyGamma[2.5 + 3I]PolyGamma[6 + I, 2.5 + 3I]N[PolyGamma[22 / 10], 50]The precision of the output tracks the precision of the input:
PolyGamma[2.20000000000000000000000]Evaluate PolyGamma efficiently at high precision:
PolyGamma[2.2`500]//TimingPolyGamma[2.2`3000];//TimingCompute worst-case guaranteed intervals using Interval and CenteredInterval objects:
PolyGamma[Interval[{1.23, 1.24}]]PolyGamma[1, Interval[{3.45, 3.46}]]PolyGamma[1, CenteredInterval[2.5, 0.01]]Compute average-case statistical intervals using Around:
PolyGamma[1 / 2, Around[1 / 2, 0.01]]Compute the elementwise values of an array:
PolyGamma[1, {{2, 1 / 2}, {1 / 2, 2}}]Or compute the matrix PolyGamma function using MatrixFunction:
MatrixFunction[PolyGamma[1, #]&, {{2, 1 / 2}, {1 / 2, 2}}]//FullSimplifySpecific Values (6)
Some singular points of PolyGamma:
{PolyGamma[0], PolyGamma[-1], PolyGamma[-2]}{PolyGamma[-1, Infinity], PolyGamma[0, Infinity], PolyGamma[1, Infinity], PolyGamma[2, Infinity]}PolyGamma[ComplexInfinity]xzero = N@Solve[PolyGamma[x] == 0 && 1 < x < 2, x, Reals][[1, 1, 2]]//QuietPlot[PolyGamma[x], {x, -2, 4}, Epilog -> Style[Point[{xzero, PolyGamma[xzero]}], PointSize[Large], Red]]Use FunctionExpand to expand higher-order polygamma functions:
Table[PolyGamma[n, 1], {n, 0, 4}]FunctionExpand[%]PolyGamma[-1, z]PolyGamma[-2, 7 / 2]//FunctionExpandPolyGamma[1, (1/4)]//FunctionExpandVisualization (3)
Plot[PolyGamma[x], {x, -4, 4}]ComplexContourPlot[Re[PolyGamma[z]], {z, -2 - 2 I, 2 + 2 I}, Contours -> 20]ComplexContourPlot[Im[PolyGamma[z]], {z, -2 - 2 I, 2 + 2 I}, Contours -> 20]Plot PolyGamma for half-integer values of parameter
:
Plot[{PolyGamma[1 / 2, x], PolyGamma[3 / 2, x], PolyGamma[5 / 2, x]}, {x, 0, 2}, IconizedObject[«PlotOptions»]]Function Properties (9)
Real domain of PolyGamma:
FunctionDomain[PolyGamma[x], x]FunctionDomain[PolyGamma[n, x], {n, x}]Approximate function ranges of PolyGamma for half-integer parameters:
{FunctionRange[PolyGamma[1 / 2, x], x, y], FunctionRange[PolyGamma[3 / 2, x], x, y], FunctionRange[PolyGamma[5 / 2, x], x, y]}//QuietPolyGamma is not an analytic function:
FunctionAnalytic[PolyGamma[x], x]It has both singularities and discontinuities:
FunctionSingularities[PolyGamma[x], x]FunctionDiscontinuities[PolyGamma[x], x]FunctionMeromorphic[PolyGamma[z], z]For fixed non-negative integer
,
is a meromorphic function of
:
Table[FunctionMeromorphic[PolyGamma[n, z], z], {n, 0, 5}]It is not meromorphic for other values of
:
{FunctionMeromorphic[PolyGamma[-1, z], z], FunctionMeromorphic[PolyGamma[π, z], z]}
is neither nondecreasing nor nonincreasing:
FunctionMonotonicity[PolyGamma[x], x]FunctionInjective[PolyGamma[x], x]Plot[{PolyGamma[x], -1}, {x, -3, 7}]FunctionSurjective[PolyGamma[x], x]Plot[{PolyGamma[x], -10}, {x, -3, 25}]
is neither non-negative nor non-positive:
FunctionSign[PolyGamma[x], x]
is neither convex nor concave:
FunctionConvexity[PolyGamma[x], x]Differentiation (3)
First derivative of PolyGamma:
D[PolyGamma[x], x]D[PolyGamma[n, x], x]Higher derivatives of the digamma function:
Table[D[PolyGamma[x], {x, n}], {n, 1, 3}]Plot[Evaluate[%], {x, -4, 4}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative"}]D[PolyGamma[x], {x, n}]Integration (3)
Indefinite integral of PolyGamma:
Integrate[PolyGamma[x], x]Integrate[PolyGamma[n, x], x]Indefinite integral involving a power function:
Integrate[x ^ 2 PolyGamma[x], x]Integrate[PolyGamma[x], {x, 1, 3}]Series Expansions (7)
Taylor expansion for the digamma function around
:
Series[PolyGamma[x], {x, 1, 4}]Plot the first three approximations for the Euler gamma function around
:
terms = Normal@Table[Series[PolyGamma[x], {x, 1, m}], {m, 1, 3}];
Plot[{PolyGamma[x], terms}, {x, 0, 2}]General term in the series expansion of the digamma function:
SeriesCoefficient[PolyGamma[x], {x, 0, n}]Series expansion at infinities:
Series[PolyGamma[z], {z, Infinity, 2}]Series[PolyGamma[z], {z, -Infinity, 2}]Series[PolyGamma[z], {z, -5, 3}]Series expansion at a generic point:
Series[PolyGamma[n, z], {z, z0, 2}]Series expansion near a singularity:
Series[PolyGamma[3, -k + ϵ], {ϵ, 0, 2}, Assumptions -> k∈Integers && k ≥ 0]PolyGamma can be applied to a power series:
PolyGamma[Exp[x] + O[x]^5]//FullSimplifyFunction Identities and Simplifications (5)
Use FullSimplify to simplify polygamma functions:
FullSimplify[PolyGamma[1 - z] - PolyGamma[z]]PolyGamma identity
:
PolyGamma[0, z] == PolyGamma[z]PolyGamma of a double argument:
PolyGamma[2 z] == (1/2)(PolyGamma[z] + PolyGamma[z + (1/2)]) + Log[2]//FullSimplifyOther argument simplifications:
PolyGamma[-z] == PolyGamma[z] + (1/z) + π Cot[π z]//FullSimplifyPolyGamma[z - 1] == PolyGamma[z] - (1/z - 1)//FullSimplifyPolyGamma[z] == PolyGamma[z + 1] - (1/z)//FullSimplifyFullSimplify[PolyGamma[n, z] == PolyGamma[n, z + 1] - (-1)^n n! z^-n - 1, n∈Integers && n ≥ 0]Function Representations (4)
PolyGamma[z] == (D[Gamma[z], z]/Gamma[z])PolyGamma[z] == Integrate[(Exp[-t]/t) - (1/(t + 1)^z t), {t, 0, Infinity}, Assumptions -> Re[z] > 0]PolyGamma can be represented as a DifferenceRoot:
DifferenceRootReduce[PolyGamma[k], k]DifferenceRootReduce[PolyGamma[3, k], k]TraditionalForm formatting:
PolyGamma[z]//TraditionalFormPolyGamma[n, x]//TraditionalFormApplications (4)
Plot of the absolute value of PolyGamma over the complex plane:
Plot3D[Abs[PolyGamma[x + I y]], {x, -5, 2}, {y, -1, 1}]The electric field energy of a charge at a fraction
of the distance between parallel conducting plates:
Sum[(1/k) - (1/2k - 2 x) - (1/2(k - 1) + 2 x), {k, Infinity}]Series[%, {x, 0, 3}]//FullSimplifyFinal speed of a rocket with
discrete propulsion events:
Sum[(Subscript[m, i] - Subscript[m, f]/n) u (1/Subscript[m, f] + (k/n)(Subscript[m, i] - Subscript[m, f])), {k, n}]Final velocity in the limit of constant continuous propulsion:
Assuming[Subscript[m, i] > Subscript[m, f] > 0, Series[%, {n, Infinity, 1}, Assumptions -> n > 1]//FullSimplify]Effective confining potential in random matrix theory for a Gaussian density of states:
v[x_] := x ^ 2 HypergeometricPFQ[{1, 1}, {2, 3 / 2}, -x ^ 2]Plot[v[x], {x, 0, 5}]Expansion at infinity reveals logarithmic growth:
Series[v[x], {x, ∞, 3}]//ExpandProperties & Relations (7)
Use FullSimplify to simplify polygamma functions:
FullSimplify[PolyGamma[1 - z] - PolyGamma[z]]Express rational arguments through elementary functions:
FunctionExpand[PolyGamma[1 / 5]]Numerically find a root of a transcendental equation:
FindRoot[PolyGamma[z] - 2 PolyGamma[z + 2] + z == 2, {z, 1}]Underoverscript[∑, k = 1, n]PolyGamma[k]Underoverscript[∑, k = 1, n]PolyGamma[k]z ^ kIntegrate[x ^ 2 PolyGamma[x], x]Generate PolyGamma from integrals, sums, and limits:
Integrate[(1 - t^z - 1/1 - t), {t, 0, 1}, Assumptions -> Re[z] > 0]Integrate[(Exp[-t]/t) - (1/(t + 1)^z t), {t, 0, Infinity}, Assumptions -> Re[z] > 0]Sum[(k^2 - 1/k^2 + 1), {k, 1, n}]Product[(1 + (y/x + n)) Exp[-(y/x + n)], {n, Infinity}]Limit[HurwitzZeta[s, z] - (1/s - 1), s -> 1]Underoverscript[∑, k = 1, ∞]PolyGamma[k] x^kObtain as special cases of hypergeometric functions:
HypergeometricPFQ[{1, 1, 1, 2 - z}, {2, 2, 2}, 1]Possible Issues (3)
The one‐argument form evaluates to the two-argument form:
PolyGamma[z]Large orders can give results too large to be computed explicitly:
PolyGamma[10. ^ 16, 1]Machine‐number inputs can give high‐precision results:
PolyGamma[10. ^ 3, 1]MachineNumberQ[%]See Also
Gamma LogGamma EulerGamma HarmonicNumber AlternatingHarmonicNumber HyperHarmonicNumber QPolyGamma HurwitzZeta
Function Repository: PolyGammaSimplify
Related Guides
Related Links
History
Introduced in 1988 (1.0) | Updated in 1999 (4.0) ▪ 2000 (4.1) ▪ 2002 (4.2) ▪ 2007 (6.0) ▪ 2021 (13.0) ▪ 2022 (13.1)
Text
Wolfram Research (1988), PolyGamma, Wolfram Language function, https://reference.wolfram.com/language/ref/PolyGamma.html (updated 2022).
CMS
Wolfram Language. 1988. "PolyGamma." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/PolyGamma.html.
APA
Wolfram Language. (1988). PolyGamma. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/PolyGamma.html
BibTeX
@misc{reference.wolfram_2026_polygamma, author="Wolfram Research", title="{PolyGamma}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/PolyGamma.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_polygamma, organization={Wolfram Research}, title={PolyGamma}, year={2022}, url={https://reference.wolfram.com/language/ref/PolyGamma.html}, note=[Accessed: 13-June-2026]}