The totient sum function has an identity:


$\displaystyle\sum\_{k=1}^{N}\varphi(k) = \sum\_{k=1}^N {\rm M}(\lfloor\frac{N}{k}\rfloor)k $ 


$\varphi(k)$ is the Euler totient function, and $M$ is the Mertens function $\displaystyle M(N)=\sum\_{k=1}^N \mu (k)$ where $\mu$ is the Moebius function.


My question: What is the Mertens function summation equivalent of $\displaystyle\sum\_{k=1}^{N}k\varphi(k) $ and $\displaystyle\sum\_{k=1}^{N}k^2\varphi(k)$?



How to rewrite this totient summation in terms of Mertens?
Since $\varphi(n)=n\sum\_{d|n}\frac{\mu(d)}{d},$ by switching the order of summation we have that for fixed $l$ $$\sum\_{n\leq x}\varphi(n)n^{l}=\sum\_{kd\leq x}\mu(d)k^{l}d^{l}k$$ 


$$=\sum\_{k\leq x}k^{l+1}\sum\_{d\leq\frac{x}{d}}\mu(d)d^{l}.$$ Now, $$\sum\_{d\leq y}\mu(d)d^{l}=\int\_{0}^{y}t^{l}d\left(M(t)\right)=M(y)y^{l}-l\int\_{0}^{y}M(t)t^{l-1}dt,$$ so you can write $$\sum\_{n\leq x}\varphi(n)n^{l}=\sum\_{k\leq x}k^{l+1}\left(\frac{x}{k}\right)^{l}M\left(\frac{x}{k}\right)-l\int\_{0}^{\frac{x}{k}}t^{l-1}M(t)dt.$$ This may be rearranged as


$$x^{l}\sum\_{k\leq x}kM\left(\frac{x}{k}\right)-l\sum\_{k\leq x}k^{l+1}\int\_{0}^{\frac{x}{k}}t^{l-1}M(t)dt,$$ which is equal to


$$x^{l}\sum\_{k\leq x}kM\left(\frac{x}{k}\right)-l\int\_{0}^{x}t^{l-1}\sum\_{k\leq x}k^{2}M\left(\frac{t}{k}\right)dt.$$ 


