$\int^\infty_0\frac{x^2e^{-x/y}}y\,dx$
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$.