Zeta
Details and Options
- Mathematical function, suitable for both symbolic and numerical manipulation.
- For
,
. - For
,
, where by default any term with
is excluded. - For
, the definition used is
. - HurwitzZeta[s,a] is identical to Zeta[s,a] for
. » - Unlike Zeta, HurwitzZeta has infinite or indeterminate values when the defining series has terms with zero denominator. »
- Zeta[s] has no branch cut discontinuities. »
- For certain special arguments, Zeta automatically evaluates to exact values.
- Zeta can be evaluated to arbitrary numerical precision.
- Zeta automatically threads over lists.
- Zeta can be used with Interval and CenteredInterval objects. »
Examples
open all close allBasic Examples (6)
Zeta[2]Generalized (Hurwitz) zeta function:
Zeta[20, 1 / 2]Plot over a subset of the reals:
Plot[Zeta[x], {x, -4, 4}]Plot over a subset of the complexes:
ComplexPlot3D[Zeta[z], {z, -2 - 2I, 2 + 2I}, PlotLegends -> Automatic]Series expansion at the origin:
Series[Zeta[x], {x, 0, 2}]//Normal//FullSimplifySeries expansion at Infinity:
Series[Zeta[x], {x, ∞, 6}]//NormalSeries expansion at a singular point:
Series[Zeta[x], {x, 1, 2}]//NormalScope (37)
Numerical Evaluation (7)
Zeta[-1., 5]Zeta[0.]N[Zeta[5 / 4], 50]N[Zeta[3, 2], 50]The precision of the output tracks the precision of the input:
Zeta[5.21111111111111111111]N[Zeta[.5 + .5I]]Zeta[-1.5 + I, 2.5 - I]Evaluate efficiently at high precision:
Zeta[2`100]//TimingZeta[12`10000];//TimingCompute worst-case guaranteed intervals using Interval and CenteredInterval objects:
Zeta[Interval[{1.1, 1.2}]]Zeta[CenteredInterval[2, 1 / 100]]Zeta[CenteredInterval[2 - 5I, (1 + I) / 100]]Compute average-case statistical intervals using Around:
Zeta[1 / 2, Around[1 / 2, 0.01]]Compute the elementwise values of an array:
Zeta[2, {{1 / 2, 0}, {0, 3 / 2}}]Or compute the matrix Zeta function using MatrixFunction:
MatrixFunction[Zeta[2, #]&, {{1 / 2, 0}, {0, 3 / 2}}]Specific Values (6)
Simple exact values are generated automatically:
Table[Zeta[s ], {s, -3, 5}]Zeta[4, 5]Zeta[s,a] for symbolic
:
Zeta[-2, a]//FunctionExpandZeta[s,a] for symbolic
:
Zeta[s, -1]Zeta[0]Limit[Zeta[x], x -> Infinity]Find a value of
for which Zeta[s]=1.05:
sval = s /. FindRoot[Zeta[s] == 1.05, {s, 5}]Plot[Zeta[s], {s, -1, 20}, Epilog -> Style[Point[{sval, Zeta[sval]}], PointSize[Large], Red]]Visualization (4)
Plot Zeta[s]:
Plot[Zeta[s], {s, -5, 5}]Plot Zeta[s,a] as a function of s for positive
:
Plot[Zeta[s, 2], {s, -3, 5}]Do it for nonpositive integer
; there is a jump discontinuity at the origin:
Plot[Zeta[s, -2], {s, -2, 2}, Epilog -> {AbsolutePointSize[Large], RGBColor[0.24, 0.6, 0.8], Point[{0, Zeta[0, -2]}]}]Adding the plot of
shows that
follows the expansion in
rather than the expansion in
:
Show[%, Plot[Zeta[0, -2 + a], {a, -2, 2}, PlotStyle -> ColorData["DefaultPlotColors"][2]]]Plot Zeta as a function of
for various positive integer values of
:
Plot[{Zeta[2, a], Zeta[3, a], Zeta[4, a]}, {a, -2, 2}, PlotLegends -> "Expressions"]Do it for nonpositive integer
:
Plot[{Zeta[0, a], Zeta[-1, a], Zeta[-2, a]}, {a, -4, 4}, PlotLegends -> "Expressions"]Plot[{Zeta[1 / 2, a], Zeta[-1 / 2, a]}, {a, -2, 2}, PlotLegends -> "Expressions"]Plot the real part of the Zeta function:
ComplexContourPlot[Re[Zeta[z]], {z, -3 - 4I, 3 + 4I}, IconizedObject[«PLotOptions»]]Plot the imaginary part of the Zeta function:
ComplexContourPlot[Im[Zeta[z]], {z, -3 - 4I, 3 + 4I}, IconizedObject[«PlotOptions»]]Function Properties (12)
Real domain of Zeta:
FunctionDomain[Zeta[x], x]FunctionDomain[Zeta[z], z, Complexes]The generalized zeta function
has the same domain for all
:
FunctionDomain[Zeta[x, a], {x, a}, Complexes]Zeta achieves all real values:
FunctionRange[Zeta[x], x, y]Zeta has the mirror property
:
FullSimplify[Zeta[Conjugate[z]] == Conjugate[Zeta[z]]]Zeta threads elementwise over lists and matrices:
Zeta[{1, 2, 3, 4}]Zeta[s] is not an analytic function:
FunctionAnalytic[Zeta[s], s]FunctionMeromorphic[Zeta[s], s]Zeta[s,a] is not meromorphic:
FunctionMeromorphic[Zeta[s, a], {s, a}]Zeta is neither non-decreasing nor non-increasing:
FunctionMonotonicity[{Zeta[x], x ≠ 1}, x]However, it is decreasing to the right of the singularity at 1:
FunctionMonotonicity[{Zeta[x], x > 1}, x, StrictInequalities -> True]Zeta is not injective:
FunctionInjective[Zeta[x], x]Plot[{Zeta[x], 0.002}, {x, -10, 0}]Zeta is surjective:
FunctionSurjective[Zeta[x], x]Plot[{Zeta[x], -1}, {x, -5, 5}, PlotRange -> 3]Zeta is neither non-negative nor non-positive:
FunctionSign[{Zeta[x], x ≠ 1}, x]
has both singularity and discontinuity at
:
FunctionSingularities[Zeta[x, a], x]FunctionDiscontinuities[Zeta[x, a], x]
is neither convex nor concave:
FunctionConvexity[Zeta[x], x]However, it is convex to the right of the singularity at
:
FunctionConvexity[{Zeta[x], x > 1}, x]TraditionalForm formatting:
Zeta[s]//TraditionalFormZeta[s, a]//TraditionalFormDifferentiation (3)
First derivative with respect to
:
D[Zeta[s, a], a]Evaluate derivatives exactly for the Riemann zeta function:
Zeta'[0]Zeta''[0]Higher derivatives with respect to
:
Table[D[Zeta[s, a], {a, k}], {k, 1, 3}]//FullSimplifyPlot the higher derivatives with respect to
when
:
Plot[Evaluate[% /. { s -> 1 / 5}], {a, -2, 2}, PlotLegends -> {"First Derivative", "Second Derivative", "Third Derivative"}]Series Expansions (2)
Find the Taylor expansion using Series:
Series[Zeta[x], {x, 0, 3}]Plots of the first three approximations around
:
terms = Normal@Table[Series[Zeta[x], {x, 4, m}], {m, 1, 5, 2}];
Plot[{Zeta[x], terms}, {x, -10, 10}, PlotRange -> {-10, 10}]General term in the series expansion using SeriesCoefficient:
SeriesCoefficient[Zeta[x], {x, 1, n}]Function Identities and Simplifications (3)
Zeta is defined through the identity:
Underoverscript[∑, k = 1, ∞]k^-s == Zeta[s]Sum involving the Zeta function:
Sum[(Zeta[2 n]/n (2n + 1)), {n, 1, ∞}]Connection with the MoebiusMu function:
(1/Zeta[s]) == Sum[(MoebiusMu[n]/n^s), {n, 1, ∞}]Applications (7)
Plot the real part of the zeta function on the critical line:
Plot[Re[Zeta[1 / 2 + I t]], {t, 0, 100}]Plot the real part across the critical strip:
Plot3D[Re[Zeta[s + I t]], {s, 0, 1}, {t, 0, 50}, BoxRatios -> {1, 5, 1.5}]Find a zero of the zeta function:
FindRoot[Zeta[t] == 0, {t, 20I}]Table[FindRoot[Zeta[t] == 0, {t, n I}], {n, 0, 80, 20}]Use ZetaZero:
Table[N[ZetaZero[k]], {k, 10}]Find what fraction of pairs of the first 100 integers are relatively prime:
Mean[Flatten[Boole[Array[CoprimeQ, {100, 100}]]]]Compare with a zeta function formula:
N[1 / Zeta[2]]Plot real and imaginary parts in the vicinity of two very nearby zeros (a Lehmer pair):
Plot[{Re[Zeta[1 / 2 + I t]], Im[Zeta[1 / 2 + I t]]}, {t, 7005.055, 7005.11}]Plot the generalized zeta function:
Plot3D[Re[Zeta[1 / 2 + I y, a]], {y, 1, 50}, {a, 1 / 2, 2}]Use MellinTransform to find the first two terms in the asymptotic expansion for a function that is defined by an infinite series:
f[x_] := Inactive[Sum][((-1)^k*Log[k])/E^(k^2*x), {k, 1, Infinity}]Compute the Mellin transform of
:
MellinTransform[f[x], x, s]Activate[%]Compute the residues at
and
to obtain the required asymptotic expansion represented with Zeta function:
Residue[% x ^ (-s), {s, 0}] + Residue[% x ^ (-s), {s, -1}]//SimplifyProperties & Relations (11)
Riemann Zeta Function (5)
The defining sum for the zeta function:
Sum[1 / k ^ s, {k, Infinity}]The Euler product formula for the zeta function:
Product[1 / (1 - Prime[k] ^ -s), {k, Infinity}]Sum involving a zeta function:
Sum[Zeta[1 + k]Exp[-k], {k, Infinity}]Use FullSimplify to prove the functional equation:
Zeta[1 - s] == π^1 / 2 - s(Gamma[s / 2]/Gamma[(1 - s) / 2])Zeta[s]//FullSimplifyZeta can be represented as a DifferenceRoot:
DifferenceRootReduce[Zeta[-5, k], k]Generalized Zeta Function (6)
The ordinary zeta function is a special case:
Zeta[s, 1]For
, two-argument Zeta coincides with HurwitzZeta:
FullSimplify[HurwitzZeta[s, a] == Zeta[s, a], Re[a] > 0]Zeta by default omits singular terms for which the denominator is zero:
Zeta[2, -2]The term
in the defining series is omitted:
% == Sum[If[k == 2, 0, (1/(k + -2)^2)], {k, 0, Infinity}]//ExpandHurwitzZeta, by contrast, includes these terms:
HurwitzZeta[2, -2]% === Sum[(1/(k + -2)^2), {k, 0, Infinity}]//QuietIn certain cases, FunctionExpand gives formulas in terms of other functions:
FunctionExpand[Zeta[10, a]]Indefinite integral of the generalized zeta function:
∫Zeta[s, a]ⅆaZeta[s] equals LerchPhi[1,s,1] for Re[s]>1:
FullSimplify[Zeta[s] == LerchPhi[1, s, 1], Re[s] > 1]Zeta[s,a] equals LerchPhi[1,s,a] for Re[s]>1:
Block[{a = RandomComplex[{-2 - 2I, 2 + 2I}], s = RandomComplex[{1 - 2I, 5 + 2I}]}, Zeta[s, a] - LerchPhi[1, s, a]]Possible Issues (4)
Real and imaginary parts can have very different scales:
N[Zeta[200 + 1000 I], 20]Evaluating the imaginary part accurately requires higher internal precision:
N[Im[Zeta[200 + 1000 I]], 20]Block[{$MaxExtraPrecision = 200}, N[Im[Zeta[200 + 1000 I]], 20]]Machine-number inputs can give high‐precision results:
Zeta[100., 0.0001 + 0.0002 I]MachineNumberQ[%]Giving 0 as an argument does not define the precision required:
Derivative[10][Zeta][N[0, 20]]Including an accuracy specification gives enough information:
Derivative[10][Zeta][N[0, {20, 20}]]In TraditionalForm, ζ is not automatically interpreted as the zeta function:
ζ(x)Neat Examples (2)
Play the real part of the zeta function on the critical line as a sound:
Play[Re[Zeta[1 / 2 + 1000 I t]], {t, 0, 1}]Animate the zeta function on the critical line:
Animate[Plot[{Re[Zeta[1 / 2 + I t]], Im[Zeta[1 / 2 + I t]]}, {t, u, u + 20}, PlotRange -> {-5, 5}, Axes -> {True, False}, Frame -> True], {u, 2, Infinity, 1 / 2}, AnimationRunning -> False]See Also
PolyLog MultipleZeta HarmonicPolyLog GeneralizedPolyLog MultiplePolyLog HarmonicNumber AlternatingHarmonicNumber HyperHarmonicNumber LerchPhi HurwitzZeta RiemannSiegelZ ZetaZero StieltjesGamma Glaisher PrimePi DirichletL RamanujanTauL PrimeZetaP DirichletTransform
Function Repository: ZetaSimplify
History
Introduced in 1988 (1.0) | Updated in 1999 (4.0) ▪ 2000 (4.1) ▪ 2002 (4.2) ▪ 2021 (13.0) ▪ 2022 (13.1)
Text
Wolfram Research (1988), Zeta, Wolfram Language function, https://reference.wolfram.com/language/ref/Zeta.html (updated 2022).
CMS
Wolfram Language. 1988. "Zeta." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/Zeta.html.
APA
Wolfram Language. (1988). Zeta. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Zeta.html
BibTeX
@misc{reference.wolfram_2026_zeta, author="Wolfram Research", title="{Zeta}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/Zeta.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_zeta, organization={Wolfram Research}, title={Zeta}, year={2022}, url={https://reference.wolfram.com/language/ref/Zeta.html}, note=[Accessed: 12-June-2026]}