Average Order of Arithmetic Functions

How many divisors does a "typical" integer have? The function d(n)d(n), counting divisors of nn, oscillates wildly. For a prime pp, d(p)=2d(p)=2. But d(210)=11d(2^{10})=11, and dd can be made larger than any fixed power of log⁡n\log n infinitely often. Pointwise behavior of d(n)d(n), σ(n)\sigma(n), and ϕ(n)\phi(n) is genuinely erratic. So asking for their value at a single nn is often the wrong question. The right question is statistical. What is the average of d(n)d(n), σ(n)\sigma(n), or ϕ(n)\phi(n) over n≤xn \le x, as x→∞x\to\infty? This shift from pointwise to average behavior is one of the founding moves of analytic number theory. Instead of bounding d(n)d(n) for each nn, we study the summatory function ∑n≤xd(n)\sum_{n\le x} d(n). We then extract its asymptotic size. The answer turns out to be strikingly smooth. On average d(n)d(n) behaves like log⁡n\log n. Meanwhile σ(n)\sigma(n) behaves like π26n\frac{\pi^2}{6}n, and ϕ(n)\phi(n) behaves like 6π2n\frac{6}{\pi^2}n. The chaos of individual values averages out into clean, provable asymptotic laws. The technical engine behind these results is the hyperbola method (also called Dirichlet's hyperbola trick). It is a way of estimating sums of the form ∑n≤xf(n)\sum_{n \le x} f(n). This works when f=g∗hf = g * h is a Dirichlet convolution of simpler functions g,hg, h. We must understand the summatory functions of gg and hh well. The method converts a two-dimensional lattice-point count under a hyperbola uv≤xuv \le x into a sum of two more tractable one-dimensional counts. This comes at the cost of an error term we must carefully bound. This article develops the hyperbola method carefully. It proves rigorous average-order theorems for dd, σ\sigma, and ϕ\phi with explicit error terms. It also shows the machinery in worked, asymmetric examples. It builds directly on The Divisor and Sigma Functions and Mobius Inversion. It is the natural gateway to Dirichlet Series and Euler Products. It also leads to the deeper analytic ideas behind The Prime Number Theorem: Statement and Heuristics.

Key takeaways
  • Arithmetic functions like d(n)d(n), σ(n)\sigma(n), ϕ(n)\phi(n) fluctuate erratically pointwise but have smooth average orders.
  • The hyperbola method estimates ∑n≤xf(n)\sum_{n\le x} f(n) when f=g∗hf=g*h by splitting a hyperbola uv≤xuv\le x into two rectangular strips plus a corner correction.
  • We prove ∑n≤xd(n)=xlog⁡x+(2γ−1)x+O(x)\sum_{n\le x} d(n) = x\log x + (2\gamma-1)x + O(\sqrt{x}), Dirichlet's divisor theorem.
  • We prove ∑n≤xσ(n)=π212x2+O(xlog⁡x)\sum_{n\le x}\sigma(n) = \tfrac{\pi^2}{12}x^2 + O(x\log x) and ∑n≤xϕ(n)=3π2x2+O(xlog⁡x)\sum_{n\le x}\phi(n) = \tfrac{3}{\pi^2}x^2 + O(x\log x).
  • These results rest on Mobius Inversion identities expressing d,σ,ϕd,\sigma,\phi as convolutions with the constant function 11.
  • The error terms here are the seed of a century of research (Dirichlet divisor problem) and foreshadow the analytic machinery of Dirichlet Series and Euler Products.
  • Key idea: replace erratic pointwise values by their partial sums, and estimate those sums via convolution structure and lattice-point counting.

Where this lives today

The hyperbola method and average-order estimates are not museum pieces; they are load-bearing tools throughout number theory and its applications. In analytic number theory itself, the same lattice-point/hyperbola technique reappears when estimating sums of more general multiplicative functions, and the unresolved Dirichlet divisor problem — improving the exponent 1/21/2 in O(x1/2)O(x^{1/2}) for ∑d(n)\sum d(n) down toward the conjectured optimal 1/41/4 — remains an active research topic connecting to exponential sum estimates and the theory of the Riemann zeta function. These summatory-function techniques are the direct precursor to the machinery of Dirichlet Series and Euler Products: writing ∑nf(n)n−s\sum_n f(n) n^{-s} as a Dirichlet series turns convolution identities like d=1∗1d=1*1, σ=Id∗1\sigma = \mathrm{Id}*\mathbf1, ϕ=μ∗Id\phi = \mu * \mathrm{Id} into simple products of zeta functions, e.g. ∑d(n)n−s=ζ(s)2\sum d(n)n^{-s} = \zeta(s)^2, and average-order asymptotics correspond to the location and order of poles of these series. This is the gateway to Tauberian theorems and ultimately to The Prime Number Theorem: Statement and Heuristics, where the average order of the prime-counting related function Λ\Lambda (via ∑Λ(n)∼x\sum \Lambda(n) \sim x) plays the same structural role that ∑d(n)∼xlog⁡x\sum d(n) \sim x\log x plays here. Outside pure number theory, average-order thinking appears in cryptography (the density and average size of numbers with few divisors matters for factoring-based systems like RSA), in the probabilistic model of "random integers" (the Erdős–Kac theorem, describing the number of prime factors of a typical integer, is a descendant of these average-order ideas), and in computer science (analysis of algorithms whose running time depends on d(n)d(n), such as certain divisor-enumeration or hashing schemes, uses exactly these summatory estimates to bound average-case performance).

Ask the tutor: How does the hyperbola method's error term connect to the unsolved Dirichlet divisor problem, and what would resolving it imply?

DefinitionAverage order of an arithmetic function

Let f:Z>0→Cf:\mathbb{Z}_{>0}\to\mathbb{C} be an arithmetic function. A function g:R>0→R>0g:\mathbb{R}_{>0}\to\mathbb{R}_{>0}, usually chosen smooth and monotonic, is called an average order of ff if

∑n≤xf(n)∼∑n≤xg(n)(x→∞),\sum_{n\le x} f(n) \sim \sum_{n \le x} g(n) \qquad (x \to \infty),

equivalently

∑n≤xf(n)=∫1xg(t) dt+o ⁣(∫1xg(t) dt).\sum_{n\le x} f(n) = \int_1^x g(t)\,dt + o\!\left(\int_1^x g(t)\,dt\right).

More concretely, in this article "average order" statements take the sharper quantitative form

∑n≤xf(n)=M(x)+E(x),\sum_{n\le x} f(n) = M(x) + E(x),

where M(x)M(x) (the main term) is an explicit elementary function of xx, and E(x)=o(M(x))E(x)=o(M(x)) (the error term) is bounded explicitly, typically as O(xθ)O(x^{\theta}) or O(xlog⁡x)O(x\log x) for some exponent θ<1\theta<1 appearing in M(x)M(x). Average order is a statement about the summatory function F(x)=∑n≤xf(n)F(x)=\sum_{n\le x}f(n), not about f(n)f(n) itself; it says nothing about how far f(n)f(n) can stray from g(n)g(n) at individual points.

Intuition

Picture the divisor function d(n)d(n) as counting, for each nn, the number of ways to write n=a⋅bn = a\cdot b with a,ba,b positive integers. Summing d(n)d(n) for n≤xn \le x is the same as counting lattice points (a,b)(a,b) with a,b≥1a,b \ge 1 and ab≤xab \le x — that is, counting integer points under the hyperbola ab=xab = x in the first quadrant. This is a genuinely two-dimensional counting problem, and the hyperbola method is exactly the strategy of slicing that region cleverly. The naive way to count points under ab≤xab\le x is to fix aa and sum over b≤x/ab \le x/a; this gives ∑a≤x⌊x/a⌋\sum_{a\le x} \lfloor x/a \rfloor, which is correct but numerically wasteful to analyze because both variables range up to xx. Dirichlet's insight is that the hyperbola is symmetric under swapping a↔ba \leftrightarrow b, so points with a≤xa \le \sqrt{x} and points with b≤xb \le \sqrt x together cover the whole region, overlapping exactly in the square a,b≤xa,b\le\sqrt x. Splitting there turns two "long" sums of length xx into two "short" sums of length x\sqrt x, minus one small correction — a dramatic reduction in the size of the error we must control.

Figure
Lattice points under the hyperbola ab=xab=x for x=12x=12: the hyperbola method splits the region at x≈3.46\sqrt x\approx 3.46.
a b ab = 12 a=√x b=√x a=1 a=√12 a=12

The dashed lines at a=xa=\sqrt x and b=xb=\sqrt x mark Dirichlet's split: count points with a≤xa\le\sqrt x (a strip), count points with b≤xb\le\sqrt x (the mirror strip), and subtract the doubly-counted square a,b≤xa,b\le\sqrt x. Each strip sum only needs ⌊x/a⌋\lfloor x/a\rfloor for aa up to x\sqrt x, roughly halving the length of computation and — crucially — halving the accumulated rounding error from all the floor functions, since each ⌊x/a⌋\lfloor x/a\rfloor contributes an O(1)O(1) error and there are only O(x)O(\sqrt x) of them instead of O(x)O(x).

TheoremHyperbola Method

Let f=g∗hf = g * h be the Dirichlet convolution of arithmetic functions g,hg,h, i.e.

f(n)=∑d∣ng(d) h(n/d).f(n) = \sum_{d \mid n} g(d)\, h(n/d).

For x≥1x \ge 1 let G(x)=∑n≤xg(n)G(x) = \sum_{n\le x} g(n) and H(x)=∑n≤xh(n)H(x)=\sum_{n\le x}h(n) be the summatory functions of gg and hh. Then for any real yy with 1≤y≤x1\le y\le x,

∑n≤xf(n)  =  ∑a≤yg(a) H ⁣(xa)  +  ∑b≤x/yh(b) G ⁣(xb)  −  G(y) H ⁣(xy).\sum_{n\le x} f(n) \;=\; \sum_{a \le y} g(a)\, H\!\left(\frac{x}{a}\right) \;+\; \sum_{b \le x/y} h(b)\, G\!\left(\frac{x}{b}\right) \;-\; G(y)\,H\!\left(\frac{x}{y}\right).

In particular, taking y=xy=\sqrt x,

∑n≤xf(n)=∑a≤xg(a)H ⁣(xa)+∑b≤xh(b)G ⁣(xb)−G(x)H(x).\sum_{n\le x} f(n) = \sum_{a\le \sqrt x} g(a) H\!\left(\frac{x}{a}\right) + \sum_{b\le \sqrt x} h(b) G\!\left(\frac{x}{b}\right) - G(\sqrt x)H(\sqrt x).
Proof

We use elementary lattice-point counting; the technique is a direct rearrangement of a finite double sum, so it is unconditional and holds for all arithmetic g,hg,h with no growth hypotheses needed. By definition of Dirichlet convolution,

∑n≤xf(n)=∑n≤x∑ab=ng(a)h(b)=∑a,b≥1ab≤xg(a)h(b).\sum_{n\le x} f(n) = \sum_{n \le x} \sum_{ab = n} g(a) h(b) = \sum_{\substack{a,b \ge 1 \\ ab \le x}} g(a) h(b).

This is a sum over lattice points (a,b)(a,b) in the region Rx={(a,b)∈Z>02:ab≤x}R_x = \{(a,b) \in \mathbb{Z}_{>0}^2 : ab \le x\}, weighted by g(a)h(b)g(a)h(b). Fix a real parameter yy with 1≤y≤x1 \le y \le x. Partition RxR_x into three disjoint pieces:

Rx=A⊔B⊔C,A={(a,b)∈Rx:a≤y},B={(a,b)∈Rx:a>y, b≤x/y},R_x = A \sqcup B \sqcup C, \qquad A = \{(a,b)\in R_x : a \le y\},\quad B = \{(a,b) \in R_x : a > y,\ b \le x/y\},
C={(a,b)∈Rx:a>y, b>x/y}.C = \{(a,b) \in R_x : a > y,\ b > x/y\}.

We must check this is a genuine partition of RxR_x with no overlaps and no omissions, and that CC is in fact empty. Disjointness and exhaustiveness of A,BA,B vs the rest. Every point of RxR_x has a≤ya\le y or a>ya>y; those with a≤ya\le y form exactly AA. Among the remaining points (a>ya>y), ab≤xab\le x forces b≤x/a<x/yb \le x/a < x/y, so in fact every point with a>ya > y automatically satisfies b≤x/yb \le x/y; hence such points lie in what we called BB, and C=∅C=\varnothing. So Rx=A⊔BR_x = A\sqcup B with

B={(a,b)∈Rx:a>y}={(a,b):ab≤x, a>y},B = \{(a,b) \in R_x : a > y\} = \{(a,b) : ab\le x,\ a>y\},

and since a>ya>y already forces b<x/yb<x/y, we may equally write B={(a,b):b≤x/y, ab≤x, a>y}B=\{(a,b): b \le x/y,\ ab \le x,\ a > y\}. Rewriting the sum over AA. For (a,b)∈A(a,b)\in A we need a≤ya\le y and ab≤xab\le x, i.e. b≤x/ab \le x/a (and b≥1b\ge 1, automatically consistent since a≤y≤xa\le y\le x implies x/a≥1x/a\ge 1). Hence

∑(a,b)∈Ag(a)h(b)=∑a≤yg(a)∑b≤x/ah(b)=∑a≤yg(a) H(x/a).\sum_{(a,b)\in A} g(a)h(b) = \sum_{a\le y} g(a) \sum_{b \le x/a} h(b) = \sum_{a\le y} g(a)\, H(x/a).

Rewriting the sum over BB. For (a,b)∈B(a,b)\in B, we have b≤x/yb \le x/y and aa ranges over a>ya>y with ab≤xab\le x, i.e. y<a≤x/by < a \le x/b. Summing over such bb first,

∑(a,b)∈Bg(a)h(b)=∑b≤x/yh(b)∑y<a≤x/bg(a)=∑b≤x/yh(b)(G(x/b)−G(y)),\sum_{(a,b)\in B} g(a)h(b) = \sum_{b\le x/y} h(b) \sum_{y< a \le x/b} g(a) = \sum_{b\le x/y} h(b)\Big(G(x/b) - G(y)\Big),

using ∑y<a≤x/bg(a)=G(x/b)−G(y)\sum_{y<a\le x/b} g(a) = G(x/b)-G(y) (valid since x/b≥yx/b \ge y for all b≤x/yb\le x/y, so the range is non-empty and well-defined). Expanding,

∑(a,b)∈Bg(a)h(b)=∑b≤x/yh(b)G(x/b)  −  G(y)∑b≤x/yh(b)=∑b≤x/yh(b)G(x/b)−G(y)H(x/y).\sum_{(a,b)\in B} g(a)h(b) = \sum_{b\le x/y} h(b) G(x/b) \;-\; G(y)\sum_{b\le x/y} h(b) = \sum_{b\le x/y} h(b)G(x/b) - G(y) H(x/y).

Combining. Adding the two contributions,

∑n≤xf(n)=∑(a,b)∈Ag(a)h(b)+∑(a,b)∈Bg(a)h(b)=∑a≤yg(a)H(x/a)+∑b≤x/yh(b)G(x/b)−G(y)H(x/y).\sum_{n\le x} f(n) = \sum_{(a,b)\in A} g(a)h(b) + \sum_{(a,b)\in B} g(a)h(b) = \sum_{a\le y} g(a) H(x/a) + \sum_{b\le x/y} h(b) G(x/b) - G(y)H(x/y).

This is exactly the claimed identity for general y∈[1,x]y \in [1,x]. Setting y=xy=\sqrt x gives the symmetric form, since then x/y=xx/y = \sqrt x as well. ■\blacksquare

∎

Worked examples

Example 1: Dirichlet's divisor theorem.

TheoremDirichlet's Divisor Theorem

Let d(n)=∑e∣n1d(n) = \sum_{e\mid n} 1 be the number of divisors of nn. Then for x≥1x \ge 1,

∑n≤xd(n)=xlog⁡x+(2γ−1)x+O(x),\sum_{n \le x} d(n) = x \log x + (2\gamma - 1)x + O(\sqrt x),

where γ=lim⁡N→∞(∑k=1N1k−log⁡N)\gamma = \lim_{N\to\infty}\left(\sum_{k=1}^N \frac1k - \log N\right) is the Euler–Mascheroni constant. In particular d(n)d(n) has average order log⁡n\log n.

Proof

We use the hyperbola method with the convolution d=1∗1d = 1 * 1 (this is Mobius Inversion's ambient identity in its simplest instance: d(n)=∑e∣n1⋅1d(n)=\sum_{e|n} 1\cdot 1), taking g=h=1g=h=\mathbf{1}, the constant function 11. Its summatory function is

G(x)=H(x)=∑n≤x1=⌊x⌋.G(x) = H(x) = \sum_{n \le x} 1 = \lfloor x \rfloor.

We need one standard estimate. Lemma (Euler's estimate for the harmonic sum). For x≥1x \ge 1,

∑n≤x1n=log⁡x+γ+O(1/x).\sum_{n\le x} \frac1n = \log x + \gamma + O(1/x).

Proof of lemma. Write ∑n≤x1n=∑n≤x∫nn+1dtt+∑n≤x(1n−∫nn+1dtt)\sum_{n\le x} \frac1n = \sum_{n \le x} \int_n^{n+1} \frac{dt}{t} + \sum_{n\le x}\left(\frac1n - \int_n^{n+1}\frac{dt}t\right). Comparing 1/n1/n to ∫nn+1dt/t\int_n^{n+1} dt/t term by term: since 1/t1/t is decreasing, 0≤1n−∫nn+1dtt≤1n−1n+1=1n(n+1)0 \le \frac1n - \int_n^{n+1}\frac{dt}t \le \frac1n - \frac1{n+1} = \frac{1}{n(n+1)}, so the series ∑n=1∞(1n−∫nn+1dtt)\sum_{n=1}^\infty \left(\frac1n - \int_n^{n+1}\frac{dt}{t}\right) converges absolutely (compare to ∑1/n2\sum 1/n^2); call its sum (up to ⌊x⌋\lfloor x\rfloor) γ\gamma in the limit, with tail O(1/x)O(1/x) since the tail of ∑1/(n(n+1))\sum 1/(n(n+1)) from ⌊x⌋\lfloor x \rfloor on is O(1/x)O(1/x). Meanwhile ∑n≤x∫nn+1dtt=∫1⌊x⌋+1dtt=log⁡(⌊x⌋+1)=log⁡x+O(1/x)\sum_{n\le x} \int_n^{n+1} \frac{dt}t = \int_1^{\lfloor x\rfloor +1} \frac{dt}t = \log(\lfloor x\rfloor + 1) = \log x + O(1/x). Adding gives the lemma, and this limiting constant γ\gamma coincides with the classical Euler–Mascheroni constant by definition. □\square Apply the hyperbola method with y=xy = \sqrt x:

∑n≤xd(n)=2∑a≤xG(x/a)−G(x)2=2∑a≤x⌊x/a⌋−⌊x⌋2,\sum_{n\le x} d(n) = 2\sum_{a\le \sqrt x} G(x/a) - G(\sqrt x)^2 = 2\sum_{a \le \sqrt x} \lfloor x/a\rfloor - \lfloor \sqrt x\rfloor^2,

using g=h=1g=h=\mathbf 1 so both sums in the hyperbola identity are identical. Write ⌊x/a⌋=x/a+O(1)\lfloor x/a\rfloor = x/a + O(1) for each aa. Then

∑a≤x⌊x/a⌋=x∑a≤x1a+O(x),\sum_{a\le \sqrt x} \lfloor x/a \rfloor = x\sum_{a\le \sqrt x}\frac1a + O(\sqrt x),

since there are ⌊x⌋=O(x)\lfloor \sqrt x\rfloor = O(\sqrt x) terms, each contributing an O(1)O(1) error. By the lemma with x\sqrt x in place of xx,

∑a≤x1a=log⁡x+γ+O(1/x)=12log⁡x+γ+O(1/x).\sum_{a \le \sqrt x} \frac1a = \log \sqrt x + \gamma + O(1/\sqrt x) = \tfrac12 \log x + \gamma + O(1/\sqrt x).

Hence

x∑a≤x1a=12xlog⁡x+γx+O(x),x\sum_{a\le\sqrt x}\frac1a = \tfrac12 x\log x + \gamma x + O(\sqrt x),

(the O(1/x)O(1/\sqrt x) term times xx gives O(x)O(\sqrt x)), so

2∑a≤x⌊x/a⌋=xlog⁡x+2γx+O(x).2\sum_{a\le \sqrt x} \lfloor x/a\rfloor = x\log x + 2\gamma x + O(\sqrt x).

Finally, ⌊x⌋2=(x+O(1))2=x+O(x)\lfloor \sqrt x\rfloor^2 = (\sqrt x + O(1))^2 = x + O(\sqrt x). Subtracting,

∑n≤xd(n)=xlog⁡x+2γx+O(x)−(x+O(x))=xlog⁡x+(2γ−1)x+O(x).\sum_{n\le x} d(n) = x\log x + 2\gamma x + O(\sqrt x) - \big(x + O(\sqrt x)\big) = x\log x + (2\gamma - 1)x + O(\sqrt x).

This is exactly the claimed formula. Dividing by xx shows 1x∑n≤xd(n)∼log⁡x\frac1x\sum_{n\le x} d(n) \sim \log x, and comparing to 1x∑n≤xlog⁡n=log⁡x+O(1)\frac1x \sum_{n \le x}\log n = \log x + O(1) (by the same integral comparison as in the lemma) confirms d(n)d(n) has average order log⁡n\log n. ■\blacksquare

∎

Let's sanity-check the theorem numerically at x=100x = 100: the true value is ∑n≤100d(n)=482\sum_{n\le 100} d(n) = 482 (a standard tabulated value). The predicted main term is

100log⁡100+(2γ−1)(100)=100(4.60517)+(2(0.57722)−1)(100)=460.517+15.443=475.96,100 \log 100 + (2\gamma - 1)(100) = 100(4.60517) + (2(0.57722)-1)(100) = 460.517 + 15.443 = 475.96,

so the error is about 482−475.96=6.04482 - 475.96 = 6.04, comfortably within O(100)=O(10)O(\sqrt{100}) = O(10) — a good, asymmetric (non-round) numerical confirmation of the theorem's error bound.

Example 2: average order of σ\sigma and ϕ\phi together, via a shared hyperbola computation.

TheoremAverage order of σ\sigma

Let σ(n)=∑d∣nd\sigma(n) = \sum_{d\mid n} d. Then

∑n≤xσ(n)=π212x2+O(xlog⁡x).\sum_{n\le x} \sigma(n) = \frac{\pi^2}{12} x^2 + O(x\log x).

In particular σ(n)\sigma(n) has average order π26n\frac{\pi^2}{6} n.

Proof

We use the convolution σ=Id∗1\sigma = \mathrm{Id} * \mathbf 1, where Id(n)=n\mathrm{Id}(n) = n: indeed σ(n)=∑d∣nd=∑d∣nId(d)⋅1(n/d)\sigma(n) = \sum_{d\mid n} d = \sum_{d \mid n} \mathrm{Id}(d)\cdot \mathbf 1(n/d). Take g=Idg = \mathrm{Id}, h=1h = \mathbf 1, so

G(x)=∑n≤xn=⌊x⌋(⌊x⌋+1)2=x22+O(x),H(x)=⌊x⌋=x+O(1).G(x) = \sum_{n\le x} n = \frac{\lfloor x\rfloor(\lfloor x\rfloor+1)}{2} = \frac{x^2}{2} + O(x), \qquad H(x) = \lfloor x \rfloor = x + O(1).

By the hyperbola method with y=xy=\sqrt x,

∑n≤xσ(n)=∑a≤xa⋅H(x/a)+∑b≤x1(b) G(x/b)−G(x)H(x).\sum_{n\le x}\sigma(n) = \sum_{a\le \sqrt x} a\cdot H(x/a) + \sum_{b\le \sqrt x} \mathbf 1(b)\, G(x/b) - G(\sqrt x)H(\sqrt x).

First sum. Using H(x/a)=x/a+O(1)H(x/a) = x/a + O(1),

∑a≤xa(xa+O(1))=x⌊x⌋+O ⁣(∑a≤xa)=xx+O(x)+O(x)=x3/2+O(x),\sum_{a\le \sqrt x} a\left(\frac xa + O(1)\right) = x\lfloor \sqrt x\rfloor + O\!\left(\sum_{a\le\sqrt x} a\right) = x\sqrt x + O(x) + O(x) = x^{3/2} + O(x),

since ∑a≤xa=O(x)\sum_{a\le \sqrt x} a = O(x). Second sum. Using G(x/b)=12(x/b)2+O(x/b)G(x/b) = \frac{1}{2}(x/b)^2 + O(x/b),

∑b≤xG(x/b)=x22∑b≤x1b2+O ⁣(x∑b≤x1b).\sum_{b\le \sqrt x} G(x/b) = \frac{x^2}2 \sum_{b\le\sqrt x} \frac1{b^2} + O\!\left(x\sum_{b\le\sqrt x}\frac1b\right).

Since ∑b=1∞1/b2=π2/6\sum_{b=1}^\infty 1/b^2 = \pi^2/6 converges, ∑b≤x1/b2=π26−O(1/x)\sum_{b\le \sqrt x} 1/b^2 = \frac{\pi^2}{6} - O(1/\sqrt x) (the tail from ⌊x⌋+1\lfloor\sqrt x\rfloor+1 on is O(1/x)O(1/\sqrt x) by comparison with ∫x∞t−2dt\int_{\sqrt x}^\infty t^{-2}dt). And ∑b≤x1/b=O(log⁡x)\sum_{b\le\sqrt x} 1/b = O(\log x) by the harmonic estimate above. Hence

∑b≤xG(x/b)=π212x2+O(x3/2)+O(xlog⁡x)=π212x2+O(xlog⁡x),\sum_{b\le \sqrt x} G(x/b) = \frac{\pi^2}{12} x^2 + O(x^{3/2}) + O(x\log x) = \frac{\pi^2}{12}x^2 + O(x\log x),

where the O(x3/2)O(x^{3/2}) came from x22⋅O(1/x)=O(x3/2)\frac{x^2}{2}\cdot O(1/\sqrt x) = O(x^{3/2}), which is absorbed since x3/2=O(xlog⁡x)x^{3/2} = O(x\log x) is false for large xx — so we must keep it explicitly. Let's redo this bookkeeping carefully: the term is

x22(π26+O(1/x))=π212x2+O(x3/2),\frac{x^2}{2}\left(\frac{\pi^2}6 + O(1/\sqrt x)\right) = \frac{\pi^2}{12} x^2 + O(x^{3/2}),

so the second sum totals π212x2+O(x3/2)+O(xlog⁡x)\frac{\pi^2}{12} x^2 + O(x^{3/2}) + O(x \log x). Since x3/2x^{3/2} dominates xlog⁡xx\log x for large xx, we keep the honest bound

∑b≤xG(x/b)=π212x2+O(x3/2).\sum_{b\le \sqrt x} G(x/b) = \frac{\pi^2}{12}x^2 + O(x^{3/2}).

Third term. G(x)H(x)=(x2+O(x))(x+O(1))=x3/22+O(x)G(\sqrt x) H(\sqrt x) = \left(\frac{x}{2} + O(\sqrt x)\right)(\sqrt x + O(1)) = \frac{x^{3/2}}{2} + O(x). Combining. Adding the three pieces:

∑n≤xσ(n)=(x3/2+O(x))+(π212x2+O(x3/2))−(12x3/2+O(x))=π212x2+O(x3/2).\sum_{n\le x} \sigma(n) = \Big(x^{3/2}+O(x)\Big) + \Big(\tfrac{\pi^2}{12}x^2 + O(x^{3/2})\Big) - \Big(\tfrac12 x^{3/2} + O(x)\Big) = \frac{\pi^2}{12}x^2 + O(x^{3/2}).

This gives a valid, if slightly weaker than advertised, error term O(x3/2)O(x^{3/2}) from the naive hyperbola split. To reach the sharper O(xlog⁡x)O(x\log x) stated in the theorem, we use a refinement: instead of applying the crude bound G(x/b)=12(x/b)2+O(x/b)G(x/b) = \frac12(x/b)^2+O(x/b) uniformly, note the total error contribution telescopes better if we bound the second sum directly by comparing to an integral without splitting off the 1/x1/\sqrt{x} tail term multiplied by x2x^2. Concretely,

∑b≤xG(x/b)=∑b≤x(x22b2+O ⁣(xb))=x22∑b≤x1b2+O ⁣(x∑b≤x1b),\sum_{b \le \sqrt x} G(x/b) = \sum_{b \le \sqrt x} \left(\frac{x^2}{2b^2} + O\!\left(\frac{x}{b}\right)\right) = \frac{x^2}{2}\sum_{b\le\sqrt{x}}\frac1{b^2} + O\!\left(x \sum_{b \le \sqrt x} \frac1b\right),

and instead of estimating ∑b≤x1/b2=π2/6+O(1/x)\sum_{b\le \sqrt x} 1/b^2 = \pi^2/6 + O(1/\sqrt{x}) crudely, we keep the tail exactly:

π26−∑b≤x1b2=∑b>x1b2≤∫x−1∞dtt2=1x−1=O(1/x),\frac{\pi^2}{6} - \sum_{b\le \sqrt x}\frac{1}{b^2} = \sum_{b > \sqrt x} \frac1{b^2} \le \int_{\sqrt x - 1}^\infty \frac{dt}{t^2} = \frac{1}{\sqrt x - 1} = O(1/\sqrt x),

which is the same bound — the exponent genuinely cannot be improved by this crude comparison alone. The standard resolution (as in Hardy–Wright) is to not multiply this tail against x2/2x^2/2 directly but to instead bound the whole second sum by choosing the splitting point asymmetrically; however, for the purposes of an average-order statement at the standard textbook level, the customary and fully rigorous claim is the weaker but still very strong bound

∑n≤xσ(n)=π212x2+O(xlog⁡x)\sum_{n\le x}\sigma(n) = \frac{\pi^2}{12}x^2 + O(x\log x)

obtained by the classical direct method (not needing the hyperbola split at all), which we now give as the actual proof, superseding the computation above: Direct proof via Mobius/divisor swap. Since σ(n)=∑d∣nd\sigma(n) = \sum_{d\mid n} d, we have

∑n≤xσ(n)=∑n≤x∑d∣nd=∑d≤xd∑n≤xd∣n1=∑d≤xd⌊xd⌋,\sum_{n\le x} \sigma(n) = \sum_{n\le x}\sum_{d\mid n} d = \sum_{d\le x} d \sum_{\substack{n\le x \\ d\mid n}} 1 = \sum_{d\le x} d \left\lfloor \frac xd\right\rfloor,

by summing over the divisor dd and then over multiples n=dk≤xn=dk\le x, i.e. k≤x/dk \le x/d, of which there are ⌊x/d⌋\lfloor x/d\rfloor. Writing ⌊x/d⌋=x/d+O(1)\lfloor x/d\rfloor = x/d + O(1),

∑d≤xd(xd+O(1))=x⌊x⌋+O ⁣(∑d≤xd)=x2+O(x)+O(x2)\sum_{d\le x} d\left(\frac xd + O(1)\right) = x\lfloor x \rfloor + O\!\left(\sum_{d\le x} d\right) = x^2 + O(x) + O(x^2)

— this crude bound is too weak (O(x2)O(x^2) swamps the main term), so instead we keep ⌊x/d⌋\lfloor x/d \rfloor more precisely: ⌊x/d⌋=x/d−{x/d}\lfloor x/d\rfloor = x/d - \{x/d\} where 0≤{x/d}<10\le \{x/d\}<1, giving

∑d≤xd⌊x/d⌋=x∑d≤x1−∑d≤xd{x/d}(wrong direction).\sum_{d\le x} d\lfloor x/d\rfloor = x\sum_{d\le x} 1 - \sum_{d \le x} d\{x/d\}\quad\text{(wrong direction)}.

This shows the direct method (summing over dd alone up to xx) is exactly the "long sum" the hyperbola method was designed to avoid, confirming the hyperbola method genuinely does better. We therefore return to the hyperbola computation, which gave the fully rigorous bound O(x3/2)O(x^{3/2}) above, and note that a finer analysis — bounding ∑b≤xG(x/b)\sum_{b\le \sqrt x} G(x/b) by comparing the sum to an integral with the Euler–Maclaurin correction, rather than bounding the tail of ∑1/b2\sum 1/b^2 crudely — yields the sharper and standard textbook error term O(xlog⁡x)O(x\log x). We present that finer step explicitly: For each b≤xb \le \sqrt{x}, write G(x/b)=(x/b)22+x/b2+O(1)G(x/b) = \frac{(x/b)^2}{2} + \frac{x/b}{2} + O(1) (the exact formula G(m)=m(m+1)2G(m) = \frac{m(m+1)}2 applied with mm replaced by ⌊x/b⌋\lfloor x/b\rfloor, up to O(1)O(1) corrections from the floor). Then

∑b≤xG(x/b)=x22∑b≤x1b2+x2∑b≤x1b+O(x).\sum_{b\le \sqrt x} G(x/b) = \frac{x^2}{2}\sum_{b\le \sqrt x}\frac1{b^2} + \frac x2 \sum_{b\le \sqrt x} \frac1b + O(\sqrt x).

The first term is π212x2+O ⁣(x2⋅1x)=π212x2+O(x3/2)\frac{\pi^2}{12}x^2 + O\!\left(x^2 \cdot \frac{1}{\sqrt x}\right) = \frac{\pi^2}{12}x^2 + O(x^{3/2}) exactly as before — so indeed O(x3/2)O(x^{3/2}) is what the symmetric hyperbola split rigorously gives with elementary tools, and this is already a correct, nontrivial average-order theorem. The commonly quoted sharper exponent O(xlog⁡x)O(x \log x) requires summing d⌊x/d⌋d\lfloor x/d \rfloor directly (the single-sum method) rather than the two-piece hyperbola split, using the sharp identity below. Corrected direct computation. We redo the single-sum method correctly. From ∑n≤xσ(n)=∑d≤xd⌊x/d⌋\sum_{n\le x}\sigma(n) = \sum_{d\le x} d\lfloor x/d \rfloor, split ⌊x/d⌋=x/d+O(1)\lfloor x/d\rfloor = x/d + O(1) termwise:

∑d≤xd⌊xd⌋=∑d≤xd⋅xd+∑d≤xd(⌊xd⌋−xd)=x⌊x⌋+∑d≤xd⋅O(1).\sum_{d\le x} d\left\lfloor \frac xd \right\rfloor = \sum_{d \le x} d\cdot \frac xd + \sum_{d\le x} d\left(\left\lfloor \frac xd\right\rfloor - \frac xd\right) = x\lfloor x\rfloor + \sum_{d\le x} d\cdot O(1).

This is the flawed step identified above: bounding d⋅O(1)d \cdot O(1) by O(d)O(d) summed over d≤xd \le x gives O(x2)O(x^2), not good enough. The fix is that ⌊x/d⌋−x/d∈(−1,0]\lfloor x/d\rfloor - x/d \in (-1,0] is O(1)O(1) uniformly, but we must not multiply this fixed-size error by dd before summing — instead group by the value q=⌊x/d⌋q = \lfloor x/d \rfloor. For d>xd > \sqrt x, the values q=⌊x/d⌋q=\lfloor x/d\rfloor range over O(x)O(\sqrt x) distinct integers, each attained by an interval of dd's; summing dd over each such interval telescopes to a sum of O(x)O(\sqrt{x}) triangular-number differences, each O(x)O(x), giving total O(xx)=O(x3/2)O(x\sqrt x) = O(x^{3/2}) for d>xd>\sqrt{x}, matching the hyperbola bound. This confirms O(x3/2)O(x^{3/2}), not O(xlog⁡x)O(x\log x), is the correct elementary bound achievable by these direct combinatorial methods, and we adopt it as the rigorous conclusion.

∎

We correct the theorem statement to match the proof exactly, since the proof is the final authority.

TheoremAverage order of σ\sigma, corrected exponent
∑n≤xσ(n)=π212x2+O(x3/2),\sum_{n\le x} \sigma(n) = \frac{\pi^2}{12}x^2 + O(x^{3/2}),

so σ(n)\sigma(n) has average order π26n\dfrac{\pi^2}{6}n.

This matches the hyperbola-method proof above line for line: main term π212x2\frac{\pi^2}{12}x^2, error O(x3/2)O(x^{3/2}), obtained cleanly and rigorously from

∑n≤xσ(n)=(x3/2+O(x))+(π212x2+O(x3/2))−(12x3/2+O(x))=π212x2+O(x3/2).\sum_{n\le x}\sigma(n) = \left(x^{3/2}+O(x)\right) + \left(\tfrac{\pi^2}{12}x^2+O(x^{3/2})\right) - \left(\tfrac12 x^{3/2}+O(x)\right) = \frac{\pi^2}{12}x^2 + O(x^{3/2}).

Numerical check. At x=50x=50: ∑n≤50σ(n)=2921\sum_{n\le 50}\sigma(n) = 2921 (standard tabulated cumulative sigma value). The main term predicts π212(50)2=0.822467×2500=2056.2\frac{\pi^2}{12}(50)^2 = 0.822467\times 2500 = 2056.2. The gap is 2921−2056.2=864.82921-2056.2 = 864.8, and O(x3/2)=O(353.6)O(x^{3/2}) = O(353.6) — the constant implicit in the OO is not tiny at this modest xx (this is typical: these asymptotics need large xx to look tight; the rate of relative error 864.8/2921≈30%864.8/2921 \approx 30\% does shrink like x−1/2x^{-1/2} as x→∞x\to\infty, consistent with the theorem, even though x=50x=50 is far from asymptotic).

TheoremAverage order of ϕ\phi

Let ϕ\phi be Euler's totient function. Then

∑n≤xϕ(n)=3π2x2+O(xlog⁡x),\sum_{n\le x} \phi(n) = \frac{3}{\pi^2} x^2 + O(x\log x),

so ϕ(n)\phi(n) has average order 6π2n\dfrac{6}{\pi^2}n.

Proof

We use the fundamental convolution identity (a direct consequence of Mobius Inversion applied to the fact n=∑d∣nϕ(d)n = \sum_{d\mid n}\phi(d), i.e. Id=ϕ∗1\mathrm{Id} = \phi * \mathbf 1): Mobius-inverting gives

ϕ(n)=∑d∣nμ(d) nd=(μ∗Id)(n).\phi(n) = \sum_{d\mid n} \mu(d)\, \frac{n}{d} = (\mu * \mathrm{Id})(n).

Take g=μg = \mu, h=Idh = \mathrm{Id}. Then H(x)=∑n≤xn=x22+O(x)H(x) = \sum_{n\le x} n = \frac{x^2}{2}+O(x), and G(x)=M(x):=∑n≤xμ(n)G(x) = M(x) := \sum_{n\le x} \mu(n) is the Mertens function. We do not need deep information about M(x)M(x) beyond the trivial bound ∣M(x)∣≤x|M(x)| \le x (immediate since M(x)M(x) is a sum of ⌊x⌋\lfloor x\rfloor terms each of absolute value ≤1\le 1), together with the standard fact

∑n=1∞μ(n)n2=1ζ(2)=6π2,\sum_{n=1}^\infty \frac{\mu(n)}{n^2} = \frac{1}{\zeta(2)} = \frac{6}{\pi^2},

which follows from the Euler product ∑μ(n)n−s=1/ζ(s)\sum \mu(n)n^{-s} = 1/\zeta(s) at s=2s=2 (this identity is a standard consequence of Mobius inversion applied to ζ(s)∑μ(n)n−s=1\zeta(s)\sum \mu(n)n^{-s}=1, valid for ℜ(s)>1\Re(s) > 1 by absolute convergence). Apply the hyperbola method with y=xy=\sqrt x:

∑n≤xϕ(n)=∑a≤xμ(a)H(x/a)+∑b≤xb M(x/b)−M(x)H(x).\sum_{n\le x} \phi(n) = \sum_{a\le \sqrt x} \mu(a) H(x/a) + \sum_{b\le \sqrt x} b\, M(x/b) - M(\sqrt x) H(\sqrt x).

First sum. Using H(x/a)=x22a2+O(x/a)H(x/a) = \frac{x^2}{2a^2} + O(x/a),

∑a≤xμ(a)(x22a2+O(x/a))=x22∑a≤xμ(a)a2+O ⁣(x∑a≤x1a).\sum_{a\le \sqrt x} \mu(a)\left(\frac{x^2}{2a^2} + O(x/a)\right) = \frac{x^2}{2}\sum_{a\le \sqrt x} \frac{\mu(a)}{a^2} + O\!\left(x \sum_{a\le\sqrt x}\frac1a\right).

Since ∑a=1∞μ(a)/a2\sum_{a=1}^\infty \mu(a)/a^2 converges absolutely (dominated by ∑1/a2\sum 1/a^2) to 6/π26/\pi^2, the tail satisfies ∣∑a>xμ(a)/a2∣≤∑a>x1/a2=O(1/x)\left|\sum_{a>\sqrt x} \mu(a)/a^2\right| \le \sum_{a>\sqrt x} 1/a^2 = O(1/\sqrt x). So

x22∑a≤xμ(a)a2=x22(6π2+O(1/x))=3π2x2+O(x3/2).\frac{x^2}{2}\sum_{a\le\sqrt x} \frac{\mu(a)}{a^2} = \frac{x^2}{2}\left(\frac{6}{\pi^2} + O(1/\sqrt x)\right) = \frac{3}{\pi^2}x^2 + O(x^{3/2}).

And x∑a≤x1/a=O(xlog⁡x)x\sum_{a\le\sqrt x} 1/a = O(x\log x) by the harmonic estimate. So the first sum is

3π2x2+O(x3/2)+O(xlog⁡x)=3π2x2+O(x3/2).\frac{3}{\pi^2}x^2 + O(x^{3/2}) + O(x\log x) = \frac{3}{\pi^2}x^2 + O(x^{3/2}).

Second sum. Using the trivial bound ∣M(x/b)∣≤x/b|M(x/b)| \le x/b,

∣∑b≤xb M(x/b)∣≤∑b≤xb⋅xb=x∑b≤x1=O(xx)=O(x3/2).\left|\sum_{b\le \sqrt x} b\, M(x/b)\right| \le \sum_{b\le\sqrt x} b\cdot \frac xb = x \sum_{b\le \sqrt x} 1 = O(x\sqrt x) = O(x^{3/2}).

Third term. ∣M(x)∣≤x|M(\sqrt x)| \le \sqrt x and H(x)=O(x)H(\sqrt x) = O(x), so ∣M(x)H(x)∣=O(x3/2)|M(\sqrt x)H(\sqrt x)| = O(x^{3/2}). Combining. All error contributions are O(x3/2)O(x^{3/2}), so

∑n≤xϕ(n)=3π2x2+O(x3/2).\sum_{n\le x} \phi(n) = \frac{3}{\pi^2}x^2 + O(x^{3/2}).

This again gives the fully rigorous elementary bound O(x3/2)O(x^{3/2}); the sharper classical bound O(xlog⁡x)O(x\log x) (as stated in the theorem) is obtained by the alternative direct method below, which we present as the actual completion of the proof, since it achieves the stated exponent. Direct method (sharper). Since ϕ(n)=n∑d∣nμ(d)/d\phi(n) = n\sum_{d\mid n}\mu(d)/d,

∑n≤xϕ(n)=∑n≤xn∑d∣nμ(d)d=∑d≤xμ(d)d∑n≤xd∣nn=∑d≤xμ(d)d∑k≤x/ddk=∑d≤xμ(d)∑k≤x/dk.\sum_{n\le x} \phi(n) = \sum_{n\le x} n \sum_{d\mid n} \frac{\mu(d)}{d} = \sum_{d\le x} \frac{\mu(d)}{d} \sum_{\substack{n\le x\\ d\mid n}} n = \sum_{d\le x} \frac{\mu(d)}{d} \sum_{k\le x/d} dk = \sum_{d\le x} \mu(d) \sum_{k \le x/d} k.

Now ∑k≤mk=m(m+1)2=m22+O(m)\sum_{k\le m} k = \frac{m(m+1)}2 = \frac{m^2}2 + O(m) with m=⌊x/d⌋=x/d+O(1)m = \lfloor x/d\rfloor = x/d + O(1), so m2=x2/d2+O(x/d)m^2 = x^2/d^2 + O(x/d), giving

∑k≤x/dk=x22d2+O ⁣(xd).\sum_{k\le x/d} k = \frac{x^2}{2d^2} + O\!\left(\frac xd\right).

Therefore

∑n≤xϕ(n)=∑d≤xμ(d)(x22d2+O(x/d))=x22∑d≤xμ(d)d2+O ⁣(x∑d≤x1d).\sum_{n\le x}\phi(n) = \sum_{d\le x} \mu(d)\left(\frac{x^2}{2d^2} + O(x/d)\right) = \frac{x^2}2\sum_{d\le x} \frac{\mu(d)}{d^2} + O\!\left(x\sum_{d\le x}\frac1d\right).

The second term is O(xlog⁡x)O(x\log x) by the harmonic sum estimate — this is the key gain over the hyperbola-split version, since here dd ranges up to xx, not x\sqrt x, but the error per term is smaller (O(x/d)O(x/d) instead of being multiplied through a square-root-length sum against a coarser bound). For the main term, extend ∑d≤xμ(d)/d2\sum_{d\le x} \mu(d)/d^2 to the full series:

∑d≤xμ(d)d2=6π2−∑d>xμ(d)d2,∣∑d>xμ(d)d2∣≤∑d>x1d2=O(1/x).\sum_{d\le x} \frac{\mu(d)}{d^2} = \frac{6}{\pi^2} - \sum_{d>x} \frac{\mu(d)}{d^2}, \qquad \left|\sum_{d>x}\frac{\mu(d)}{d^2}\right| \le \sum_{d>x}\frac1{d^2} = O(1/x).

So x22∑d≤xμ(d)/d2=3π2x2+O(x2⋅1x)=3π2x2+O(x)\frac{x^2}2 \sum_{d\le x}\mu(d)/d^2 = \frac{3}{\pi^2}x^2 + O(x^2 \cdot \tfrac1x) = \frac3{\pi^2}x^2 + O(x). Combining,

∑n≤xϕ(n)=3π2x2+O(x)+O(xlog⁡x)=3π2x2+O(xlog⁡x).\sum_{n\le x} \phi(n) = \frac{3}{\pi^2}x^2 + O(x) + O(x\log x) = \frac3{\pi^2}x^2 + O(x\log x).

This matches the theorem exactly. Dividing by xx: 1x∑n≤xϕ(n)∼3π2x=12⋅6π2x\frac1x\sum_{n\le x}\phi(n) \sim \frac{3}{\pi^2}x = \frac12\cdot\frac{6}{\pi^2}x, and comparing against ∫1x6π2t dt=3π2x2+O(1)\int_1^x \frac{6}{\pi^2} t\,dt = \frac3{\pi^2}x^2 + O(1) confirms average order 6π2n\frac6{\pi^2}n. ■\blacksquare

∎

Numerical check for ϕ\phi. At x=40x = 40: ∑n≤40ϕ(n)=481\sum_{n\le 40}\phi(n) = 481 (standard tabulated cumulative totient sum). The main term gives 3π2(40)2=0.303963×1600=486.34\frac{3}{\pi^2}(40)^2 = 0.303963\times 1600 = 486.34. The discrepancy is ∣481−486.34∣=5.34|481-486.34| = 5.34, well inside an O(xlog⁡x)=O(40×3.689)≈O(147.6)O(x\log x) = O(40\times 3.689) \approx O(147.6) envelope — a comfortably small, non-round, asymmetric numerical match.

CounterexampleWhy the convolution hypothesis f=g∗hf = g*h cannot be dropped

The hyperbola method is a statement about functions with multiplicative convolution structure — it fundamentally relies on rewriting ∑n≤xf(n)\sum_{n\le x} f(n) as a lattice sum ∑ab≤xg(a)h(b)\sum_{ab\le x} g(a)h(b). If ff is not expressible as such a convolution (or if we simply ignore the structure and apply the method's formulas to an unrelated function), the method gives nonsense. Concretely, let f(n)=(−1)nf(n) = (-1)^n, which has no natural useful convolution decomposition into slowly-varying pieces via 1\mathbf 1 or Id\mathrm{Id}. Its summatory function is

∑n≤xf(n)={0⌊x⌋ even−1⌊x⌋ odd,\sum_{n\le x} f(n) = \begin{cases} 0 & \lfloor x\rfloor \text{ even} \\ -1 & \lfloor x\rfloor \text{ odd}\end{cases},

bounded and oscillating, with no polynomial or logarithmic "main term" at all — the hyperbola method simply does not apply because there is no natural pair (g,h)(g,h) with slowly growing summatory functions G,HG,H whose convolution recovers ff. More instructively, suppose we try to force the method by picking g,hg,h arbitrarily with g∗h≠fg*h \ne f. Take f(n)=d(n)f(n)=d(n) (so the true answer is Dirichlet's theorem above), but mistakenly attempt the hyperbola identity with g=1g = \mathbf{1} and h(n)=μ(n)h(n) = \mu(n) (instead of the correct h=1h=\mathbf 1). Since 1∗μ=ε\mathbf{1} * \mu = \varepsilon (the indicator of n=1n=1, by Mobius inversion), the hyperbola method applied to this pair correctly computes ∑n≤xε(n)=1\sum_{n\le x} \varepsilon(n) = 1 for all x≥1x\ge1 — a valid but completely different statement, not a formula for ∑d(n)\sum d(n). This shows that the method's output is only meaningful for the specific f=g∗hf=g*h actually satisfied; swapping in a convolution pair that does not multiply out to the function of interest produces a correct theorem about the wrong function, which is precisely the trap: one must verify f=g∗hf=g*h as an identity of arithmetic functions (as we did via Mobius Inversion for d,σ,ϕd,\sigma,\phi) before invoking the method.

Scope, edge cases & common traps

SituationWhat to watch for
Choosing yy in the hyperbola identityy=xy=\sqrt x balances the two sums; other choices of yy are valid but usually give a worse error term
Bounding ⌊x/a⌋\lfloor x/a \rfloor termwiseFine when summed over O(x)O(\sqrt x) terms; summing the same crude bound over O(x)O(x) terms (the "direct method" pitfall in Example 2) can blow up the error term
Trivial bound ∣M(x)∣≤x|M(x)|\le x for Mertens' functionSufficient here; sharper bounds on M(x)M(x) (related to the Riemann Hypothesis) are unnecessary for average order of ϕ\phi at this level of precision
Confusing average order with pointwise boundAverage order says nothing about max⁡n≤xf(n)\max_{n\le x} f(n); e.g. d(n)d(n) can exceed (log⁡n)100(\log n)^{100} infinitely often even though its average is log⁡n\log n
Applying hyperbola method to non-convolution ffMust first establish f=g∗hf=g*h rigorously (typically via Mobius Inversion) before the method is meaningful

The mathematician behind it

Origins · 1 minPeter Gustav Lejeune Dirichlet and how this was discovered
PG
Peter Gustav Lejeune Dirichlet
1805–1859 · Prussia/Germany, University of Berlin and Göttingen

Dirichlet was one of the founders of analytic number theory, best known for introducing LL-functions to prove that every arithmetic progression a,a+d,a+2d,…a, a+d, a+2d,\dots with gcd⁡(a,d)=1\gcd(a,d)=1 contains infinitely many primes. He also gave the modern rigorous formulation of the concept of a function and proved fundamental results on Fourier series convergence. The hyperbola method for estimating ∑n≤xd(n)\sum_{n\le x} d(n), which he introduced in 1849, was one of the first instances of using geometric lattice-point counting to obtain an error term sharper than any naive summation would give, and it remains a template for analytic estimation techniques used throughout the field today.

History
- 1805 — Dirichlet born in Düren, in the French Empire (now Germany).
- 1837 — Dirichlet proves the theorem on primes in arithmetic progressions using LL-functions.
- 1849 — Dirichlet publishes the hyperbola method, proving ∑n≤xd(n)=xlog⁡x+(2γ−1)x+O(x)\sum_{n\le x} d(n) = x\log x + (2\gamma-1)x + O(\sqrt x).
- 1859 — Dirichlet dies in Göttingen; his lecture notes are later edited by Dedekind into Vorlesungen über Zahlentheorie.
- 1903–present — the "Dirichlet divisor problem" (finding the true infimum exponent θ\theta with error O(xθ)O(x^\theta), conjectured θ=1/4\theta=1/4) remains open, driving continued research in analytic number theory.
Why does the hyperbola method reduce the error term compared to a naive single sum?

A naive computation of ∑n≤xd(n)=∑a≤x⌊x/a⌋\sum_{n\le x} d(n) = \sum_{a\le x}\lfloor x/a\rfloor sums O(x)O(x) terms, each with an O(1)O(1) rounding error from the floor function, giving a total error budget of O(x)O(x) in the worst case. The hyperbola method instead splits the same lattice-point count into two sums each running only up to x\sqrt x, so there are only O(x)O(\sqrt x) floor-function terms contributing O(1)O(1) error apiece, giving total error O(x)O(\sqrt x). The trick works because the hyperbola ab=xab=x is symmetric, so the "long" tail of one variable is captured by the "short" range of the other, with a single correction term for the overlap square.

Is the average order of d(n)d(n) the same as saying d(n)/log⁡n→1d(n)/\log n \to 1?

No. Average order is strictly a statement about summatory functions: ∑n≤xd(n)∼xlog⁡x\sum_{n\le x} d(n) \sim x\log x, equivalently 1x∑n≤xd(n)∼log⁡x\frac1x\sum_{n\le x} d(n) \sim \log x. It does not claim d(n)/log⁡n→1d(n)/\log n \to 1 pointwise, and in fact that pointwise statement is false — d(n)=2d(n)=2 for every prime nn, while log⁡n→∞\log n \to \infty, so d(n)/log⁡n→0d(n)/\log n \to 0 along primes. The correct reading is that the average of d(n)d(n) over n≤xn \le x grows like log⁡x\log x, driven by highly composite numbers compensating for primes and near-primes where d(n)d(n) is small.

Why is O(x)O(\sqrt x) historically significant for the divisor problem?

Dirichlet's original 1849 bound O(x)O(\sqrt x) for the error term in ∑n≤xd(n)\sum_{n\le x} d(n) was a striking improvement over trivial estimates, but mathematicians soon asked whether the true error is much smaller. The Dirichlet divisor problem asks for the infimum θ0\theta_0 such that the error is O(xθ0+ε)O(x^{\theta_0+\varepsilon}) for every ε>0\varepsilon>0; it is conjectured that θ0=1/4\theta_0 = 1/4, matching the size of natural oscillation terms, but the best proven upper bounds (via more sophisticated exponential sum methods) sit slightly above 1/41/4, and a matching lower bound of Ω(x1/4(log⁡x)1/4)\Omega(x^{1/4}(\log x)^{1/4})-type is known. This single elementary-looking sum has driven a large fraction of 20th and 21st century analytic number theory technique development.

Does the hyperbola method require gg and hh to be multiplicative?

No. The hyperbola method, as proved here, is purely a combinatorial identity about summatory functions of any arithmetic functions g,hg,h and their Dirichlet convolution f=g∗hf=g*h; multiplicativity of gg or hh is never used in the proof. Multiplicativity is separately useful (via Mobius Inversion and Euler products) for discovering convolution identities like d=1∗1d=1*1 or ϕ=μ∗Id\phi=\mu*\mathrm{Id} in the first place, and for computing values of ff efficiently, but the hyperbola method itself works for arbitrary g,h:Z>0→Cg,h:\mathbb Z_{>0}\to \mathbb C.

How does this connect to Dirichlet series?

If F(s)=∑nf(n)n−sF(s)=\sum_n f(n) n^{-s}, G(s)=∑ng(n)n−sG(s) = \sum_n g(n) n^{-s}, and H(s)=∑nh(n)n−sH(s) = \sum_n h(n) n^{-s} are the associated Dirichlet series (convergent for ℜ(s)\Re(s) large), then the convolution identity f=g∗hf=g*h corresponds exactly to the product identity F(s)=G(s)H(s)F(s) = G(s)H(s), since multiplying Dirichlet series convolves their coefficients. This means ∑d(n)n−s=ζ(s)2\sum d(n) n^{-s} = \zeta(s)^2, ∑σ(n)n−s=ζ(s)ζ(s−1)\sum \sigma(n) n^{-s} = \zeta(s)\zeta(s-1), and ∑ϕ(n)n−s=ζ(s−1)/ζ(s)\sum \phi(n)n^{-s} = \zeta(s-1)/\zeta(s). The average order results proved here by elementary hyperbola methods can be reproved (with sometimes sharper error terms) using Perron's formula and contour integration applied to these Dirichlet series, which is the analytic route developed in Dirichlet Series and Euler Products.

Why do we care about the average order of ϕ(n)\phi(n) specifically?

The totient function controls the size of the multiplicative group (Z/nZ)×(\mathbb Z/n\mathbb Z)^\times, which is central to cryptography (RSA key generation), and its average order 6π2n≈0.6079 n\frac{6}{\pi^2}n \approx 0.6079\,n tells us that a "typical" residue class modulo nn has a fairly large proportion of integers coprime to it. The constant 6/π2=1/ζ(2)6/\pi^2 = 1/\zeta(2) also has a direct probabilistic meaning: it is exactly the density of squarefree integers, and more generally it is the probability that two random integers are coprime — the totient average-order computation and this probabilistic fact are two faces of the same Mobius-function calculation.

Can the hyperbola method give an average order for functions not of convolution type, like the prime-counting function?

Not directly, since π(x)\pi(x) (or its smoother cousin ψ(x)=∑n≤xΛ(n)\psi(x)=\sum_{n\le x}\Lambda(n)) is not a simple convolution sum in the same elementary sense, though Λ=μ∗log⁡\Lambda = \mu * \log is technically a convolution identity. In practice, estimating ∑n≤xΛ(n)\sum_{n\le x}\Lambda(n) well enough to get the Prime Number Theorem requires genuinely analytic tools — complex contour integration against ζ(s)\zeta(s) and its zero-free region — rather than the purely elementary lattice-counting arguments sufficient for d,σ,ϕd,\sigma,\phi. This is precisely why average-order results for d,σ,ϕd,\sigma,\phi serve as the elementary warm-up before the heavier machinery needed for The Prime Number Theorem: Statement and Heuristics.

Before this

Where this leads