Approximation race : Chebyshev theta vs Mertens third theorem If $O(R(x))$ is the error term in the PNT, what is it for the two different problems $\theta(x)-x$ and Mertens third theorem? Is it $O(xR(x))$ vs $O(R(x))$? Or is there a sharper bound for the first problem? It is alluded to but not developed in Terry Tao s blog: https://terrytao.wordpress.com/2013/12/11/mertens-theorems/
 A: Using the Prime Number Theorem in this form $$\pi\left(x\right)=\frac{x}{\log\left(x\right)}+O\left(\frac{x}{\log^{2}\left(x\right)}\right)
 $$ we get, using Abel's summation, $$\theta\left(x\right)=\sum_{p\leq x}1\cdot\log\left(p\right)=\pi\left(x\right)\log\left(x\right)-\int_{2}^{x}\frac{\pi\left(t\right)}{t}dt=x+O\left(\frac{x}{\log\left(x\right)}\right).
 $$ About the Mertens third theorem, you don't need the PNT. Using the Stirling's formula we have $\log\left(N!\right)=N\log\left(N\right)+O\left(N\right)
 $, but also holds $$\log\left(N!\right)=\sum_{p^{k}\leq N}\left[\frac{N}{p^{k}}\right]\log\left(p\right)=\sum_{n\leq N}\left[\frac{N}{n}\right]\Lambda\left(n\right)=\sum_{n\leq N}\frac{N\Lambda\left(n\right)}{n}+O\left(N\right)
 $$ so $$\sum_{n\leq N}\frac{\Lambda\left(n\right)}{n}=\log\left(N\right)+O\left(1\right)
 $$ now we can observe that $$\sum_{n\leq N}\frac{\Lambda\left(n\right)}{n}-\sum_{p\leq N}\frac{\log\left(p\right)}{p}\leq\sum_{p\leq N}\frac{\log\left(p\right)}{p\left(p-1\right)}=O\left(1\right)
 $$ so $$\sum_{p\leq N}\frac{\log\left(p\right)}{p}=\log\left(N\right)+O\left(1\right)
 $$ and we can use this estimation for the sum of reciprocal of primes (again with Abel's summation) $$\sum_{p\leq N}\frac{1}{p}=\sum_{p\leq N}\frac{1}{\log\left(p\right)}\frac{\log\left(p\right)}{p}=\frac{1}{\log\left(N\right)}\sum_{p\leq N}\frac{\log\left(p\right)}{p}+\int_{2}^{N}\sum_{p\leq t}\frac{\log\left(p\right)}{p}\frac{1}{t\log^{2}\left(t\right)}dt=
 $$ $$=\log\left(\log\left(N\right)\right)+C+O\left(\frac{1}{\log\left(N\right)}\right).
 $$with $C>0$. Finally, we can easily prove the Mertens third theorem. Taking log and using the previous results, we have $$\log\left(\prod_{p\leq N}\left(1-\frac{1}{p}\right)\right)=-\sum_{p\leq N}\sum_{m\geq1}\frac{1}{mp^{m}}=-\sum_{p\leq N}\frac{1}{p}-\sum_{p\geq2}\sum_{m\geq2}\frac{1}{mp^{m}}+O\left(\sum_{p>N}\sum_{m\geq2}\frac{1}{mp^{m}}\right)=
 $$ $$=\log\left(\log\left(N\right)\right)+D+O\left(\frac{1}{\log\left(N\right)}\right).
 $$ To get the explicit constant $e^{-\gamma}
 $ we need to know some properties of zeta function and gamma function, but the error is the same.
