Arithmetic Average of Second Chebyshev Function

Theorem
Let $x \ge 1$ be a real number.

Then:
 * $\ds \sum_{n \le x} \map \psi {x/n} = x \log x - x + \map \OO {\map \log {x + 1} }$

where:
 * $\OO$ is big-O notation
 * $\psi$ is the Second Chebyshev function.

Proof
We have, by the definition of the Second Chebyshev function:


 * $\ds \sum_{n \le x} \map \psi {x/n} = \sum_{n \le x} \sum_{m \le x/n} \map \Lambda m$

where $\Lambda$ is the Von Mangoldt function.

In other words:


 * $\ds \sum_{n \le x} \map \psi {x/n} = \sum_{t \le x} \sum_{m \divides t} \map \Lambda m$

From Sum Over Divisors of von Mangoldt is Logarithm, we have:


 * $\ds \sum_{t \le x} \sum_{m \divides t} \map \Lambda m = \sum_{t \le x} \log t$

With a view to bound this sum, note that:


 * $\ds \sum_{t \le x} \log t = \log 1 + \sum_{2 \le t \le x} \log t = \sum_{2 \le t \le x} \log t$

We have:


 * $\ds \sum_{2 \le t \le x} \log t = \sum_{2 \le t \le x} \paren {\int_{t - 1}^t \log t \rd u}$

From Logarithm is Strictly Increasing, we have:


 * $\log u \le \log t \le \map \log {u + 1}$

for $t - 1 \le u \le t$, so:


 * $\ds \sum_{2 \le t \le x} \paren {\int_{t - 1}^t \log u \rd u} \le \sum_{2 \le t \le x} \paren {\int_{t - 1}^t \log t \rd u} \le \sum_{2 \le t \le x} \paren {\int_{t - 1}^t \map \log {u + 1} \rd u}$

Now, from Sum of Integrals on Adjacent Intervals for Integrable Functions, we have:


 * $\ds \sum_{2 \le t \le x} \paren {\int_{t - 1}^t \map \log {u + 1} \rd u} = \int_1^{\floor x} \map \log {u + 1} \rd u$

and:


 * $\ds \sum_{2 \le t \le x} \paren {\int_{t - 1}^t \log u \rd u} = \int_1^{\floor x} \log u \rd u$

We can compute:

and:


 * $\ds \int_1^{\floor x} \log u \rd u = \floor x \log \floor x - \floor x$

Since $x - 1 < \floor x \le x$, and $1 - 2 \log 2 < 0$, we have:


 * $\paren {\floor x + 1} \map \log {\floor x + 1} - \floor x - 2 \log 2 + 1 \le \paren {x + 1} \map \log {x + 1} - x$

and:


 * $\paren {x - 1} \map \log {x - 1} - \paren {x - 1} \le \floor x \log \floor x - \floor x$

from Logarithm is Strictly Increasing.

We have therefore obtained that:


 * $\ds \paren {x - 1} \map \log {x - 1} - \paren {x - 1} \le \sum_{n \le x} \map \psi {x/n} \le \paren {x + 1} \map \log {x + 1} - x$

We will use this inequality to show that:


 * $\ds \sum_{n \le x} \map \psi {x/n} - \paren {x \log x - x} = \map \OO {\map \log {x + 1} }$

We have:


 * $\ds \paren {x - 1} \map \log {x - 1} - x \log x \le \sum_{n \le x} \map \psi {x/n} - \paren {x \log x - x} \le \paren {x + 1} \map \log {x + 1} - x \log x$

We will show that for sufficiently large $x$ we have:


 * $\paren {x + 1} \map \log {x + 1} - x \log x \le 2 \map \log {x + 1}$

and:


 * $-2 \map \log {x + 1} \le \paren {x - 1} \map \log {x - 1} - x \log x$

at which point we have the claim.

Define a function $f : \hointr 1 \infty \to \R$ by:


 * $\map f x = \paren {x + 1} \map \log {x + 1} - x \log x - 2 \map \log {x + 1}$

for each $x \in \hointr 1 \infty$.

Note that:


 * $\map f 1 = 2 \log 2 - 1 \log 1 - 2 \log 2 = 0$

So it suffices to show that $f$ is decreasing for $x \ge 1$, then we will have $\map f x < 0$ for $x \ge 1$.

Note that $f$ is differentiable and:

We can now see that $\map {f'} x < 0$ for $x \ge 1$.

So, from Real Function with Negative Derivative is Decreasing:


 * $f$ is decreasing.

So, for $x \ge 1$, we have:


 * $\paren {x + 1} \map \log {x + 1} - x \log x - 2 \map \log {x + 1} \le \map f 1 = 0$

That is:


 * $\paren {x + 1} \map \log {x + 1} - x \log x \le 2 \map \log {x + 1}$

For the other inequality, define a function $g : \openint 1 \infty \to \R$ by:


 * $\map g x = \paren {x - 1} \map \log {x - 1} - x \log x + 2 \map \log {x + 1}$

Again $g$ is differentiable with:

We can see that $\map {g'} x \ge 0$ for $x \ge 3$.

So from Real Function with Positive Derivative is Increasing:


 * $g$ is increasing.

So for $x \ge 3$ we have:


 * $\paren {x - 1} \map \log {x - 1} - x \log x + 2 \map \log {x + 1} \ge \map g 2 = 1 \log 1 - 2 \log 2 + 2 \log 3$

so for $x \ge 3$ we have:

Putting these two inequalities together, for $x \ge 3$ we have:


 * $\ds -2 \map \log {x + 1} \le \sum_{n \le x} \map \psi {x/n} - \paren {x \log x - x} \le 2 \map \log {x + 1}$

so:


 * $\ds \sum_{n \le x} \map \psi {x/n} - \paren {x \log x - x} = \map \OO {\map \log {x + 1} }$

so:


 * $\ds \sum_{n \le x} \map \psi {x/n} = x \log x - x + \map \OO {\map \log {x + 1} }$