The Prime Number Theorem via Complex Analysis

⚡ Key Takeaways

The Prime Number Theorem (PNT) states that the number of primes up to xx, denoted π(x)\pi(x), is asymptotic to x/log⁡xx/\log x. Equivalently, ψ(x)∼x\psi(x) \sim x, where ψ\psi is the Chebyshev function. The proof via complex analysis hinges on the non-vanishing of the Riemann zeta function ζ(s)\zeta(s) on the line Re⁡(s)=1\operatorname{Re}(s)=1 and a Tauberian argument. First proved independently by Hadamard and de la Vallée Poussin in 1896, following Riemann's 1859 program. Applies throughout analytic number theory, cryptography heuristics, and the distribution of arithmetic objects.

💡 The Core Insight

Encode the primes in the Euler product for ζ(s)\zeta(s). Taking a logarithmic derivative converts the product into a Dirichlet series whose coefficients are the von Mangoldt function Λ(n)\Lambda(n), summing to the Chebyshev ψ(x)\psi(x). A contour-integral (Perron/Mellin) representation of ψ(x)\psi(x) then expresses it as a sum over the poles of −ζ′(s)/ζ(s)-\zeta'(s)/\zeta(s). The pole at s=1s=1 contributes the main term xx; the absence of zeros on Re⁡(s)=1\operatorname{Re}(s)=1 guarantees all other contributions are o(x)o(x). Thus ψ(x)∼x  ⟺  ζ(1+it)≠0\psi(x)\sim x \iff \zeta(1+it)\neq 0.

Formal Statement

DefinitionPrime-counting and Chebyshev functions

For real x≥2x \geq 2 define:

1
π(x)=∑p≤x1,ϑ(x)=∑p≤xlog⁡p,ψ(x)=∑pk≤xlog⁡p=∑n≤xΛ(n)\quad \pi(x) = \sum_{p \le x} 1, \qquad \vartheta(x) = \sum_{p\le x} \log p, \qquad \psi(x) = \sum_{p^k \le x} \log p = \sum_{n\le x}\Lambda(n)

Derivation hint: π\pi counts primes; ϑ\vartheta weights each prime by log⁡p\log p; ψ\psi also counts prime powers, since Λ(n)=log⁡p\Lambda(n)=\log p if n=pkn=p^k and 00 otherwise. Here Λ\Lambda is the von Mangoldt function. These three functions are asymptotically equivalent in a precise sense and PNT can be stated through any of them. The logarithmic integral

2
li⁡(x)=∫0xdtlog⁡t  (principal value),li⁡(x)∼xlog⁡x\quad \operatorname{li}(x) = \int_0^x \frac{dt}{\log t} \;(\text{principal value}), \qquad \operatorname{li}(x) \sim \frac{x}{\log x}

Derivation hint: integrate by parts repeatedly to get li⁡(x)=xlog⁡x∑k=0Nk!(log⁡x)k+O ⁣(x/(log⁡x)N+2)\operatorname{li}(x)=\frac{x}{\log x}\sum_{k=0}^{N}\frac{k!}{(\log x)^k}+O\!\big(x/(\log x)^{N+2}\big); the leading term is x/log⁡xx/\log x. is the sharpest elementary main term.

TheoremPrime Number Theorem

As x→∞x\to\infty,

3
π(x)∼xlog⁡x,equivalentlyπ(x)∼li⁡(x),ϑ(x)∼x,ψ(x)∼x\quad \pi(x) \sim \frac{x}{\log x}, \qquad \text{equivalently}\qquad \pi(x)\sim \operatorname{li}(x), \qquad \vartheta(x)\sim x, \qquad \psi(x)\sim x

Derivation hint: the equivalences follow from partial summation (Abel summation) linking π\pi to ϑ\vartheta and from ψ(x)−ϑ(x)=∑k≥2ϑ(x1/k)=O(xlog⁡x)\psi(x)-\vartheta(x)=\sum_{k\ge2}\vartheta(x^{1/k})=O(\sqrt{x}\log x). The notation f∼gf\sim g means f(x)/g(x)→1f(x)/g(x)\to 1.

DefinitionThe Riemann zeta function and its Euler product

