How to Estimate Functions $f(n)=\sum_{d|n}d\varphi(d)$ and $g(n)=\sum_{d|n}\frac{\varphi(d)}{d}$

analytic-number-theorycomputational-number-theorynt.number-theoryprime numbers

Let that $n$ be a natural number and $\varphi(n)$ be the Euler totient function. Is there any formula or estimation for computing functions $f,g$ such that:
$$
f(n)=\sum_{d\mid n}d\varphi(d)
$$

and
$$
g(n)=\sum_{d\mid n}\frac{\varphi(d)}{d}.
$$

For $n=p$ as the prime number it is clear that $f(p)=p^2-p+1$ and $g(p)=\frac{2p-1}{p}$.
We know that $f(n)=o(n^{3+\epsilon})$ and $g(n)=o(n^{1+\epsilon})$ for $\epsilon>0$

Best Answer

This was essentially observed by @StevenClark in the comments. Both functions are multiplicative with the following formulas: $$f(n) = \prod_{i=1}^k \frac{p_i^{2d_i+1}+1}{p_i+1}$$ and $$g(n) = \prod_{i=1}^k \frac{p_i(d_i+1)-d_i}{p_i},$$ where $n=p_1^{d_1}\dots p_k^{d_k}$ is the prime factorization of $n$.

Related Question