In his 1859 paper "On the Number of Primes Less Than a Given Magnitude" Riemann found an explicit formula for the normalized primecounting function π_{0}(x) which is related to the primecounting function π(x) by
π
0
(
x
)
=
1
2
lim
h
→
0
(
π
(
x
+
h
)
+
π
(
x
−
h
)
)
,
which takes the arithmetic mean of the limit from the left and the limit from the right at discontinuities. His formula was given in terms of the related function
f
(
x
)
=
π
0
(
x
)
+
1
2
π
0
(
x
1
/
2
)
+
1
3
π
0
(
x
1
/
3
)
+
⋯
in which a prime power p^{n} counts as 1/n of a prime. The normalized primecounting function can be recovered from this function by
π
0
(
x
)
=
∑
n
1
n
μ
(
n
)
f
(
x
1
/
n
)
=
f
(
x
)
−
1
2
f
(
x
1
/
2
)
−
1
3
f
(
x
1
/
3
)
−
1
5
f
(
x
1
/
5
)
+
1
6
f
(
x
1
/
6
)
−
⋯
,
where μ(n) is the Möbius function. Riemann's formula is then
f
(
x
)
=
li
(
x
)
−
∑
ρ
li
(
x
ρ
)
−
log
(
2
)
+
∫
x
∞
d
t
t
(
t
2
−
1
)
log
(
t
)
involving a sum over the nontrivial zeros ρ of the Riemann zeta function. The sum is not absolutely convergent, but may be evaluated by taking the zeros in order of the absolute value of their imaginary part. The function li occurring in the first term is the (unoffset) logarithmic integral function given by the Cauchy principal value of the divergent integral
li
(
x
)
=
∫
0
x
d
t
log
(
t
)
.
The terms li(x^{ρ}) involving the zeros of the zeta function need some care in their definition as li has branch points at 0 and 1, and are defined by analytic continuation in the complex variable ρ in the region x>1 and Re(ρ)>0. The other terms also correspond to zeros: the dominant term li(x) comes from the pole at s = 1, considered as a zero of multiplicity −1, and the remaining small terms come from the trivial zeros. This formula says that the zeros of the Riemann zeta function control the oscillations of primes around their "expected" positions. (For graphs of the sums of the first few terms of this series see Zagier 1977.)
A simpler variation of Riemann's formula using the normalization
ψ
0
of Chebyshev's function ψ rather than π is vonMangoldt's explicit formula
ψ
0
(
x
)
=
1
2
π
i
∫
σ
−
i
∞
σ
−
i
∞
(
−
ζ
′
(
s
)
ζ
(
s
)
)
x
s
s
d
s
=
x
−
∑
ρ
x
ρ
ρ
−
log
(
2
π
)
−
1
2
log
(
1
−
x
−
2
)
where the LHS is a inverse Mellin inversion,
σ
>
1
,
ψ
0
(
x
)
=
∑
p
k
<
x
log
p
, and the RHS is obtained from the residue theorem. It plays an important role in von Mangoldt's proof of Riemann's explicit formula.
This series is again conditionally convergent and the sum over zeroes should again be taken in increasing order of imaginary part :
∑
ρ
x
ρ
ρ
=
lim
T
→
∞
S
(
x
,
T
)
where
S
(
x
,
T
)
=
∑
ρ
:

ℑ
ρ

