For \(x \in \RR\text{,}\) write
\begin{align*}
\pi(x) &= \sum_{p \leq x} 1\\
\vartheta(x) &= \sum_{p \leq x} \log p.
\end{align*}
The prime number theorem then asserts that
\begin{equation*}
\pi(x) \sim \frac{x}{\log x}.
\end{equation*}
This is equivalent to
\begin{equation*}
\vartheta(x) \sim x,
\end{equation*}
because for any \(\epsilon > 0\text{,}\)
\begin{align*}
\vartheta(x) &\leq \sum_{p \leq x} \log x = \pi(x) \log x\\
\vartheta(x) &\geq \sum_{x^{1-\epsilon} \leq p \leq x} \log x^{1-\epsilon} = (1-\epsilon) (\pi(x) + O(x^{1-\epsilon})) \log x.
\end{align*}
What we will prove is that the improper integral
\begin{equation}
\int_1^\infty \frac{\vartheta(x) - x}{x^2}\,dx\tag{2.3.1}
\end{equation}
converges; remember that this means that for every \(\epsilon > 0\text{,}\) there exists \(N\) such that for \(y,z \geq N\text{,}\)
\begin{equation*}
\left| \int_y^z \frac{\vartheta(x) - x}{x^2} \,dx \right| < \epsilon.
\end{equation*}
(It is much easier to prove that these integrals are bounded; see exercises.) To then deduce \(\vartheta(x) \sim x\text{,}\) suppose that there exists \(\lambda>1\) such that \(\vartheta(x) \geq \lambda x\) for arbitrarily large \(x\text{.}\) Since \(\vartheta\) is nondecreasing, it then follows that for any such \(x\text{,}\)
\begin{equation*}
\int_x^{\lambda x} \frac{\vartheta(t) - t}{t^2} dt \geq
\int_x^{\lambda x} \frac{\lambda x - t}{t^2} dt =
\int_1^\lambda \frac{\lambda - t}{t^2} dt > 0,
\end{equation*}
contradiction. Likewise, if there exists \(\lambda < 1\) such that \(\vartheta(x) \leq \lambda x\) for arbitrarily large \(x\text{,}\) then such \(x\) satisfy
\begin{equation*}
\int_{\lambda x}^x \frac{\vartheta(t) - t}{t^2} dt \leq
\int_{\lambda x}^x \frac{\lambda x - t}{t^2} dt =
\int_\lambda^1 \frac{\lambda - t}{t^2} dt < 0,
\end{equation*}
contradiction.