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](https://www.jstor.org/stable/2975232?seq=1) and [Korevaar](https://link.springer.com/article/10.1007/BF03024240). 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?



Newman's proof of the prime number theorem
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.


