# $\int^\infty_0\frac{x^2e^{-x/y}}y\,dx$

I've come across a rather difficult expression to integrate. $$\int^\infty_0\frac{x^2e^{-x/y}}y\,dx$$ Is there an easy way to solve this? I've solved it manually which involved multiple u-subs and integration by parts, and took up a decent amount of my time. This comes from a probability textbook so I doubt they want me to spend so much time solving an integral.

The final answer should be $2y^2$.

• The book probably assume you know the identity $\int_0^\infty t^n e^{-t} dt = n!$. This integral representation of $n!$ is useful when you want to transform series which contains $n!$ in its numerator. – achille hui Dec 11 '17 at 23:53

Let us define $z = x/y$, so $dz=dx/y$. Hence, we need to compute the following integration: $$y^2 \int_0^{\infty} z^2 e^{-z} dz = y^2 \Gamma(3)=2y^2.$$
The definition of the $\Gamma$ function: $$\Gamma (n) = \int_0^{\infty} z^{n-1} e^{-z} dz,$$ and $$\Gamma (n) = (n-1) \Gamma(n-1)=(n-1)!.$$
Since $y$ is constant, a change of variables $u = x/y$ means that you just need to compute $$y^2 \int_0^{\infty} u^2 e^{-u}\, du$$ which is handled by two applications of integration by parts.
Using a probabilistic approach denote $X\sim \mathcal{E}xp (1/y)$, hence $$Var(X) = \mathbb{E}X^2 - \mathbb{E}^2X = y^2,$$ hence, $$\mathbb{E}X^2 = \int_0^{\infty}x^2\frac{1}{y}e^{-x/y}dx=Var(X)+\mathbb{E}^2X=y^2+y^2=2y^2.$$ Basically, without probability you can just use integration by parts by denoting $u'_x = \frac{1}{y}e^{-x/y}$ and $v=x^2$.