≤
T
x
ρ
ρ
. The error involved in truncating the sum to S(x,T) is of order
x
2
log
2
T
T
+
log
x
.
There are several slightly different ways to state the explicit formula. Weil's form of the explicit formula states
Φ
(
1
)
+
Φ
(
0
)
−
∑
ρ
Φ
(
ρ
)
=
∑
p
,
m
log
(
p
)
p
m
/
2
(
F
(
log
(
p
m
)
)
+
F
(
−
log
(
p
m
)
)
)
−
1
2
π
∫
−
∞
∞
φ
(
t
)
Ψ
(
t
)
d
t
where
ρ runs over the nontrivial zeros of the zeta function
p runs over positive primes
m runs over positive integers
F is a smooth function all of whose derivatives are rapidly decreasing
φ
is a Fourier transform of F:
Φ
(
1
/
2
+
i
t
)
=
φ
(
t
)
Ψ
(
t
)
=
−
log
(
π
)
+
R
e
(
ψ
(
1
/
4
+
i
t
/
2
)
)
, where
ψ
is the digamma function Γ′/Γ.
Roughly speaking, the explicit formula says the Fourier transform of the zeros of the zeta function is the set of prime powers plus some elementary factors. Once this is said, the formula comes from the fact that the Fourier transform is an unitary operator, so that a scalar product in time domain is equal to the scalar product of the Fourier transforms in the frequency domain.
The terms in the formula arise in the following way.
The terms on the right hand side come from the logarithmic derivative of
with the terms corresponding to the prime
p coming from the Euler factor of
p, and the term at the end involving
Ψ coming from the gamma factor (the Euler factor at infinity).
The lefthand side is a sum over all zeros of ζ^{ *} counted with multiplicities, so the poles at 0 and 1 are counted as zeros of order −1.
The Weil's explicit formula can be understood like this. The target is to be able to write that :
d
d
u
[
∑
n
≤
e

u

Λ
(
n
)
+
1
2
ln
(
1
−
e
−
2

u

)
]
=
∑
n
=
1
∞
Λ
(
n
)
[
δ
(
u
−
ln
n
)
+
δ
(
u
−
ln
n
)
]
+
d
ln
(
1
−
e
−
2

u

)
d
u
=
e
u
−
∑
ρ
e
ρ
u
So that the Fourier transform of the non trivial zeros is equal to the primes power symmetrized plus a minor term. Of course, the sum involved are not convergent, but the trick is to use the unitary property of Fourier transform which is that it preserves scalar product :
∫
−
∞
∞
f
(
u
)
g
∗
(
u
)
d
u
=
∫
−
∞
∞
F
(
t
)
G
∗
(
t
)
d
t
where
F
,
G
are the Fourier transforms of
f
,
g
. At a first look, it seems to be a formula for functions only, but in fact in many cases it also works when
g
is a distribution. Hence, by setting
g
(
u
)
=
∑
n
=
1
∞
Λ
(
n
)
[
δ
(
u
−
ln
n
)
+
δ
(
u
−
ln
n
)
]
(where
δ
(
u
)
is the Dirac delta) and carefully choosing a function
f
and its Fourier transform, we get the formula above.
RiemannWeyl formula can be generalized to other arithmetical functions and not only for the VonMangoldt function, for example for the Möbius function we have
∑
n
=
1
∞
μ
(
n
)
n
g
(
l
o
g
n
)
=
∑
γ
h
(
γ
)
ζ
′
(
ρ
+
∑
n
=
1
∞
1
ζ
′
(
−
2
n
)
∫
−
∞
∞
d
x
g
(
x
)
e
−
(
2
n
+
1
/
2
)
x
Also for the Liouville function we have
∑
n
=
1
∞
λ
(
n
)
n
g
(
l
o
g
n
)
=
∑
γ
h
(
γ
)
ζ
(
2
ρ
)
ζ
′
(
ρ
)
+
1
ζ
(
1
/
2
)
∫
−
∞
∞
d
x
g
(
x
)
For the EulerPhi function the expicit formula reads
∑
n
=
1
∞
φ
(
n
)
n
g
(
l
o
g
n
)
=
6
π
2
∫
−
∞
∞
d
x
g
(
x
)
e
3
x
/
2
+
∑
γ
h
(
γ
)
ζ
(
ρ
/
2
)
ζ
′
(
ρ
)
+
∑
n
=
1
∞
∫
−
∞
∞
ζ
(
−
2
n
−
1
)
ζ
′
(
−
2
n
)
d
x
g
(
x
)
e
−
x
(
2
n
+
1
/
2
for the squarefree function
∑
n
=
1
∞

μ
(
n
)

n
1
/
4
g
(
l
o
g
n
)
=
6
π
2
∫
−
∞
∞
d
x
g
(
x
)
e
3
x
/
4
+
∑
γ
h
(
γ
)
ζ
(
ρ
−
1
)
ζ
′
(
ρ
)
+
1
2
∑
n
=
1
∞
ζ
(
−
n
)
ζ
′
(
−
2
n
)
∫
−
∞
∞
d
x
g
(
x
)
e
−
x
(
n
+
1
/
4
)
in all cases the sum is related to the imaginary part of the Riemann zeros
ρ
=
1
2
+
i
γ
and the test function f and g are related by a Fourier transform
g
(
u
)
=
1
2
π
∫
−
∞
∞
h
(
x
)
e
x
p
(
−
i
u
x
)
for the divisor function of zeroth order
∑
n
=
1
∞
σ
0
(
n
)
f
(
n
)
=
∑
m
=
−
∞
∞
∑
n
=
1
∞
f
(
m
n
)
The Riemann zeta function can be replaced by a Dirichlet Lfunction of a Dirichlet character χ. The sum over prime powers then gets extra factors of χ(p^{ m}), and the terms Φ(1) and Φ(0) disappear because the Lseries has no poles.
More generally, the Riemann zeta function and the Lseries can be replaced by the Dedekind zeta function of an algebraic number field or a Hecke Lseries. The sum over primes then gets replaced by a sum over prime ideals.
Riemann's original use of the explicit formula was to give an exact formula for the number of primes less than a given number. To do this, take F(log(y)) to be y^{1/2}/log(y) for 0 ≤ y ≤ x and 0 elsewhere. Then the main term of the sum on the right is the number of primes less than x. The main term on the left is Φ(1); which turns out to be the dominant terms of the prime number theorem, and the main correction is the sum over nontrivial zeros of the zeta function. (There is a minor technical problem in using this case, in that the function F does not satisfy the smoothness condition.)
According to the Hilbert–Pólya conjecture, the complex zeroes ρ should be the eigenvalues of some linear operator T. The sum over the zeros of the explicit formula is then (at least formally) given by a trace:
∑
ρ
F
(
ρ
)
=
Tr
(
F
(
T
^
)
)
.
Development of the explicit formulae for a wide class of Lfunctions was given by Weil (1952), who first extended the idea to local zetafunctions, and formulated a version of a generalized Riemann hypothesis in this setting, as a positivity statement for a generalized function on a topological group. More recent work by Alain Connes has gone much further into the functionalanalytic background, providing a trace formula the validity of which is equivalent to such a generalized Riemann hypothesis. A slightly different point of view was given by Meyer (2005), who derived the explicit formula of Weil via harmonic analysis on adelic spaces.