Phi Function Summation and Divisors Suppose $n$ is a composite positive integer. Is there a simple way to express the sum 
$$
\sum _{d|n} \frac{\varphi(d)}{d}?
$$
what about 
$$
\sum_{d|n} d \varphi(d)?
$$
I know that the sum $\sum _{d|n} \varphi(d) = n$, but I don't see a way to apply that fact to either of these summations. Could someone please help or give hints? 
 A: There probably are not simpler ways of writing these sums but that doesn't mean we can't estimate them. 
Define $f(n)= \sum _{d|n} \frac{\varphi(d)}{d}
$ and  $ g(n)= \sum_{d|n} d \varphi(d) $. We have the naive bound because $\varphi(d) \leq d$ that $f(n) \leq \sum _{d|n} \leq \tau(n)$, where $\tau(n)$ is the number of positive divisors of $n$.  In particular, it is well known that $\tau(n) = O(n^\epsilon)$ for any $\epsilon >0$. Similarly, since $\phi(d) < d$, one has that $g(n) \leq \sum_{d|n} d^2$ which is another function which has well known bounds. 
Those are pretty not strong estimates. Can we do better? Note that both $f(n)$ and $g(n)$ are multiplicative functions (since they arise as divisor sums of multiplicative functions). This means that we can describe them through prime powers. In particular, if $p$ is prime then $$f(p^k) = 1 + k\frac{p-1}{p}.$$  Since $\tau(p^k) = k+1$, this means that our earlier estimate for $f(n)$ is pretty good generally. A similar remark applies to $g(n)$. On the other hand, when we look at the average value of $f(n)$, it doesn't look that great an estimate.
One has $$\sum_{n \leq x} \tau(n) \sim x\log x$$ so $\tau(n)$ is on average about $\log n$. But this average is brought up by a few outliers; most numbers have many fewer divisors than their logarithm. (See the discussion about average values of arithmetic functions in Hardy and Wright for more on this.) What is the average behavior of $$F(x) =\sum_{n \leq x} f(n)?$$  One might hope that it is smaller enough that the average behavior is different. Alas, that is not the case. 
We have $$F(x) = \sum_{n \leq x} \sum _{d|n} \frac{\varphi(d)}{d}
 = \sum_{n \leq x} \lfloor\frac{x}{d} \rfloor \frac{\varphi(d)}{d} =  \sum_{n \leq x} \left(\frac{x}{d} +O(1) \right) \frac{\varphi(d)}{d}.$$
The last step in the above comes from noting that the floor of a number is at most 1 away from the number itself. We may then expand this into two terms to get:
$$= x\sum_{d \leq x} \frac{\varphi(d)}{d^2}  + O\left(\sum_{d \leq x} \frac{\varphi(d)}{d}\right).$$
This second term is $O(x)$. So let's focus on the first sum. We want to understand the sum $T(x)= \sum_{d \leq x} \frac{\varphi(d)}{d^2}$.  Standard techniques (which I can expand on if necessary) show that $$T(x) \sim \frac{1}{\zeta(2)} \log x.$$ So the average behavior of $f(n)$ is very close to the average behavior of $\tau(n)$, but with a different constant out front. 
A: $$\sum_{d\mid n}\frac{\varphi(d)}{d}=\frac{1}{n}\sum_{d\mid n}\frac{n}{d}\varphi(d) $$
is $\frac{1}{n}$ times a multiplicative function, namely the convolution between $\varphi$ and the identity function.
Since $\sum_{n\geq 1}\frac{n}{n^s}=\zeta(s-1)$ and $\sum_{n\geq 1}\frac{\varphi(n)}{n^s}=\frac{\zeta(s-1)}{\zeta(s)}$, the Dirichlet's series associated to $\sum_{d\mid n}\frac{n}{d}\varphi(d)$ is $\frac{\zeta(s-1)^2}{\zeta(s)}$ and
$$ \sum_{d\mid n}\frac{n}{d}\varphi(d) = \sum_{d\mid n} d\tau(d)\mu\left(\frac{n}{d}\right),\qquad
\sum_{d\mid n}\frac{\varphi(d)}{d} = \sum_{d\mid n}\frac{\mu(d)}{d}\tau\left(\frac{n}{d}\right).$$
The function $\frac{\zeta(s-1)^2}{\zeta(s)}$ behaves like $\frac{1}{\zeta(2)(s-2)^2}$ in a right neighbourhood of $s=2$, hence by invoking the Hardy-Littlewood tauberian theorem we get that 
$$ \frac{1}{N}\sum_{n\leq N}\sum_{d\mid n}\frac{\varphi(d)}{d} \sim \frac{6}{\pi^2}\log N.$$
Similarly, $\sum_{n\geq 1}\frac{n\varphi(n)}{n^s}=\frac{\zeta(s-2)}{\zeta(s-1)}$ leads to
$$ \sum_{n\geq 1}\frac{1}{n^s}\sum_{d\mid n}d\varphi(d) = \frac{\zeta(s)\zeta(s-2)}{\zeta(s-1)}.$$
In a right neighbourhood of $s=3$ the RHS behaves like $\frac{\zeta(3)}{\zeta(2)(s-3)}$, hence
$$ \frac{1}{N}\sum_{n\leq N}\sum_{d\mid n}d\varphi(d) \sim \frac{\zeta(3)}{\zeta(2)}N^2.$$
