TITLE: Newman's proof of the prime number theorem
QUESTION [10 upvotes]: I am teaching a graduate course in Complex Analysis and I am covering Newman's proof of the prime number theorem. I have been using the simplified version in the papers of
Zagier and Korevaar. However, I ran into a problem. 
Both papers rely on this theorem:
Theorem
Let $f:[0,\infty)\rightarrow\mathbb{C}$ be bounded and
locally integrable and let
$$
g(z):=\int_{0}^{\infty}f(t)e^{-tz}dt,\quad\operatorname{Re}z>0.
$$
Assume that for every $z\in\mathbb{C}$ with $\operatorname{Re}z=0$ there
exists $r_{z}>0$ such that $g$ can be extended holomorphically to $B(z,r_{z}
)$. Then the generalized Riemann integral
\begin{equation}
\int_{0}^{\infty}f(t)\,dt \label{pn1}
\end{equation}
is well-defined and equals $g(0)$.
This theorem is used to prove that the generalized Riemann integral
$$
\int_{1}^{\infty}\frac{\theta(x)-x}{x^{2}}dx
$$
converges. Here, $$
\theta(x):=\sum_{p\text{ prime}\leq x}\log p,\quad x\in\mathbb{R}.
$$
Everything is fine up to this point. Then the authors use the convergence of this integral to prove that
\begin{equation}
\lim_{x\rightarrow\infty}\frac{\theta(x)}{x}=1. \label{pn limit theta}%
\end{equation}
Their proof is as follows: 
Assume by contradiction that
$$
\limsup_{x\rightarrow\infty}\frac{\theta(x)}{x}>1.
$$
There there exists an increasing sequence $x_{n}\rightarrow\infty$ such that
$\theta(x_{n})>(1+\varepsilon)x_{n}$ for all $n\in\mathbb{N}$ and for some
$0<\varepsilon<1$. Since $\theta$ is increasing, if $x>x_{n}$, $\theta
(x)\geq\theta(x_{n})>(1+\varepsilon)x_{n}$, and so
\begin{align*}
\int_{x_{n}}^{(1+\varepsilon)x_{n}}\frac{\theta(x)-x}{x^{2}}dx &  \geq
\int_{x_{n}}^{(1+\varepsilon)x_{n}}\frac{(1+\varepsilon)x_{n}-x}{x^{2}}dx\\
&  =\int_{1}^{(1+\varepsilon)}\frac{(1+\varepsilon)-s}{s^{2}}ds>0
\end{align*}
where we made the change of variables $x=x_{n}s$ so $dx=x_{n}ds$. Since
$x_{n}\rightarrow\infty$, by selecting a subsequence we can assume that
$x_{n+1}\geq2x_{n}$ for all $n$. Hence, by summing all the disjoint integrals
on the left-hand side we obtain that
$$
\int_{\bigcup(x_{n},(1+\varepsilon)x_{n},)}\frac{\theta(x)-x}{x^{2}}%
dx=\sum_{n=1}^{\infty}\int_{x_{n}}^{(1+\varepsilon)x_{n}}\frac{\theta
(x)-x}{x^{2}}dx\\=\sum_{n=1}^{\infty}\int_{1}^{(1+\varepsilon)}\frac
{(1+\varepsilon)-s}{s^{2}}ds=\infty.
$$
The papers claim that this fact contradicts the fact that the integral converges and proves that
$$
\limsup_{x\rightarrow\infty}\frac{\theta(x)}{x}\leq1.
$$
However, this is not the case since all we know is that
$$
\lim_{T\rightarrow\infty}\int_{1}^{T}\frac{\theta(x)-x}{x^{2}}dx=\ell
\in\mathbb{R}%
$$
but this does not prevent that
$$
\int_{1}^{\infty}\frac{(\theta(x)-x)^{+}}{x^{2}}dx=\int_{1}^{\infty}%
\frac{(\theta(x)-x)^{-}}{x^{2}}dx=\infty.
$$
The typical example is
$$
\int_{1}^{\infty}\frac{\sin x}{x}dx,
$$
which exist as an improper Riemann integral but not as Lebesgue integral.
Am I missing something? If not, is there a correct proof?

REPLY [12 votes]: It doesn't seem to me that either article follows the line of reasoning as you have presented it. Indeed, we do not take the integral over the union of integrals $(x_n,(1+\varepsilon)x_n)$. We do get that the integral over those intervals is infinite, but you correctly note this does not give a contradiction. Instead, the argument goes as follows.
Let me denote
$$F(T)=\int_{1}^{T}\frac{\theta(x)-x}{x^{2}}dx,\quad C=\int_{1}^{(1+\varepsilon)}\frac{(1+\varepsilon)-s}{s^{2}}ds$$
so that $F(T)$ converges and $C$ is a positive constant. Since $F(T)$ converges, it is in particular Cauchy, so for large enough $x,y$ we have $|F(x)-F(y)|<C$. But for any $x_n$ we have $F((1+\varepsilon)x_n)-F(x_n)\geq C$ by the calculation you present, and for large $x_n$ this is the desired contradiction.