Selberg states the incorrect inequality $$\sum_{p\leq x}\frac{\log p}{x}=\log x+O(1)$$ that of course refers to the inequality $$\sum_{p\leq x}\frac{\log p}{p}=\log x+O(1)\tag*{(1.4)}$$ and says that by partial summation this implies $$\sum_{n\leq x}\frac{\vartheta(n)}{n^2}=\log x+O(1).\tag*{(1.5)}$$
The last inequality "(1.5)" is correct, however I have tried already using "partial summation" with (1.4), which I think means Abel's summation formula, as $$\sum_{1<n\leq x}\frac{\vartheta(n)}{n}\frac{1}{n}$$ but this gives me an incorrect relation. I may be doing something wrong but I have already tried some different setups and none seem to work. Can anyone give me a hint on what to do?
From partial summation, we can convert (1.4) into an integral:
$$ \sum_{p\le x}{\log p\over p}={\vartheta(x)\over x}+\int_2^x{\vartheta(t)\over t^2}\mathrm dt=\int_2^x{\vartheta(t)\over t^2}\mathrm dt+O(1). $$
For the integral, notice that for $n\ge2$,
$$ \int_n^{n+1}{\vartheta(t)\over t^2}\mathrm dt=\vartheta(n)\int_n^{n+1}{\mathrm dt\over t^2}={\vartheta(n)\over n^2}\left\{1+O\left(\frac1n\right)\right\}={\vartheta(n)\over n^2} +O(1), $$
so we have
$$ \int_2^x{\vartheta(t)\over t^2}\mathrm dt=\sum_{n\le x}{\vartheta(n)\over n^2}+O(1). $$
Combining everything gives the desired result.