the constant in the asymptotics of $\sum_{1\le k \le n} \frac{\varphi(k)}{k^2}$ The following thread at math.stackexchange.com proposes a constant term for the asymptotic expansion of
$$\sum_{1\le k \le n} \frac{\varphi(k)}{k^2}.$$
I am getting a different term and I would like to know which is right.
My calculation goes like this: first recall the classic identity
$$ \sum_{d\mid n} \varphi(d) = n,$$
which gives the Dirichlet convolution
$$ \varphi \star 1 = n \quad \text{and hence} \quad
\sum_{n\ge 1} \frac{\varphi(n)}{n^s} = \frac{\zeta(s-1)}{\zeta(s)}.$$
To evaluate the sum use the Mellin-Perron type integral
$$\int_{2-i\infty}^{2+i\infty} A(s) n^s \frac{ds}{s}
= -\frac{1}{2}\frac{\varphi(n)}{n^2} + \sum_{k=1}^n \frac{\varphi(k)}{k^2}
\quad \text{where} \quad A(s) = \frac{\zeta(s+1)}{\zeta(s+2)}.$$
and shift to the left to pick up the residue at $s=0$, getting
$$ \frac{6}{\pi^2} \log n + 
\left(\frac{6\gamma}{\pi^2} - \frac{36}{\pi^4} \zeta'(2)\right)
+ O\left( \frac{\log n}{n} \right).$$
Addendum. In view of Eric Naslunds excellent comment below (the second one to point out the missing details) maybe we can ask whether anyone is able to supply those missing bounds on the rest of the contour for the Mellin-Perron integral, thereby turning this question into a useful reference. Here is a MSE challenge of the same type.
 A: Your calculation is correct.  The hyperbola method also yields $$\sum_{n\leq x}\frac{\phi(n)}{n^2}=\frac{\log x}{\zeta(2)}+\frac{\gamma}{\zeta(2)} -\frac{\zeta^{'}(2)}{\zeta(2)^2}+O\left(\frac{\log x}{x}\right).$$
My previous answer contained a small error, and has been updated.  I should have expanded $\log \left(\frac{x}{d}\right)$ as $\log x-\log d$, but I forgot the $\log d$ and wrote only $\log x$, and consequently there was no $\zeta^{'}(2)$ term.  
Additional Remarks: Be cautious when using contour integration if you are trying to prove a better error term.  The residue will always give you the main term almost instantly, but for the error term, you need to use Lemmas regarding bounds on the size of $\zeta(s)$ as we $t$ goes to infinity so that you can show that each part of the contour goes to zero.  Do not assume that they must go to zero, since often this is simply false.
An excellent example is the average of $\frac{\phi(n)}{n}$, that is the sum $\sum_{n\leq x} \frac{\phi(n)}{n}$.  One can show that $$\sum_{n\leq x} \frac{\phi(n)}{n}=\frac{6}{\pi^2}x+O(\log x)$$
by either elementary methods or contour integration, but we can ask how much better should the error term be.  If you are not extremely careful with the bounds on zeta, then you might convince yourself that one can get the error term $O(e^{-c\sqrt{\log x}})$.  However, this is provably false.
