Skip to content

PolyGamma ​

The polygamma function ψ(m)(z)=dm+1dzm+1ln⁡Γ(z)\psi^{(m)}(z) = \dfrac{d^{m+1}}{dz^{m+1}} \ln\Gamma(z), the mm-th derivative of the digamma.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaPolygamma functionMathWorldPolygammaFunctionWikidataQ857956DLMF5.15FungrimPolyGamma✓Fungrim entryWolfram LanguagePolyGamma!
PolyGamma(m, z)the polygamma ψ(m)(z)\psi^{(m)}(z) at real zz.
SageMathpsi(m, z)SymPypolygamma(m, z)mpmathpsi(m, z)Juliaenumeratio_ball(polygamma, m, z)
Typed signatures
TypePackageApplies
(order: integer, complex | infinity) -> numbercompute-enginealways
(number, number?) -> numberanalyticreplaces compute-enginealways

Domain: Special functions

Details
  • ψ(0)\psi^{(0)} is the digamma — see Digamma — and ψ(1)\psi^{(1)} the trigamma.
  • For m≥1m \geq 1 it is a Hurwitz zeta in disguise: ψ(m)(z)=(−1)m+1 m! ζ(m+1,z)\psi^{(m)}(z) = (-1)^{m+1}\, m!\, \zeta(m+1, z). See HurwitzZeta.
  • So at z=1z = 1 every order is a zeta value: ψ(m)(1)=(−1)m+1m! ζ(m+1)\psi^{(m)}(1) = (-1)^{m+1} m!\, \zeta(m+1), giving ψ′(1)=π2/6\psi'(1) = \pi^2/6 and ψ′′(1)=−2ζ(3)\psi''(1) = -2\zeta(3).
  • Half-integer arguments pick up the alternating zeta: ψ′(12)=π2/2\psi'(\tfrac12) = \pi^2/2.
  • Recurrence from Γ\Gamma: ψ(m)(z+1)=ψ(m)(z)+(−1)mm! z−m−1\psi^{(m)}(z+1) = \psi^{(m)}(z) + (-1)^m m!\, z^{-m-1}, so ψ′(1)−ψ′(2)=1\psi'(1) - \psi'(2) = 1.
  • Poles at the nonpositive integers, of order m+1m+1 — the poles of Gamma, differentiated.
  • Real zz is compute-engine's own; @enumeratio/analytic adds complex zz through the Euler–Maclaurin Hurwitz kernel, and the WGSL lowering for GPU plotting.

Plot

Examples

47 more kept as data, checked against the oracles
Basic #

ψ′(1)=ζ(2)=π2/6\psi'(1) = \zeta(2) = \pi^2/6

live ↗
InPolyGamma(1,1)=ζ(2)\mathrm{PolyGamma}(1, 1)=ζ(2)OutTrue\mathrm{True}

ψ′′(1)=−2ζ(3)\psi''(1) = -2\zeta(3), Apéry's constant doubled and negated

live ↗
InPolyGamma(2,1)=−2ζ(3)\mathrm{PolyGamma}(2, 1)=-2ζ(3)OutTrue\mathrm{True}

An inexact argument evaluates to a decimal: ψ′(1/2)=4.93480…\psi'(1/2) = 4.93480\ldots

live ↗
InPolyGamma(1,0.5)\mathrm{PolyGamma}(1, 0.5)Out4.934 802 200 544 679 309 424.934\,802\,200\,544\,679\,309\,42

A pole of Gamma, still a pole after differentiating

live ↗
InPolyGamma(1,0)\mathrm{PolyGamma}(1, 0)Out∞~\tilde∞

One argument is the digamma: ψ(5)=H4−γ=2512−γ\psi(5) = H_4 - \gamma = \frac{25}{12} - \gamma. See Digamma

live ↗
InPolyGamma(5)\mathrm{PolyGamma}(5)Out2512−γ\frac{25}{12}-γ

ψ(3)(5)=π4/15−22369/3456\psi^{(3)}(5) = \pi^4/15 - 22369/3456

