This question was asked in my quiz of number theory and I was not able to make any progress in it.
Question: Show that $$\sum_{ n\leq x}{\Lambda(n)}^2 = x\log x- x+o(x),$$ where $\Lambda(n)$ is the Von Mangoldt function.
I am sorry but I cannot provide any attempt for this question as I am totally struck on it.
I have studied number theory from Introduction to analytic number theory by Tom M Apostol.
Kindly don't close it as this question might be easy for you but it is very hard for me.
Thanks!
By definition, we know that
$$ \sum_{n\le x}\Lambda(n)^2=\sum_{\substack{k\le\log_2x\\p^k\le x}}\log^2p. $$
By Chebyshev's inequality, we know
$$ \sum_{2\le k\le\log_2x}\sum_{p\le x^{1/k}}\log^2p\le\log x\sum_{2\le k\le\log_2x}\vartheta(x^{1/k})\ll x^{1/2}\log^2x. $$
As a result, we have
$$ \sum_{n\le x}\Lambda(n)^2=\sum_{p\le x}\log^2p+O(x^{1/2}\log^2x). $$
To continue, we quote the prime number theorem in the form of
$$ \vartheta(x)=x+O\left(x\over\log^Ax\right), $$
where $A>0$ is any fixed positive constant. Therefore, partial summation gives:
$$ \sum_{p\le x}\log^2p=\int_{2^-}^x\log t\mathrm d\vartheta(t)=\int_2^x\log t\mathrm dt+O\left(x\over\log^{A-1}\right) $$
Combining everything together, we see that for any $A'>0$ there is
$$ \sum_{n\le x}\Lambda(n)^2=x\log x-x+O\left(x\over\log^{A'}x\right) $$