For Re⁡(s)=σ>1\operatorname{Re}(s)=\sigma>1,

4
ζ(s)=∑n=1∞1ns=∏p prime(1−p−s)−1\quad \zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} = \prod_{p\text{ prime}} \left(1-p^{-s}\right)^{-1}

Derivation hint: expand each factor as a geometric series ∑k≥0p−ks\sum_{k\ge0}p^{-ks} and multiply; unique factorization of integers gives every n−sn^{-s} exactly once. ζ\zeta extends to a meromorphic function on C\mathbb{C} with a single simple pole at s=1s=1 with residue 11. The logarithmic derivative generates Λ\Lambda:

5
−ζ′(s)ζ(s)=∑n=1∞Λ(n)ns,σ>1\quad -\frac{\zeta'(s)}{\zeta(s)} = \sum_{n=1}^{\infty} \frac{\Lambda(n)}{n^s}, \qquad \sigma>1

Derivation hint: log⁡ζ(s)=−∑plog⁡(1−p−s)=∑p∑k≥1p−ksk\log\zeta(s)=-\sum_p\log(1-p^{-s})=\sum_p\sum_{k\ge1}\frac{p^{-ks}}{k}; differentiate term-by-term to get ∑p∑k(log⁡p) p−ks=∑nΛ(n)n−s\sum_p\sum_k (\log p)\,p^{-ks}=\sum_n\Lambda(n)n^{-s}.

Why It Holds / Derivation

ProofPNT via the Newman–Tauberian route

We prove ψ(x)∼x\psi(x)\sim x. We follow D. J. Newman's analytic simplification (1980), the cleanest modern complex-analytic proof.

Step 1 — Reduce to a Dirichlet series. From [5], the generating identity holds for σ>1\sigma>1. Define

6
Φ(s)=∑plog⁡pps=−ζ′(s)ζ(s)−∑p∑k≥2log⁡ppks,σ>1\quad \Phi(s) = \sum_{p} \frac{\log p}{p^s} = -\frac{\zeta'(s)}{\zeta(s)} - \sum_p\sum_{k\ge2}\frac{\log p}{p^{ks}}, \qquad \sigma>1

Derivation hint: split [5] into k=1k=1 (the Φ\Phi sum) and k≥2k\ge2; the latter converges for σ>12\sigma>\tfrac12, hence is holomorphic there. So Φ(s)\Phi(s) and −ζ′/ζ-\zeta'/\zeta differ by a function holomorphic on σ>12\sigma>\tfrac12.

Step 2 — Pole and non-vanishing. Since ζ\zeta has a simple pole at s=1s=1, −ζ′/ζ-\zeta'/\zeta has a simple pole at s=1s=1 with residue +1+1. The crucial analytic input is:

7
ζ(1+it)≠0for all t∈R,t≠0\quad \zeta(1+it) \neq 0 \quad\text{for all } t\in\mathbb{R},\qquad t\neq 0

Derivation hint: use 3+4cos⁡θ+cos⁡2θ=2(1+cos⁡θ)2≥03+4\cos\theta+\cos2\theta = 2(1+\cos\theta)^2 \ge 0 applied to log⁡∣ζ3(σ)ζ4(σ+it)ζ(σ+2it)∣\log|\zeta^3(\sigma)\zeta^4(\sigma+it)\zeta(\sigma+2it)|; a zero at 1+it1+it would force this expression →−∞\to-\infty, a contradiction. Consequently Φ(s)−1s−1\Phi(s)-\dfrac{1}{s-1} extends holomorphically to an open neighborhood of the closed half-plane Re⁡(s)≥1\operatorname{Re}(s)\ge1.

Step 3 — Integral representation. Using ψ(x)=∑n≤xΛ(n)\psi(x)=\sum_{n\le x}\Lambda(n) and partial summation, the key object is

8
Φ(s)s=s∫1∞ϑ(x)xs+1 dx  /  s=∫1∞ϑ(x)xs+1 dx,σ>1\quad \frac{\Phi(s)}{s} = s\int_1^\infty \frac{\vartheta(x)}{x^{s+1}}\,dx \;\bigg/\; s = \int_1^\infty \frac{\vartheta(x)}{x^{s+1}}\,dx, \qquad \sigma>1

Derivation hint: Φ(s)=∑p(log⁡p)p−s=s∫1∞ϑ(x)x−s−1dx\Phi(s)=\sum_p (\log p)p^{-s}=s\int_1^\infty \vartheta(x)x^{-s-1}dx by Abel summation, since ϑ\vartheta is the partial-sum (step) function of the coefficients log⁡p\log p.

Step 4 — The Tauberian theorem (Newman). Substitute x=etx=e^t, ϑ(et)=etf(t)+…\vartheta(e^t)=e^t f(t)+\ldots; the relevant convergence theorem is: > Analytic Theorem. Let g(t)g(t) (t≥0t\ge0) be bounded and locally integrable, with Laplace transform G(z)=∫0∞g(t)e−ztdtG(z)=\int_0^\infty g(t)e^{-zt}dt holomorphic for Re⁡(z)>0\operatorname{Re}(z)>0. If GG extends holomorphically to Re⁡(z)≥0\operatorname{Re}(z)\ge0, then ∫0∞g(t) dt\int_0^\infty g(t)\,dt converges and equals G(0)G(0). Apply with g(t)=ϑ(et)e−t−1g(t)=\vartheta(e^t)e^{-t}-1. One checks G(z)=Φ(z+1)z+1−1zG(z)=\dfrac{\Phi(z+1)}{z+1}-\dfrac1z, which by Step 2 is holomorphic on Re⁡(z)≥0\operatorname{Re}(z)\ge0. Boundedness of gg requires Chebyshev's bound ϑ(x)=O(x)\vartheta(x)=O(x).

9
∫1∞ϑ(x)−xx2 dxconverges\quad \int_1^\infty \frac{\vartheta(x)-x}{x^2}\,dx \quad\text{converges}

Derivation hint: this is the change of variables t=log⁡xt=\log x applied to ∫0∞g(t) dt=G(0)\int_0^\infty g(t)\,dt = G(0) from the analytic theorem.

Step 5 — From convergence to asymptotics. Suppose ϑ(x)≥λx\vartheta(x)\ge \lambda x for some λ>1\lambda>1 on a sequence x→∞x\to\infty. Since ϑ\vartheta is nondecreasing,

10
∫xλxϑ(t)−tt2 dt≥∫xλxλx−tt2 dt=∫1λλ−uu2 du>0\quad \int_x^{\lambda x}\frac{\vartheta(t)-t}{t^2}\,dt \ge \int_x^{\lambda x}\frac{\lambda x - t}{t^2}\,dt = \int_1^{\lambda}\frac{\lambda-u}{u^2}\,du > 0

Derivation hint: bound ϑ(t)≥ϑ(x)≥λx\vartheta(t)\ge\vartheta(x)\ge\lambda x on [x,λx][x,\lambda x], substitute t=uxt=ux; the resulting positive constant is independent of xx, contradicting Cauchy convergence of [9]. The same with λ<1\lambda<1 (using ϑ(t)≤ϑ(λx)≤λx\vartheta(t)\le\vartheta(\lambda x)\le\lambda x, wait—) gives the lower contradiction; both force ϑ(x)/x→1\vartheta(x)/x\to 1. Hence ϑ(x)∼x\vartheta(x)\sim x, and by [3] ψ(x)∼x\psi(x)\sim x and π(x)∼li⁡(x)\pi(x)\sim\operatorname{li}(x). ■\blacksquare

∎
⚠️ The Chebyshev bound is not optional

Step 4 silently uses ϑ(x)=O(x)\vartheta(x)=O(x) to guarantee gg is bounded. This is Chebyshev's elementary estimate (1852), proved via the central binomial coefficient (2nn)\binom{2n}{n}. Without it the Laplace transform may not even define a holomorphic function in the required half-plane. PNT is not purely complex-analytic in a vacuum — it rests on a prior elementary upper bound.

BR
Bernhard Riemann
1826–1866

Riemann's eight-page 1859 memoir "Über die Anzahl der Primzahlen unter einer gegebenen Größe" introduced the modern viewpoint: study π(x)\pi(x) via the analytic continuation of ζ(s)\zeta(s) to all of C\mathbb{C}, its functional equation relating s↔1−ss\leftrightarrow1-s, and its nontrivial zeros. He wrote down an exact "explicit formula" for π(x)\pi(x) as a sum over zeros and conjectured the Riemann Hypothesis (all nontrivial zeros on Re⁡(s)=12\operatorname{Re}(s)=\tfrac12). He did not prove PNT — several of his assertions were established only decades later by von Mangoldt, Hadamard, and de la Vallée Poussin. The complex-analytic proof of PNT is the realization, in its minimal form, of Riemann's program.

Building Intuition

🧠 Intuition

Think of ψ(x)=∑n≤xΛ(n)\psi(x)=\sum_{n\le x}\Lambda(n) as a signal. The Mellin/Perron formula

11
ψ(x)=x−∑ρxρρ−log⁡(2π)−12log⁡(1−x−2)\quad \psi(x) = x - \sum_{\rho}\frac{x^\rho}{\rho} - \log(2\pi) - \tfrac12\log(1-x^{-2})

Derivation hint: shift the contour in ψ(x)=12πi∫c−i∞c+i∞(−ζ′ζ(s))xssds\psi(x)=\frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty}\big(-\frac{\zeta'}{\zeta}(s)\big)\frac{x^s}{s}ds across all poles; s=1s=1 gives xx, each nontrivial zero ρ\rho gives −xρ/ρ-x^\rho/\rho, the trivial zeros give the log terms. decomposes ψ\psi into a main term xx plus oscillations indexed by the zeros ρ=β+iγ\rho=\beta+i\gamma. Each zero contributes a wave xβx^\beta in amplitude and cos⁡(γlog⁡x)\cos(\gamma\log x) in phase. PNT, ψ(x)∼x\psi(x)\sim x, holds precisely when every such wave has amplitude o(x)o(x), i.e. β<1\beta<1 for all ρ\rho. The Riemann Hypothesis would put every β=12\beta=\tfrac12, making the error O(x log⁡2x)O(\sqrt{x}\,\log^2 x) — the smallest conceivable. So: primes are as regularly distributed as the zeros of ζ\zeta are far left of the line Re⁡(s)=1\operatorname{Re}(s)=1.

Figure
Critical strip, the line Re(s)=1, and the contour of the Perron integral

```svg

σ t critical strip Re(s)=1/2 Re(s)=1 ζ ≠ 0 here pole s=1 (main term x) ρ (zeros) contour Re(s)=c>1 0

```

Worked Examples

ExampleNumerical check of the main term and error

Given: x=109x = 10^9. Compare π(x)\pi(x) with x/log⁡xx/\log x and li⁡(x)\operatorname{li}(x).

Steps:

  • log⁡(109)=9log⁡10≈20.7233\log(10^9) = 9\log 10 \approx 20.7233.
  • x/log⁡x≈109/20.7233≈4.8255×107x/\log x \approx 10^9 / 20.7233 \approx 4.8255\times10^7.
  • li⁡(109)≈5.0849234×107\operatorname{li}(10^9)\approx 5.0849234\times10^7 (numerically).
  • True value: π(109)=50 847 534\pi(10^9) = 50\,847\,534.

Comparison: Relative error of x/log⁡xx/\log x: (50847534−48254942)/50847534≈5.1%(50847534 - 48254942)/50847534 \approx 5.1\% — slowly improving as predicted. Relative error of li⁡(x)\operatorname{li}(x): (50847534−50849234)/50847534≈−3.3×10−5(50847534 - 50849234)/50847534 \approx -3.3\times10^{-5}.

π(109)=50 847 534,li⁡(109)≈50 849 234,error ≈1700≈3.4x/log⁡x\boxed{\pi(10^9)=50\,847\,534,\quad \operatorname{li}(10^9)\approx 50\,849\,234,\quad \text{error }\approx 1700 \approx 3.4\sqrt{x}/\log x}

The vastly superior accuracy of li⁡\operatorname{li} illustrates why it, not x/log⁡xx/\log x, is the genuine main term.

ExampleFrom ψ\psi to π\pi via partial summation

Given: Assume ψ(x)=x+O(xe−clog⁡x)\psi(x) = x + O(x e^{-c\sqrt{\log x}}) (de la Vallée Poussin error). Derive the corresponding error for π(x)\pi(x).

Steps:

  • First ϑ(x)=ψ(x)−O(xlog⁡x)=x+O(xe−clog⁡x)\vartheta(x)=\psi(x)-O(\sqrt x\log x)=x+O(xe^{-c\sqrt{\log x}}).
  • Abel summation: π(x)=ϑ(x)log⁡x+∫2xϑ(t)tlog⁡2t dt\pi(x)=\dfrac{\vartheta(x)}{\log x}+\displaystyle\int_2^x \dfrac{\vartheta(t)}{t\log^2 t}\,dt.
  • Substitute ϑ(t)=t+E(t)\vartheta(t)=t+E(t), E(t)=O(te−clog⁡t)E(t)=O(te^{-c\sqrt{\log t}}):
π(x)=xlog⁡x+∫2xdtlog⁡2t+E(x)log⁡x+∫2xE(t)tlog⁡2tdt.\pi(x)=\frac{x}{\log x}+\int_2^x\frac{dt}{\log^2 t}+\frac{E(x)}{\log x}+\int_2^x\frac{E(t)}{t\log^2 t}dt.
  • The first two terms recombine into li⁡(x)\operatorname{li}(x); the error integrals are dominated by O(xe−c′log⁡x)O(xe^{-c'\sqrt{\log x}}).
π(x)=li⁡(x)+O ⁣(x e−clog⁡x)\boxed{\pi(x)=\operatorname{li}(x)+O\!\big(x\,e^{-c\sqrt{\log x}}\big)}

This is the classical PNT with error term, equivalent to a zero-free region σ>1−c/log⁡(∣t∣+2)\sigma > 1 - c/\log(|t|+2).

Common Misconceptions

⚠️ PNT does not require the Riemann Hypothesis

A frequent error is to believe RH is needed for PNT. It is not. PNT follows from the strictly weaker fact ζ(1+it)≠0\zeta(1+it)\neq0. RH only sharpens the error term to O(xlog⁡2x)O(\sqrt{x}\log^2 x). Conversely, knowing PNT gives essentially no zero-free region beyond the line σ=1\sigma=1 itself.

⚠️ x/log⁡xx/\log x vs. li⁡(x)\operatorname{li}(x) — both are correct, but unequal in quality

Both x/log⁡xx/\log x and li⁡(x)\operatorname{li}(x) are valid statements of "π(x)∼ ⋅\pi(x)\sim\,\cdot", yet π(x)−x/log⁡x∼x/log⁡2x→∞\pi(x)-x/\log x \sim x/\log^2 x \to \infty in absolute terms while staying o(x/log⁡x)o(x/\log x). Asymptotic equivalence (∼\sim) is about ratios, not differences. li⁡(x)\operatorname{li}(x) captures the next-order corrections and is dramatically more accurate numerically.

Counterexampleπ(x)<li⁡(x)\pi(x)<\operatorname{li}(x) is NOT always true — Skewes' number

All computed data suggest π(x)<li⁡(x)\pi(x)<\operatorname{li}(x). Yet Littlewood (1914) proved π(x)−li⁡(x)\pi(x)-\operatorname{li}(x) changes sign infinitely often. The first sign change (Skewes' number) is astronomically large — below 1.4×103161.4\times10^{316}. This warns against extrapolating numerical "patterns": the oscillation terms ∑ρxρ/ρ\sum_\rho x^\rho/\rho eventually overwhelm any finite empirical trend.

Connections

connection

PNT sits at the hub of analytic number theory. Its proof is the prototype for the Wiener–Ikehara Tauberian Theorem, which abstracts Step 4. The non-vanishing ζ(1+it)≠0\zeta(1+it)\neq0 generalizes to Dirichlet L-functions, yielding the Prime Number Theorem in Arithmetic Progressions (Dirichlet's theorem with density 1/φ(q)1/\varphi(q)). The error-term refinements connect directly to the Riemann Hypothesis and zero-free regions. The same machinery — Euler product, logarithmic derivative, Tauberian inversion — underlies the Chebotarev Density Theorem and the Sato–Tate Conjecture. Finally, the Selberg–Erdős Elementary Proof (1948) shows PNT can be obtained without complex analysis, a celebrated alternative route.

Real-World Applications

🔬 Where this appears

Historical Development

⏳ History
- 1737 — Euler. Proves ∑p1/p\sum_p 1/p diverges and establishes the Euler product for ζ(s)\zeta(s), the first analytic link between primes and ζ\zeta.
- 1798 / 1808 — Legendre. Conjectures π(x)≈x/(log⁡x−B)\pi(x)\approx x/(\log x - B) with B≈1.08366B\approx1.08366 from numerical data.
- 1792–1849 — Gauss. Conjectures (in private notebooks, age 15) π(x)∼li⁡(x)\pi(x)\sim\operatorname{li}(x), the form that proved most accurate.
- 1852 — Chebyshev. Proves 0.921 x/log⁡x<π(x)<1.106 x/log⁡x0.921\,x/\log x < \pi(x) < 1.106\,x/\log x for large xx and that if π(x)/(x/log⁡x)\pi(x)/(x/\log x) has a limit, it is 11. Introduces ϑ,ψ\vartheta,\psi.
- 1859 — Riemann. Memoir on π(x)\pi(x): analytic continuation, functional equation, explicit formula, and the Riemann Hypothesis. Sets the program but proves no asymptotic.
- 1895 — von Mangoldt. Proves Riemann's explicit formula for ψ(x)\psi(x) rigorously, reducing PNT to the non-vanishing of ζ\zeta on Re⁡(s)=1\operatorname{Re}(s)=1.
- 1896 — Hadamard & de la Vallée Poussin (independently). Prove ζ(1+it)≠0\zeta(1+it)\neq0 and deduce PNT. De la Vallée Poussin adds the zero-free region and error O(xe−clog⁡x)O(xe^{-c\sqrt{\log x}}).
- 1948 — Selberg & Erdős. "Elementary" (no complex analysis) proof of PNT via Selberg's symmetry formula, sparking a famous priority dispute.
- 1980 — D. J. Newman. Drastically simplifies the analytic proof using a short contour-integral Tauberian theorem — now the standard graduate presentation.

Subtleties & Limits

open-problem

The qualitative PNT is settled; the frontier is the size of the error term, governed entirely by the location of zeta zeros.

  • Riemann Hypothesis. π(x)=li⁡(x)+O(xlog⁡x)\pi(x)=\operatorname{li}(x)+O(\sqrt{x}\log x) is equivalent to RH. Unproven; one of the Clay Millennium Problems.
  • Best unconditional zero-free region. The Vinogradov–Korobov region σ>1−c/(log⁡∣t∣)2/3(log⁡log⁡∣t∣)1/3\sigma>1-c/(\log|t|)^{2/3}(\log\log|t|)^{1/3} gives the current best error O(xexp⁡(−c(log⁡x)3/5(log⁡log⁡x)−1/5))O\big(x\exp(-c(\log x)^{3/5}(\log\log x)^{-1/5})\big) — still far from RH.
  • Sign changes (Littlewood/Skewes). Pinning the first crossing of π(x)=li⁡(x)\pi(x)=\operatorname{li}(x) and understanding the oscillation π(x)−li⁡(x)=Ω±(xlog⁡log⁡log⁡x/log⁡x)\pi(x)-\operatorname{li}(x)=\Omega_\pm(\sqrt{x}\log\log\log x/\log x) remains delicate.
  • Prime gaps. PNT gives average gap log⁡n\log n but not maximal/minimal gaps; the twin prime and bounded-gap problems (Zhang, Maynard) lie beyond it.
  • Effective constants. Making cc explicit and uniform in companion theorems (e.g. for LL-functions, Siegel zeros) is an active obstacle, e.g. the ineffectivity of Siegel's bound.

See Also

The Riemann Zeta Function · Wiener–Ikehara Tauberian Theorem · Dirichlet L-functions · Selberg–Erdős Elementary Proof · Mertens' Theorems · The Riemann Hypothesis · Chebyshev's Bounds · Explicit Formulae in Number Theory