# Asymptotics for sums of powers of divisor function

It is a well known result that with $\tau(n) := \sum_{d|n} 1$ that $$\sum_{n\le X}\tau(n)\sim X\log X,\\ \sum_{n\le X}\tau(n)^2\sim C_1X\log^3X$$ for some $C_1 > 0$. In general, it is also known that for $k\ge 0$, $$\sum_{n\le X} \tau(n)^k\ll X\log^{C(k)}X$$ (I think one can take $C(k) = 2^k - 1$). Are asymptotics known for these sums, or are there lower bounds that are sharp up to a constant factor for these sums?

Yes, these are standard things in analytic number theory. We have $$\sum_{n=1}^\infty\frac{\tau(n)^k}{n^s}=\zeta(s)^{2^k}F_k(s),\qquad\Re(s)>1,$$ where $F_k(s)$ is an explicit Dirichlet series that converges absolutely for $\Re(s)>1/2$. The exponent $2^k$ is dictated by $\tau(p)^k=2^k$ for primes $p$. It follows, by applying an inverse Mellin transform, that $$\sum_{n\leq x}\tau(n)^k=x P_k(\log x)+O(x^{1-\delta_k+\epsilon}),$$ where $P_k(t)\in\mathbb{R}[t]$ is an explicit polynomial and $0<\delta_k<1$ is also explicit. The polynomial can be read off from the principal part of the Laurent series of $\zeta(s)^{2^k}F_k(s)$ at $s=1$, in particular $\deg P_k=2^k-1$, because the order of the pole at $s=1$ is $2^k$. I think one can also treat complex powers of $\tau(n)$ by the Selberg-Delange method (but I have not carried out the details), see Chapter II. 5 in Tenenbaum: Introduction to analytic and probabilistic number theory.
Finally, a fun fact. It can be proved by elementary means that $$\sum_{n\leq x}\tau(n)^k\leq x\left(\sum_{n\leq x}\frac{1}{n}\right)^{2^k-1}.$$ Note that the harmonic series on the right is less than $1+\log x$. More generally, $$\sum_{n\leq x}\tau_{r_1}(n)\dots\tau_{r_k}(n)\leq x\left(\sum_{n\leq x}\frac{1}{n}\right)^{r_1\dots r_k-1}.$$ For the last sum, again, the fine asymptotic behaviour can be obtained by applying an inverse Mellin transform after comparing the relevant Dirichlet series with $\zeta(s)^{r_1\dots r_k}$.