Skip to content

LerchPhi ​

The Lerch transcendent Φ(z,s,a)=∑n=0∞zn(n+a)s\Phi(z, s, a) = \sum_{n=0}^{\infty} \dfrac{z^n}{(n+a)^s} — a common generalization of the polylogarithm and the Hurwitz zeta. Provided by @enumeratio/analytic.

✓ checked against that system · ! checked, with disagreements (hover a chip)WikipediaLerch transcendentMathWorldLerchTranscendentWikidataQ1546155DLMF25.14.E1FungrimLerchPhiFungrim entryd6fbc8Wolfram LanguageLerchPhi!
LerchPhi(z, s, a)the Lerch transcendent Φ(z,s,a)\Phi(z, s, a).
SymPylerchphi(z, s, a)mpmathlerchphi(z, s, a)Juliaenumeratio_lerch(z, s, a)
Typed signatures
TypePackageApplies
(complex, complex, complex) -> numberanalyticreplaces compute-enginealways
(complex, complex, complex) -> numbercompute-enginealways

Domain: Special functions

Details
  • At z=1z = 1 it is the Hurwitz zeta: Φ(1,s,a)=ζ(s,a)\Phi(1, s, a) = \zeta(s, a), so Φ(1,s,1)=ζ(s)\Phi(1, s, 1) = \zeta(s). See HurwitzZeta.
  • It carries the polylogarithm: Li⁡s(z)=z Φ(z,s,1)\operatorname{Li}_s(z) = z\,\Phi(z, s, 1) — e.g. Li⁡2(1/2)=12Φ(1/2,2,1)=π2/12−(ln⁡2)2/2\operatorname{Li}_2(1/2) = \tfrac12\Phi(1/2, 2, 1) = \pi^2/12 - (\ln 2)^2/2.
  • At z=−1z = -1 it is the Dirichlet eta: Φ(−1,s,1)=η(s)=∑n≥1(−1)n−1n−s=(1−21−s)ζ(s)\Phi(-1, s, 1) = \eta(s) = \sum_{n\ge1} (-1)^{n-1} n^{-s} = (1 - 2^{1-s})\zeta(s), so Φ(−1,1,1)=ln⁡2\Phi(-1, 1, 1) = \ln 2.
  • And the Dirichlet beta / Catalan's constant: Φ(−1,2,12)=4β(2)=4G=3.6638…\Phi(-1, 2, \tfrac12) = 4\beta(2) = 4G = 3.6638\ldots
  • Φ(z,0,a)=1/(1−z)\Phi(z, 0, a) = 1/(1 - z) — the geometric series (and its continuation), independent of aa, for all z≠1z \ne 1.
  • Convergence: the series converges for ∣z∣<1|z| < 1 (any ss, aa), and on ∣z∣=1|z| = 1 only for Re⁡(s)>1\operatorname{Re}(s) > 1; elsewhere it is defined by analytic continuation in zz.
  • Poles at a=0,−1,−2,…a = 0, -1, -2, \ldots, from the singular (n+a)=0(n+a) = 0 term, as for HurwitzZeta.
  • Numeric evaluation sums the series directly for ∣z∣<1|z| < 1 (geometric convergence), routes z=1z = 1 through the Euler–Maclaurin Hurwitz kernel, and sums real z<0z < 0 (the z=−1z = -1 rim included) by a van Wijngaarden Euler transform, so the alternating η(s)\eta(s) and Catalan cases reach machine precision. Past ∣z∣=1|z| = 1 it is continued by the Hermite-type integral representation, Φ=12as+z−a(−ln⁡z)s−1Γ(1−s,−aln⁡z)−2∫0∞sin⁡(tln⁡z−sarctan⁡(t/a))(a2+t2)s/2(e2πt−1) dt\Phi = \tfrac{1}{2a^s} + z^{-a}(-\ln z)^{s-1}\Gamma(1-s, -a\ln z) - 2\int_0^\infty \frac{\sin(t\ln z - s\arctan(t/a))}{(a^2+t^2)^{s/2}(e^{2\pi t}-1)}\,dt, with other aa shifted by Φ(z,s,a)=a−s+zΦ(z,s,a+1)\Phi(z, s, a) = a^{-s} + z\Phi(z, s, a+1); on the cut, real z>1z > 1, it takes the side below, as mpmath and Wolfram do. Where the terms cancel below double precision, or the incomplete gamma can't be trusted (near the negative real axis past ∣x∣≈20|x| \approx 20), it stays unevaluated rather than guess.
  • Certified digits: for exact real zz, ss and aa (integers, rationals or decimals) with ∣z∣<1|z| < 1 and a>0a > 0, N(Φ(z,s,a),d)\mathrm{N}(\Phi(z, s, a), d) is proven. The series is summed in ball arithmetic, and its tail after a term tt is bounded by ∣t∣R/(1−R)|t| R/(1-R), where R=∣z∣ emax⁡(0,−s)/(n+a)R = |z|\,e^{\max(0, -s)/(n+a)} bounds every later ratio of terms; the d digits are those both ends of the enclosure round to. See N.

