TITLE: Equivalence of two well-known forms of (RH): reference-request
QUESTION [5 upvotes]: This is a reference-request about a very simple statement.
The Riemann hypothesis is well-known to be equivalent to
$$(1)\ \ \  \pi(x) = \mathrm{Li}(x)+O(x^{1/2} \log x)$$
and to
$$(2)\ \   \theta(x)=x+O(x^{1/2} \log^2 x).$$
Here as usual, $\pi(x) = \sum_{p \leq x} 1$ and $\theta(x) = \sum_{p \leq x} \log p$.

I am looking for a reference giving the proof of the equivalence between (1) and (2).

All the analytic number theory textbooks I have looked at gives at best a proof that
$\theta(x) \sim \pi(x) \log x$, which is clearly not enough.

REPLY [6 votes]: To complement Greg Martin's response, here is a proof that (1) implies (2).
Write $\pi(t)=\mathrm{Li}(t)+f(t)$, so that $f(t)=O(t^{1/2}\log t)$ by assumption. Then
$$ \theta(x) = \int_{2-}^x\log t\ d\pi(t)=\int_{2-}^x\log t\ d\mathrm{Li}(t)+\int_{2-}^x\log t\ d f(t). $$
Here the first integral is
$$ \int_{2-}^x\log t\ d\mathrm{Li}(t) = \int_2^x\log t\frac{dt}{\log t} = x-2 $$
and the second integral is
$$ \int_{2-}^x\log t\ df(t) = f(x)\log x - \int_2^x \frac{f(t)}{t}dt = 
O(x^{1/2}\log^2 x) +  \int_2^x O(t^{-1/2}\log t)\ dt. $$
The last integral is clearly
$$ O(\log x)\int_2^x t^{-1/2}\ dt = O(x^{1/2}\log x),$$
hence altogether
$$ \theta(x) = x-2 + O(x^{1/2}\log^2 x)+O(x^{1/2}\log x) = x+O(x^{1/2}\log^2 x). $$