How to establish $\sum_{d|n}d\phi(d)$ 
I am focusing on #5(b). I do not understand how they go from what I have to the answer. Those are r's at the end.

The function $\sum_{d\mid n} d\varphi(d)$ is multiplicative, so we only need to calculate $\sum_{d\mid n} d\varphi(d)$ for $n$ of the form $p^k$. 
In that case, the sum is
$$1+\sum_{i=1}^k p^i p^{i-1}(p-1)=1+\sum_{i=1}^k p(p-1)(p^2)^{i-1}.$$
The sum is almost a geometric series, apart from the first term. Note that the geometric series part has common ratio $p^2$. The sum of the geometric series part is
$$p(p-1)\frac{p^{2k}-1}{p^2-1}.$$
This simplifies to $\dfrac{p^{2k+1}-p}{p+1}$. Finally, add $1$ and simplify. 
