<s>[INST] Asymptotic formula for $\sum_{n \le x} \frac{\varphi(n)}{n^2}$ Here is yet another problem I can't seem to do by myself... I am supposed to prove that
$$\sum_{n \le x} \frac{\varphi(n)}{n^2}=\frac{\log x}{\zeta(2)}+\frac{\gamma}{\zeta(2)}-A+O \left(\frac{\log x}{x} \right),$$
where $\gamma$ is the Euler-Mascheroni constant and $A= \sum_{n=1}^\infty \frac{\mu(n) \log n}{n^2}$. I might be close to solving it, but what I end up with doesn't seem quite right. So far I've got:
$$
\begin{align*}
\sum_{n \le x} \frac{\varphi(n)}{n^2} &= \sum_{n \le x} \frac{1}{n^2} \sum_{d \mid n} \mu(d) \frac{n}{d} \\
&= \sum_{n \le x} \frac{1}{n} \sum_{d \le x/n} \frac{\mu(d)}{d^2} \\
&= \sum_{n \le x} \frac{1}{n} \left( \sum_{d=1}^\infty \frac{\mu(d)}{d^2}- \sum_{d>x/n} \frac{\mu(d)}{d^2} \right) \\
&= \sum_{n \le x} \frac{1}{n} \left( \frac{1}{\zeta(2)}- \sum_{d>x/n} \frac{\mu(d)}{d^2} \right) \\
&= \frac{1}{\zeta(2)} \left(\log x + \gamma +O(x^{-1}) \right) - \sum_{n \le x} \frac{1}{n}\sum_{d>x/n} \frac{\mu(d)}{d^2}.
\end{align*}
$$
So. I suppose my main problem is the rightmost sum, I have no idea what to do with it! I'm not sure where $A$ comes into the picture either. I tried getting something useful out of
$$
\begin{align*}
& \sum_{n \le x} \frac{1}{n} \left( \frac{1}{\zeta(2)}- \sum_{d>x/n} \frac{\mu(d)}{d^2} \right) +A-A \\
&= \left( \frac{1}{\zeta(2)} \left(\log x + \gamma +O(x^{-1}) \right) - A \right) - \sum_{n \le x} \frac{1}{n}\sum_{d>x/n} \frac{\mu(d)}{d^2} + A,
\end{align*}
$$
but I quickly realized that I had no clue what I was doing. Any help would be much appreciated.
 [/INST] Consider Dirichlet series, related to the problem at hand:
$$
 g(s) = \sum_{n=1}^\infty \frac{\varphi(n)}{n^{2+s}} = \frac{\zeta(s+1)}{\zeta(s+2)}
$$  
We can now recover behavior of $A(x) = \sum_{n \le x} \frac{\varphi(n)}{n^s}$ by employing Perron's formula, using $c > 0$:
$$
  A(x) = \frac{1}{2 \pi i} \int_{c - i \infty}^{c + i \infty} \frac{\zeta(z+1)}{\zeta(z+2)} \frac{x^z}{z} \mathrm{d} z = \mathcal{L}^{-1}_z\left( \frac{\zeta(z+1)}{\zeta(z+2)} \frac{1}{z} \right)(\log x)
$$
For large $x$, the main contribution comes from the pole of ratio of zeta functions at $z = 0$. Using 
$$
  \frac{\zeta(z+1)}{\zeta(z+2)} \sim \frac{1}{\zeta(2)} \left( \frac{1}{z} + \gamma -  \zeta^\prime(2)\right) + O(z)
$$
Since $\mathcal{L}^{-1}_z\left( \frac{1}{z^{n+1}} \right)(s) = \frac{s^n}{n!}$ we have
$$
   A(x) = \frac{\log x}{\zeta(2)} + \left( \frac{\gamma}{\zeta(2)} - \frac{\zeta^\prime(2)}{\zeta(2)} \right) + \mathcal{L}^{-1}_z\left( \frac{\zeta(z+1)}{\zeta(z+2)} \frac{1}{z} - \frac{1}{\zeta(2) z^2} - \frac{\gamma - \zeta^\prime(2)}{\zeta(2) z} \right)(\log x)
$$
Notice that $\frac{\zeta^\prime(s)}{\zeta(s)} = \sum_{n=1}^\infty \frac{\mu(n) \log(n)}{n^s}$, hence $\frac{\zeta^\prime(2)}{\zeta(2)} = A$.
It remains to be shown that the remainder term is small.
</s>