Plot

ComplexPlot
real slice

Examples

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

Φ(1,2,1)=ζ(2)=π2/6\Phi(1, 2, 1) = \zeta(2) = \pi^2/6 — reduces to the ordinary zeta

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

Φ(1,2,2)=ζ(2,2)=π2/6−1\Phi(1, 2, 2) = \zeta(2, 2) = \pi^2/6 - 1

live ↗
InLerchPhi(1,2,2)\mathrm{LerchPhi}(1, 2, 2)Outπ26−1\frac{π^2}{6}-1
Scope #

past the unit disk, by the integral representation (mpmath: 0.00202500995700991 + 0.00332789753681356i)

live ↗
InN(LerchPhi(1+2i,3−i,4+2i))N(\mathrm{LerchPhi}(1+2i, 3-i, 4+2i))Out0.002 025 009 957 009 905 3+0.003 327 897 536 813 557i0.002\,025\,009\,957\,009\,905\,3+0.003\,327\,897\,536\,813\,557i

Inexact arguments evaluate numerically without N() — a float operand means a float answer, as HurwitzZeta and Zeta already do

live ↗
InLerchPhi(0.5,2,3.5)\mathrm{LerchPhi}(0.5, 2, 3.5)Out0.119 386 226 869 820 480.119\,386\,226\,869\,820\,48

s=0s = 0 far outside the unit disk: 1/(1−49.5)1/(1 - 49.5)

live ↗
InLerchPhi(49.5,0,2)\mathrm{LerchPhi}(49.5, 0, 2)Out−0.020 618 556 701 030 927 835 1-0.020\,618\,556\,701\,030\,927\,835\,1

∣z∣>1|z| > 1 by analytic continuation: Φ(z,1,2)=(−ln⁡(1−z)−z)/z2\Phi(z, 1, 2) = (-\ln(1-z) - z)/z^2 at z=7.5z = 7.5, via the Hermite-integral continuation (lerch-continuation.ts)

live ↗
InLerchPhi(7.5,1,2)\mathrm{LerchPhi}(7.5, 1, 2)Out−0.166 609 816 478 250 43−0.055 850 536 063 818 53i-0.166\,609\,816\,478\,250\,43-0.055\,850\,536\,063\,818\,53i

Uncertainty in zz

live ↗
InLerchPhi(Around(0.5,0.01),1,2)\mathrm{LerchPhi}(\mathrm{Around}(0.5, 0.01), 1, 2)OutAround(0.772 588 722 239 781 1,0.009 096 451 110 408 75)\mathrm{Around}(0.772\,588\,722\,239\,781\,1, 0.009\,096\,451\,110\,408\,75)

To 30 significant digits, past a double's reach

live ↗
InN(LerchPhi(12,2,13),30)N(\mathrm{LerchPhi}(\frac{1}{2}, 2, \frac{1}{3}), 30)Out9.343 474 659 375 939 518 555 549 658 049.343\,474\,659\,375\,939\,518\,555\,549\,658\,04

Past ∣z∣=1|z| = 1 it is continued; on the cut, real z>1z > 1, it takes the side below, as mpmath and Wolfram do

live ↗
InN(LerchPhi(2.809,2,2))N(\mathrm{LerchPhi}(2.809, 2, 2))Out−0.056 587 701 973 223 09−0.411 220 377 971 662 5i-0.056\,587\,701\,973\,223\,09-0.411\,220\,377\,971\,662\,5i
Applications #

Φ(1,3,1)=ζ(3)\Phi(1, 3, 1) = \zeta(3), Apéry's constant

live ↗
InLerchPhi(1,3,1)=ζ(3)\mathrm{LerchPhi}(1, 3, 1)=ζ(3)OutTrue\mathrm{True}

