# Why doesn't Mertens's second theorem prove the Prime Number Theorem?

Mertens's second theorem states that $$\sum_{p \le x} \frac 1p = \log \log x+O(1).$$ Defining $p_x=p_{\lfloor x \rfloor}$ for all real $x \ge 1$, we can replace the sum by the integral $$\int_1^x \frac 1{p_t} \; dt=\log \log x+O(1)$$ and thus $\frac 1{p_x}$ is on the order of $\frac d{dx} \log \log x=\frac 1{x \log x}$, which simplifies to the prime number theorem. This is clearly not a valid proof, but why not? I suspect that it's in the step from the integral to the expression for $\frac 1{p_x}$, but I don't see why that isn't valid.

The prime number theorem, as proved by de la Vallée-Poussin, states that $\pi(x) = \sum_{p \leq x} 1 = \mathrm{Li}(x) + O\left(xe^{-a\sqrt{\log x}}\right),$ where $\mathrm{Li}(x) = \int_2^x \frac{dt}{\log t} \sim \frac{x}{\log x}.$ Mertens' second theorem is sometimes stated as $\sum_{p \leq x}\frac{1}{p} = \log \log x + M + o(1),$ but the result that Mertens proved is actually slightly stronger, namely that there exists a constant $M$, the Meissel-Mertens constant, such that $\sum_{p \leq x}\frac{1}{p} = \log \log x + M + O\left(\frac{1}{\log x}\right).$ To get from $\sum_{p \leq x} \frac{1}{p}$ to $\sum_{p \leq x} 1$, one uses partial summation, which is the rigorous way of a replacing a sum by an integral. This states that if $c_n$ is a series of complex numbers and $f(n)$ is a differentiable function, then $\sum_{n \leq x} c_n f(n) = C(x) f(x) - \int_{1}^{x} C(t) f'(t) \, dt,$ where $C(x) = \sum_{n \leq x} c_n.$ So if $c_n = 1/p$ if $n = p$ is a prime and $0$ otherwise, and if $f(n) = n$, then this gives $\sum_{p \leq x} 1 = x \sum_{p \leq x} \frac{1}{p} - \int_{e^2}^{x} \left(\sum_{p \leq t} \frac{1}{p}\right) \, dt + O(1).$ Here I've changed the endpoints on the integral on the right-hand side, which leads to a change by a constant. Using Mertens' second theorem shows that the integral on the right-hand side is $\int_{e^2}^{x} \left(\sum_{p \leq t} \frac{1}{p}\right) \, dt = \int_{e^2}^{x} \log \log t \, dt + \int_{e^2}^{x} M \, dx + O\left(\int_{e^2}^{x} \frac{dt}{\log t}\right).$ Using integration by parts, one can show that $\int \log \log x \, dx = x \log \log x - \mathrm{Li}(x) + C,$ and so combining everything, we get $\sum_{p \leq x} 1 = x \left(\sum_{p \leq x} \frac{1}{x} - \log \log x - M\right) + O(\mathrm{Li}(x)) = O\left(\frac{x}{\log x}\right)$ where the last step follows by Mertens' second theorem again. So we just fall short of the prime number theorem. Indeed, if we had the slightly stronger statement that $\sum_{p \leq x}\frac{1}{p} = \log \log x + M + o\left(\frac{1}{\log x}\right),$ then we can use partial summation to prove the prime number theorem.
• Upvoting for good explanation of the ideas involved and why summation by parts is insufficiently powerful, but $why$ doesn't the prime number theorem follow by the method in the question?
• There's a couple of things wrong with the method in question. The main bit is the statement that "and thus $1/p_x$ is on the order of $1/\log x$". This is a heuristic connection that you've made, but it doesn't mean anything. $p_x$ is a piece-wise continuous function that has derivative $0$ almost everywhere, whereas $\log\log x$ is analytic. So differentiating the left-hand side gives $0$ almost everywhere, whereas $\log \log x$ has derivative $1/x\log x$. The key problem is that the big-oh term is not preserved by differentiation. Feb 14, 2015 at 17:35
• Gotcha, accepting answer. What if we were to somehow smooth $p_x$ to make it differentiable, though?