Skip to content

The Polylog and the Polygamma ​

Two more members of the zeta family, and both of them are the Hurwitz zeta or the Lerch transcendent wearing a different hat:

Li⁡s(z)=∑n=1∞znns=z Φ(z,s,1)\operatorname{Li}_s(z) = \sum_{n=1}^{\infty} \frac{z^n}{n^s} = z\,\Phi(z, s, 1)ψ(m)(z)=dm+1dzm+1ln⁡Γ(z)=(−1)m+1m! ζ(m+1,z)\psi^{(m)}(z) = \frac{d^{m+1}}{dz^{m+1}}\ln\Gamma(z) = (-1)^{m+1} m!\,\zeta(m+1, z)

The polylogarithm is the Lerch transcendent along a=1a = 1; the polygamma is the Hurwitz zeta with its two arguments read the other way round — the order mm fixes the first slot, and the argument zz takes the second. So a single Euler–Maclaurin kernel, already written for ζ(s,a)\zeta(s,a), computes the entire polygamma family, and the Lerch series computes the polylogarithm.

compute-engine ships both heads natively, so this is an extension rather than an addition. PolyLog is native at integer order (including the continuation past the unit disk); @enumeratio/analytic adds non-integer and complex ss. PolyGamma is native at real argument; @enumeratio/analytic adds complex zz, and the GPU kernel neither had.

Reductions

InLi⁡1(z)\operatorname{Li}_{1}(z)Out−ln⁡(1−z)-\ln(1-z)InLi⁡2(1)\operatorname{Li}_{2}(1)Outπ26\frac{π^2}{6}InLi⁡−1(z)\operatorname{Li}_{-1}(z)Outz(1−z)2\frac{z}{(1-z)^2}
source · editable

Li⁡1(z)=−ln⁡(1−z)\operatorname{Li}_1(z) = -\ln(1-z), Li⁡2(1)=ζ(2)=π2/6\operatorname{Li}_2(1) = \zeta(2) = \pi^2/6, and every negative integer order is a rational function — Li⁡−1(z)=z/(1−z)2\operatorname{Li}_{-1}(z) = z/(1-z)^2.

Polygamma as a zeta value

InN(PolyGamma(1,1))N(\mathrm{PolyGamma}(1, 1))Out1.644 934 066 848 226 436 471.644\,934\,066\,848\,226\,436\,47InN(PolyGamma(2,1))N(\mathrm{PolyGamma}(2, 1))Out−2.404 113 806 319 188 570 8-2.404\,113\,806\,319\,188\,570\,8InN(PolyGamma(1,12))N(\mathrm{PolyGamma}(1, \frac{1}{2}))Out4.934 802 200 544 679 309 424.934\,802\,200\,544\,679\,309\,42
source · editable

At z=1z = 1 every order is a zeta value: ψ′(1)=ζ(2)=π2/6\psi'(1) = \zeta(2) = \pi^2/6 and ψ′′(1)=−2ζ(3)\psi''(1) = -2\zeta(3). At the half-integers the alternating zeta shows up instead — ψ′(12)=π2/2\psi'(\tfrac12) = \pi^2/2.

Two very different pictures ​

Colour the complex zz-plane by hue = argument, brightness = magnitude, and the two functions could hardly look less alike — which is exactly the difference between their kernels. Both are the same <notatio-complex-plot> element, handed a different expression; every constant in them is a slider.

Liₛ(z) is the Lerch series, so it only converges inside ∣z∣<1|z| < 1: a lit disk, dark outside, with the branch point at z=1z = 1 sitting on the rim. Raise Im⁡(s)\operatorname{Im}(s) and the disk fills with spirals, the same winding the Lerch portrait shows; push Re⁡(s)\operatorname{Re}(s) up and the n=1n = 1 term zz dominates, leaving a near-linear ramp of hue.

ψ⁽ᵐ⁾(z) is a Hurwitz zeta, which converges over the whole plane — so the picture fills out, and the poles appear: one at each of z=0,−1,−2,…z = 0, -1, -2, \ldots, of order m+1m+1, strung along the negative real axis with the full colour wheel turning around each. Step mm up and the hue wheels round more times per pole — a pole of order m+1m+1 winds the argument m+1m+1 times.

(f32 on the GPU, so the rim of the disk and the immediate neighbourhood of a pole are approximate — the CPU kernel is the source of truth. The colouring runs on ln⁡∣ψ(m)∣\ln|\psi^{(m)}| rather than the value, which is what keeps high orders in frame: ψ(m)(1)≈m!\psi^{(m)}(1) \approx m! leaves f32's range past m≈34m \approx 34, but its logarithm never does.)

Where the pieces come from ​

functioncomputed asnew here
Li⁡s(z)\operatorname{Li}_s(z), integer sscompute-engine's own—
Li⁡s(z)\operatorname{Li}_s(z), other ssz Φ(z,s,1)z\,\Phi(z, s, 1), the Lerch series∣z∣≤1\lvert z\rvert \leq 1
Li⁡s(1)\operatorname{Li}_s(1)ζ(s)\zeta(s), exactlynon-integer ss
ψ(m)(z)\psi^{(m)}(z), real zzcompute-engine's own—
ψ(m)(z)\psi^{(m)}(z), complex zz(−1)m+1m! ζ(m+1,z)(-1)^{m+1} m!\,\zeta(m+1, z)the whole complex plane

The one place we stop short: a non-integer order outside the unit disk. The series does not reach there and the continuation is only implemented for integer ss, so Li⁡5/2(2)\operatorname{Li}_{5/2}(2) is returned unevaluated rather than guessed at.