$X$ has the probability density function $f(x)=\frac{1}λe^{-x/λ}$.
The expected value of $X^2$ should be (according to wikipedia) equal to $n!/λ^n$ , namely $2/λ^2$. This should be derived from the integral $E(X^2)=\int x^2f(x)dx$, with the limits ranging from $0$ to $∞ $.
I've tried integrating by parts but I still cannot derive the correct answer, am I forgetting something? Thankful for any aid or hints!
Edit: I'll update with my integration by parts (twice).
$E(X^2)=\int x^2f(x) dx= [-x^2e^{-x/λ}]-\int -2xe^{-x/λ} = [-x^2e^{-x/λ}]+2\int xe^{-x/λ}=$
$=[-x^2e^{-x/λ}]+2([-x\frac{1}λe^{-x/λ}]+\int\frac{1}λe^{-x/λ}) =[-x^2e^{-x/λ}] +2[-x\frac{1}λe^{-x/λ}] + 2[-e^{-x/λ}] =$
$= 0+0+2(0+1/e^0)=2$
$$\mathbb{E}[X^2] = \int_{0}^{\infty}x^2\dfrac{1}{\lambda}e^{-x/\lambda}\text{ d}x = \dfrac{1}{\lambda}\int_{0}^{\infty}x^2e^{-x/\lambda}\text{ d}x\text{.}$$ There is a useful result that can come into play here: namely, for $a > 0$ and $n \in \mathbb{Z}_{+}$, $$\int_{0}^{\infty}x^ne^{-ax}\text{ d}x = \dfrac{n!}{a^{n+1}}$$
hence $$\int_{0}^{\infty}x^2e^{-x/\lambda}\text{ d}x = \dfrac{2!}{(1/\lambda)^{3}} = 2\lambda^3\text{.}$$ So, the expected value in this case is $\dfrac{2\lambda^3}{\lambda} = 2\lambda^2$.
I think your PDF is wrong: it should probably be $f(x) = \lambda e^{-\lambda x}$, $\lambda, x > 0$.
If this were the case, $$\mathbb{E}[X^{2}] = \int_{0}^{\infty}x^2\lambda e^{-\lambda x}\text{ d}x = \lambda \int_{0}^{\infty}x^2e^{-\lambda x}\text{ d}x = \lambda\left(\dfrac{2!}{\lambda^3}\right) = \dfrac{2}{\lambda^2}\text{.}$$