How do I show that $\sum_{n \le x} \phi (n)=\frac{x^2}{2\zeta(2)}+ O(x \log x)$, where $O$ denotes the big-$O$ notation.
And we already know that $\phi (n) = \sum_{d|n} \mu (d) \frac{n}{d}$. I believe that I could approach something also from the previous question I posted but I couldn't make the relation.
Here is an elementary computation. Using $\phi(n)=n\sum_{d|n}\frac{\mu(d)}{d}=\sum_{md=n}m\mu(d)$, we obtain
\begin{align*} \sum_{n < x}\phi(n) & = \sum_{dm<x}m\mu(d) \\ & =\sum_{d<x}\mu(d)\sum_{m<x/d}m \\ & =\sum_{d<x}\mu(d)(\frac{1}{2}x^2/d^2+O(x/d))\\ & =\frac{1}{2}x^2\sum_{d<x}d^{-2}\mu(d)+O(x\log{x}) \\ & =\frac{1}{2\zeta(2)}x^2+O(x\log{x}). \end{align*}