Φ(−1,2,1)=η(2)=π2/12\Phi(-1, 2, 1) = \eta(2) = \pi^2/12 — the alternating rim, via the Euler transform

live ↗
InLerchPhi(−1,2,1)=π212\mathrm{LerchPhi}(-1, 2, 1)=\frac{π^2}{12}OutTrue\mathrm{True}

Φ(1/2,2,1)=2Li⁡2(1/2)\Phi(1/2, 2, 1) = 2\operatorname{Li}_2(1/2)

live ↗
InN(LerchPhi(12,2,1))N(\mathrm{LerchPhi}(\frac{1}{2}, 2, 1))Out1.164 481 052 930 0251.164\,481\,052\,930\,025

Φ(1/2,1/2,1/3)\Phi(1/2, 1/2, 1/3) to 40 digits, proven: the series' tail is bounded, and both ends of the enclosure round to these digits

live ↗
InN(LerchPhi(12,12,13),40)N(\mathrm{LerchPhi}(\frac{1}{2}, \frac{1}{2}, \frac{1}{3}), 40)Out2.452 417 145 481 526 111 742 144 156 526 818 292 2262.452\,417\,145\,481\,526\,111\,742\,144\,156\,526\,818\,292\,226
Properties #

Φ(1,4,1)=ζ(4)=π4/90\Phi(1, 4, 1) = \zeta(4) = \pi^4/90

live ↗
InLerchPhi(1,4,1)\mathrm{LerchPhi}(1, 4, 1)Outπ490\frac{π^4}{90}

Φ(1,−1,1)=ζ(−1)=−1/12\Phi(1, -1, 1) = \zeta(-1) = -1/12

live ↗
InLerchPhi(1,−1,1)\mathrm{LerchPhi}(1, -1, 1)Out−112-\frac{1}{12}

Φ(1,s,a)=ζ(s,a)\Phi(1, s, a) = \zeta(s, a) for symbolic ss, aa

live ↗
InLerchPhi(1,s,a)\mathrm{LerchPhi}(1, s, a)OutHurwitzZeta(s,a)\mathrm{HurwitzZeta}(s, a)

Φ(z,0,a)=1/(1−z)\Phi(z, 0, a) = 1/(1 - z), independent of aa

live ↗
InLerchPhi(z,0,a)\mathrm{LerchPhi}(z, 0, a)Out11−z\frac{1}{1-z}

Φ(2,0,7)=1/(1−2)=−1\Phi(2, 0, 7) = 1/(1 - 2) = -1: the s=0s = 0 closed form holds past the unit disk

live ↗
InLerchPhi(2,0,7)\mathrm{LerchPhi}(2, 0, 7)Out−1-1

Φ(0,s,a)=a−s\Phi(0, s, a) = a^{-s}: only the n=0n = 0 term survives

live ↗
InLerchPhi(0,s,a)\mathrm{LerchPhi}(0, s, a)Outa−sa^{-s}

Φ(z,s,1)=Li⁡s(z)/z\Phi(z, s, 1) = \operatorname{Li}_s(z)/z symbolically. See PolyLog

live ↗
InLerchPhi(z,s,1)\mathrm{LerchPhi}(z, s, 1)OutLi⁡s(z)z\frac{\operatorname{Li}_{s}(z)}{z}

Φ(z,1,1)=−ln⁡(1−z)/z\Phi(z, 1, 1) = -\ln(1-z)/z -- the s=1s = 1 instance, through Li⁡1(z)=−ln⁡(1−z)\operatorname{Li}_1(z) = -\ln(1-z)

live ↗
InLerchPhi(z,1,1)\mathrm{LerchPhi}(z, 1, 1)Out−ln⁡(1−z)z-\frac{\ln(1-z)}{z}

Φ(1,2,1/4)=ζ(2,1/4)=π2+8G\Phi(1, 2, 1/4) = \zeta(2, 1/4) = \pi^2 + 8G, through HurwitzZeta's own closed form at that argument

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

Φ(−1,1,1)=η(1)=ln⁡2\Phi(-1, 1, 1) = \eta(1) = \ln 2, the alternating harmonic series -- via Φ(z,1,1)=−ln⁡(1−z)/z\Phi(z,1,1) = -\ln(1-z)/z

live ↗
InLerchPhi(−1,1,1)\mathrm{LerchPhi}(-1, 1, 1)Outln⁡(2)\ln(2)

