Computing integral involving Dirac Delta Function

I'll comment on calculating the sum. First, the sum $\sum\limits_{n=0}^{\infty}n^2 e^{-\pi n}$ certainly does converge, just as $\int_0^{\infty} x^2 e^{-\pi x} \, dx$ converges. Here's how I would go about finding a closed expression which is equal that sum:

Note that $n^2 e^{-\pi n} = \frac{d^2}{d\lambda^2}\Big|_{\lambda = \pi}e^{-\lambda n}$, and since we will be evaluating $\lambda$ at $\pi$, we can always assume $\lambda > 1$. Now:

$$ \sum_{n=0}^{\infty} n^2 e^{-\pi n} = \sum\limits_{n=0}^{\infty}\frac{d^2}{d\lambda^2}\Big|_{\lambda = \pi}e^{-\lambda n} = \frac{d^2}{d\lambda^2}\Big|_{\lambda = \pi}\sum\limits_{n=0}^{\infty}e^{-\lambda n} \\ =\frac{d^2}{d\lambda^2}\Big|_{\lambda = \pi} \sum\limits_{n=0}^{\infty} \left(e^{-\lambda}\right)^n = \frac{d^2}{d\lambda^2}\Big|_{\lambda = \pi} \frac{1}{1 - e^{-\lambda}} = \cdots $$ where the last evaluated equality comes from the geometric series formula. From here you only need to evaluate the differentiation.


Note that $$ \begin{align} \sum_{n=0}^\infty n^2x^n &=x^2\sum_{n=0}^\infty n(n-1)x^{n-2}+x\sum_{n=0}^\infty nx^{n-1}\\ &=\frac{2x^2}{(1-x)^3}+\frac{x}{(1-x)^2}\\[6pt] &=\frac{x+x^2}{(1-x)^3} \end{align} $$ Therefore, $$ \begin{align} 2\pi^2\sum_{n=0}^\infty n^2e^{-\pi n} &=2\pi^2\frac{e^{-\pi}+e^{-2\pi}}{\left(1-e^{-\pi}\right)^3}\\ &=\frac{\pi^2}2\frac{\cosh\left(\frac\pi2\right)}{\sinh^3\left(\frac\pi2\right)} \end{align} $$


Actually Wolfram Alpha is wrong.

The series

$$\sum_{n = 0}^{+\infty} n^2 e^{-n\pi}$$

Does converge to

$$\frac{e^{\pi } \left(1+e^{\pi }\right)}{\left(e^{\pi }-1\right)^3}$$

Which is easy provable by using differentiation under the summation sign together with the geometric series.