Solving an Improper Integral: $\int_0^\infty r^2 e^{-a\cdot r}dr$ I have an improper integral as follows: 

$$\int_0^\infty r^2 e^{-a\cdot r}dr.$$ 

I try to evaluate it by parts and get $ [ -(\dfrac{r^2}{a} + \dfrac{2r}{a^2} + \dfrac{2}{a^3}) \cdot e^{-a \cdot r} ]^\infty_0 $, which leads me to nowhere. 
According to the given solution, this integral can be solved like this:
$\int_0^\infty r^2 e^{-a\cdot r} = \dfrac{\delta^2}{\delta r^2} \int_0^\infty e^{-a\cdot r} = ... = \dfrac{2}{a^3} $
Which rule did they apply here (for the derivative)? 
 A: Hint...if you evaluate the expression you found, rather than leading you "nowhere" you get the same answer as given in the alternative solution. This is because $$x^ne^{-x}\rightarrow0$$ as $x\rightarrow\infty$
A: Method 1. One may integrate by parts twice as follows,
$$
\begin{align}
\int_0^\infty r^2 e^{-a\cdot r}dr&=\left[ r^2\:\frac{e^{-a\cdot r}}{-a}\right]_0^\infty+\frac1a\int_0^\infty (2r)\: e^{-a\cdot r}dr
\\\\&=0+\frac{2}a\int_0^\infty r\: e^{-a\cdot r}dr
\\\\&=\frac{2}a\left(\left[ r\:\frac{e^{-a\cdot r}}{-a}\right]_0^\infty+\frac1a\int_0^\infty e^{-a\cdot r}dr\right)
\\\\&=\frac{2}a\left(0+\frac1a\cdot \frac1a\right)
\\\\&=\frac{2}{a^3}
\end{align}
$$ where we have used that, for any fixed real numbers $n$ and $a>0$,
$$
\lim_{r \to \infty}\left(r^n \cdot e^{-a\cdot r}\right)=0.
$$
Method 2. One may apply the Leibniz integral rule twice (all conditions are OK here):
$$\frac{d}{da} \left ( \int_\alpha^\beta f(a,x) \,\mathrm{d}x \right )= \int_\alpha^\beta \frac{\partial}{\partial a}f(a,x) \,\mathrm{d}x,$$
on the one hand,
$$\frac{d^2}{da^2} \left (\int_0^\infty e^{-a\cdot x} \,\mathrm{d}x \right )= \int_0^\infty \frac{\partial^2}{\partial a^2}e^{-a\cdot x} \,\mathrm{d}x=\int_0^\infty x^2 \cdot e^{-a\cdot x} \,\mathrm{d}x$$
on the other hand,
$$\frac{d^2}{da^2} \left (\int_0^\infty e^{-a\cdot x} \,\mathrm{d}x \right )= \frac{d^2}{da^2} \left (\frac1a\right )=\frac{2}{a^3}.$$
A: OK, made a mistake for the second method (apologies): For the second method you have to consider $$I(a) = \int_0^\infty e^{-a\cdot r} \, dr$$ Then if you look at $\frac{\partial^2 }{\partial \, a^2} I(a)$ this is equal to the required integral. But you have $I(a)= \frac{1}{a}$ and you can easily work out $\frac{\partial^2 }{\partial \, a^2} \frac{1}{a}$. As an additional point, you can't really look at $\frac{\partial^2 }{\partial \, r^2} \int_0^\infty r^2 e^{-a\cdot r} \, dr$, since $r$ is an integration variable.