Φ(1/2,1,1)=2ln⁡2\Phi(1/2, 1, 1) = 2\ln 2

live ↗
InLerchPhi(12,1,1)\mathrm{LerchPhi}(\frac{1}{2}, 1, 1)Out2ln⁡(2)2\ln(2)

Phi(z, s, 1) = Li_s(z)/z for any s, here as (1+i)*Li_2((1-i)/2) -- confirmed numerically against Wolframs closed form in Catalans constant

live ↗
InLerchPhi(12−12i,2,1)\mathrm{LerchPhi}(\frac{1}{2}-\frac{1}{2}i, 2, 1)Out(1+i)Li⁡2(12−12i)(1+i)\operatorname{Li}_{2}(\frac{1}{2}-\frac{1}{2}i)

Φ(−1,2,1/2)=4G\Phi(-1, 2, 1/2) = 4G, via Φ(−1,s,1/2)=2sβ(s)\Phi(-1, s, 1/2) = 2^s\beta(s) and β(2)=G\beta(2) = G

live ↗
InLerchPhi(−1,2,12)\mathrm{LerchPhi}(-1, 2, \frac{1}{2})Out4G⁡4\operatorname{G}

...though N() gets 4G=3.66386…4G = 3.66386\ldots

live ↗
InN(LerchPhi(−1,2,12))N(\mathrm{LerchPhi}(-1, 2, \frac{1}{2}))Out3.663 862 376 708 8753.663\,862\,376\,708\,875

Φ(−1,3,12)=8β(3)=π3/4\Phi(-1, 3, \tfrac12) = 8\beta(3) = \pi^3/4 — the Dirichlet beta at 3, in closed form

live ↗
InLerchPhi(−1,3,12)\mathrm{LerchPhi}(-1, 3, \frac{1}{2})Outπ34\frac{π^3}{4}

Φ(−1,3,1)=η(3)=34ζ(3)\Phi(-1, 3, 1) = \eta(3) = \tfrac34\zeta(3)

live ↗
InLerchPhi(−1,3,1)=3ζ(3)4\mathrm{LerchPhi}(-1, 3, 1)=\frac{3ζ(3)}{4}OutTrue\mathrm{True}
Possible issues #

Where the continuation's terms cancel below double precision it stays unevaluated rather than guess

live ↗
InN(LerchPhi(10,10,10))N(\mathrm{LerchPhi}(10, 10, 10))Out−4.462 130 727 102 148 4⋅10−11−1.575 172 198 981 023 8⋅10−12i-4.462\,130\,727\,102\,148\,4\cdot10^{-11}-1.575\,172\,198\,981\,023\,8\cdot10^{-12}i
About
Examples415
Checked againstWolfram Language 381 agree31 differ1 unevaluatedSymPy 405 agree3 differ3 unevaluated3 errormpmath 400 agree3 differ3 unevaluated3 errorJulia 294 agree115 error
CrosswalkWikipediaMathWorldWikidataDLMFFungrimFungrim entryWolfram LanguageSymPympmathJulia

Implementation

referenceenginenotatio

The defining series, converging for |z| < 1 (and for |z| = 1 with Re(s) > 1); ζ(s, a) is its z = 1 edge and Li_s(z) its a = 1 slice.

nativeenginetypescriptpackages/ce-patches/src/compute-engine/numerics/lerch-phi.ts

The direct series, which covers |z| ≤ 1; z = 1 hands off to HurwitzZeta and inherits its closed forms.

compiledgpuwgslpackages/symbols/analysis/analytic/src/shader.ts:zetaWGSL

Produces a colour per pixel — complex Φ, domain-coloured.

mappedwolframpackages/oracle/src/mappings.ts

For a + k < 0, Wolfram sums ((a+k)²)^(−s/2), the generalized-zeta convention; mpmath, SymPy and ours take (a+k)^(−s), principal.

mappedsympypackages/oracle/src/mappings.ts

For a + k < 0, Wolfram sums ((a+k)²)^(−s/2), the generalized-zeta convention; mpmath, SymPy and ours take (a+k)^(−s), principal.

mappedmpmathpackages/oracle/src/mappings.ts

For a + k < 0, Wolfram sums ((a+k)²)^(−s/2), the generalized-zeta convention; mpmath, SymPy and ours take (a+k)^(−s), principal.

mappedjuliapackages/oracle/src/mappings.ts

See also: HurwitzZeta, Zeta, Gamma, PolyLog