live ↗
InPolyGamma(3,5)\mathrm{PolyGamma}(3, 5)Out117 280(1 152π4−111 845)\frac{1}{17\,280}(1\,152π^4-111\,845)

...numerically

live ↗
InN(PolyGamma(3,5))N(\mathrm{PolyGamma}(3, 5))Out0.021 427 828 192 755 075 021 90.021\,427\,828\,192\,755\,075\,021\,9

ψ′′(1/2)=−14ζ(3)\psi''(1/2) = -14\zeta(3)

live ↗
InPolyGamma(2,0.5)\mathrm{PolyGamma}(2, 0.5)Out−16.828 796 644 234 319 995 6-16.828\,796\,644\,234\,319\,995\,6
Scope #

Threads over a list (each element a positive integer, so each takes its zeta closed form)

live ↗
InPolyGamma(1,[1,2])\mathrm{PolyGamma}(1, \bigl\lbrack1, 2\bigr\rbrack)Out[π26,π26−1]\bigl\lbrack\frac{π^2}{6}, \frac{π^2}{6}-1\bigr\rbrack

One-argument digamma at a machine-precision point

live ↗
InPolyGamma(100.5)\mathrm{PolyGamma}(100.5)Out4.605 174 352 581 8454.605\,174\,352\,581\,845

One-argument digamma at a complex point

live ↗
InPolyGamma(2.5+3i)\mathrm{PolyGamma}(2.5+3i)Out1.281 273 919 066 231 4+0.979 805 315 344 559 6i1.281\,273\,919\,066\,231\,4+0.979\,805\,315\,344\,559\,6i

Complex argument, integer order

live ↗
InPolyGamma(1,2.5+3i)\mathrm{PolyGamma}(1, 2.5+3i)Out0.155 597 888 471 945 53−0.230 379 553 082 323 5i0.155\,597\,888\,471\,945\,53-0.230\,379\,553\,082\,323\,5i

Between poles: ψ′(−1/2)=π2/2+4\psi'(-1/2) = \pi^2/2 + 4

live ↗
InPolyGamma(1,−0.5)\mathrm{PolyGamma}(1, -0.5)Out8.934 802 200 544 679 309 428.934\,802\,200\,544\,679\,309\,42

ψ′(∞)=0\psi'(\infty) = 0

live ↗
InPolyGamma(1,∞)\mathrm{PolyGamma}(1, ∞)Out00

Interval arithmetic: the trigamma is decreasing

live ↗
InPolyGamma(1,Interval(3.45,3.46))\mathrm{PolyGamma}(1, \mathrm{Interval}(3.45, 3.46))OutInterval(0.334 742 897 540 441 2,0.335 857 280 611 811 7)\mathrm{Interval}(0.334\,742\,897\,540\,441\,2, 0.335\,857\,280\,611\,811\,7)

To 30 significant digits, every one correctly rounded

live ↗
InN(PolyGamma(1,13),30)N(\mathrm{PolyGamma}(1, \frac{1}{3}), 30)Out10.095 597 125 427 094 081 792 004 099 910.095\,597\,125\,427\,094\,081\,792\,004\,099\,9

To 25 significant digits, every one of them right

live ↗
InN(PolyGamma(3,5),25)N(\mathrm{PolyGamma}(3, 5), 25)Out0.021 427 828 192 755 075 021 948 110.021\,427\,828\,192\,755\,075\,021\,948\,11

ψ′(1)=ζ(2)=π2/6\psi'(1)=\zeta(2)=\pi^2/6

live ↗
InPolyGamma(1,1)\mathrm{PolyGamma}(1, 1)Outπ26\frac{π^2}{6}

ψ′(2)=π2/6−1\psi'(2)=\pi^2/6-1, by the shift ψ(n)(m)=(−1)n+1n! (ζ(n+1)−∑k<mk−n−1)\psi^{(n)}(m)=(-1)^{n+1}n!\,(\zeta(n+1)-\sum_{k<m}k^{-n-1})

live ↗
InPolyGamma(1,2)\mathrm{PolyGamma}(1, 2)Outπ26−1\frac{π^2}{6}-1

One argument is the digamma: ψ(0.7)\psi(0.7) evaluates directly

