Let $X$ be a random variable with PDF $f$ given by:
$$f(x)=\begin{cases}4xe^{-2x} & 0\le x\lt\infty,\\ 0 & \mathrm{otherwise}\end{cases}$$
Find $\mathrm E(X)$ and $\mathrm{Var}(X)$.
I can find $\mathrm E(X)$ using the Gamma function but I'm not sure on how to use it to find $\mathrm Var(X)$ because it's $4x^3$ instead of $4x^2$ because I make $u = 2x$
Edit : I asked this question before but with normal solution like parts by part and now I just found a new way which is Gamma function and I'm not sure on how to use it on $\mathrm Var(X)$ so I asked about this question again
Note that
$$\int_0^\infty x^ne^{-x}\mathrm dx=\Gamma(n+1)$$
Here,
$$E(X)=\int_0^\infty x f(x)\mathrm dx=4\int_0^\infty x^2 e^{-2x}\mathrm dx\\=4\int_0^\infty\frac{1}{4}u^2e^{-u}\frac{1}{2}\mathrm du=\frac{1}{2}\int_0^\infty u^2e^{-u}\mathrm du=\frac12\Gamma(3)$$
$$E(X^2)=\int_0^\infty x^2 f(x)\mathrm dx=4\int_0^\infty x^3 e^{-2x}\mathrm dx\\=4\int_0^\infty\frac{1}{8}u^3e^{-u}\frac{1}{2}\mathrm du=\frac{1}{4}\int_0^\infty u^3e^{-u}\mathrm du=\frac14\Gamma(4)$$
Can you take it from here?
Note also that $\Gamma(n+1)=n!$, so you can further simplify.