Zeta¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
Zeta[s]
is the Riemann zeta function zeta(s) = Sum_{k>=1} k^-s.
Zeta[s, a]
is the Hurwitz zeta function zeta(s, a) = Sum_{k>=0} (k+a)^-s.
Even positive integers give rational multiples of Pi^(2n), negative
integers give rationals, Zeta[0] is -1/2, and Zeta[1] is ComplexInfinity;
odd positive integers stay symbolic. Hurwitz zeta at a positive integer a
reduces to Zeta[s] minus a finite power sum. Real, complex, machine and
arbitrary-precision (MPFR) numeric arguments evaluate numerically via
mpfr_zeta (real Riemann) or an Euler-Maclaurin kernel. Listable.
Examples¶
All examples below are verified against the current Mathilda build.
In[1]:= Zeta[2]
Out[1]= 1/6 Pi^2
In[2]:= Series[Zeta[x], {x, 1, 2}] // Normal
Out[2]= EulerGamma + 1/(-1 + x) - StieltjesGamma[1] (-1 + x) + 1/2 StieltjesGamma[2] (-1 + x)^2
Implementation notes¶
Attributes: Listable, NumericFunction, Protected.
Implementation status¶
Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
References¶
- Source:
src/info.c - Specification:
docs/spec/builtins/special-functions.md
Notes & additional examples¶
Worked examples¶
A trivial value — Euler's solution of the Basel problem, ζ(2) = π²/6:
Even positive integers are rational multiples of powers of π (via Bernoulli numbers):
Negative-integer values are rational, exposing the Bernoulli-number connection ζ(−n) = −Bₙ₊₁/(n+1); the negative even integers are the trivial zeros:
In[1]:= Zeta[-1]
Out[1]= -1/12
In[1]:= Zeta[-3]
Out[1]= 1/120
In[1]:= Table[Zeta[-2 n], {n, 1, 4}]
Out[1]= {0, 0, 0, 0}
Apéry's constant ζ(3) to 40 digits, evaluated through the MPFR kernel:
A value on the critical line at the first nontrivial zero ρ ≈ 1/2 + 14.134725 i — the result is numerically zero to within the input precision, confirming the zero of the Riemann hypothesis:
The Laurent expansion about the pole s = 1 defines the Stieltjes constants, with residue 1 and constant term the Euler–Mascheroni constant γ:
In[1]:= Series[Zeta[s], {s, 1, 2}]
Out[1]= 1/(s - 1) + EulerGamma + -StieltjesGamma[1] (s - 1) + 1/2 StieltjesGamma[2] (s - 1)^2 + O[s - 1]^3
The Hurwitz zeta at an integer second argument reduces to ζ(s) minus a finite power sum, mixing exact π-power and rational parts: