# Asymptotic expansion of a series with the divisor function

Thanks to the readers of this forum, I am making progress in my reading through On the Average Height of Planted Plane Trees by Knuth, de Bruijn and Rice (1972). My aim is to reach the same result using only elementary means (undergraduate real calculus), or else a weaker result. At the seventh page, the authors set to find the asymptotic expansion ($n \rightarrow +\infty$) of the function $$g_b(n) = \sum_{k \geqslant 1}{k^b}d(k)\exp(-k^2/n),$$ where $n, b \geqslant 0$ are integers, and $d(k)$ is the number of positive divisors of $k$. First, they note $$e^{-x} = \frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty}\Gamma(z) x^{-z} dz, \quad c > 0, \quad x > 1.$$ Then they remark that $\zeta(z)^2 = \sum_{k \geqslant 1}d(k)/k^z$. Gathering these formulas yields $$g_b(n) = \sum_{k \geqslant 1}\frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty}n^z\Gamma(z) k^{b-2z} d(k)\; dz = \frac{1}{2\pi i}\int_{c-i\infty}^{c+i\infty}n^z\Gamma(z)\zeta(2z-b)^2 \; dz,$$ where now $c > (b+1)/2$. They complete the work with an analysis of the residues at the poles.

How would you address the same problem without complex numbers?

-