live ↗
InPolyGamma(0.7)\mathrm{PolyGamma}(0.7)Out−1.220 023 553 697 934 614 75-1.220\,023\,553\,697\,934\,614\,75
Applications #

ψ′(1+i)=0.46300…−0.79423…i\psi'(1+i) = 0.46300\ldots - 0.79423\ldots i — complex argument, from @enumeratio/analytic

live ↗
InN(PolyGamma(1,1+i))N(\mathrm{PolyGamma}(1, 1+i))Out0.463 000 096 622 763 76−0.794 233 542 759 319i0.463\,000\,096\,622\,763\,76-0.794\,233\,542\,759\,319i
Properties #

ψ′(1/2)=π2/2\psi'(1/2) = \pi^2/2

live ↗
InPolyGamma(1,12)=π22\mathrm{PolyGamma}(1, \frac{1}{2})=\frac{π^2}{2}OutTrue\mathrm{True}

Recurrence at m=1m = 1, z=1z = 1: ψ′(z)−ψ′(z+1)=z−2\psi'(z) - \psi'(z+1) = z^{-2}

live ↗
InPolyGamma(1,1)−PolyGamma(1,2)=1\mathrm{PolyGamma}(1, 1)-\mathrm{PolyGamma}(1, 2)=1OutTrue\mathrm{True}

ψ(0)(1)=−γ\psi^{(0)}(1) = -\gamma -- PolyGamma(0, z) routes through Digamma(z) (#113) whenever Digamma has an exact value

live ↗
InPolyGamma(0,1)\mathrm{PolyGamma}(0, 1)Out−γ-γ

ψ(1/2)=−γ−2ln⁡2\psi(1/2) = -\gamma - 2\ln 2

live ↗
InPolyGamma(0,12)\mathrm{PolyGamma}(0, \frac{1}{2})Out−2ln⁡(2)−γ-2\ln(2)-γ

ψ′(1/2)=π2/2\psi'(1/2) = \pi^2/2 in closed form

live ↗
InPolyGamma(1,12)\mathrm{PolyGamma}(1, \frac{1}{2})Outπ22\frac{π^2}{2}

ψ′(1/4)=π2+8G\psi'(1/4) = \pi^2 + 8G

live ↗
InPolyGamma(1,14)\mathrm{PolyGamma}(1, \frac{1}{4})Out8G⁡+π28\operatorname{G}+π^2

ddxψ(n)(x)=ψ(n+1)(x)\frac{d}{dx}\psi^{(n)}(x) = \psi^{(n+1)}(x)

live ↗
IndPolyGamma(n,x)dx\frac{\mathrm{d}\mathrm{PolyGamma}(n, x)}{\mathrm{d}x}OutPolyGamma(n+1,x)\mathrm{PolyGamma}(n+1, x)
Possible issues #

An exact non-integer argument is left unevaluated under plain evaluation -- pair with N() or use an inexact argument

live ↗
InPolyGamma(1,53)\mathrm{PolyGamma}(1, \frac{5}{3})OutPolyGamma(1,53)\mathrm{PolyGamma}(1, \frac{5}{3})
About
Examples76
Checked againstWolfram Language 74 agree2 differSageMath 66 agree2 differ3 errorSymPy 62 agree8 differ1 unevaluated1 errormpmath 56 agree10 errorJulia 60 agree7 differ1 unevaluated2 error
CrosswalkWikipediaMathWorldWikidataDLMFFungrimFungrim entry ×28Wolfram LanguageSageMathSymPympmathJulia

Implementation

mappedwolframpackages/oracle/src/mappings.ts

mpmath and Sage call it psi; the argument order matches.

mappedsympypackages/oracle/src/mappings.ts

mpmath and Sage call it psi; the argument order matches.

mappedmpmathpackages/oracle/src/mappings.ts

mpmath and Sage call it psi; the argument order matches.

mappedsagepackages/oracle/src/mappings.ts

mpmath and Sage call it psi; the argument order matches.

mappedjuliapackages/oracle/src/mappings.ts

See also: Digamma, Gamma, HurwitzZeta, Zeta