# Find E(X) for a certain function using the gamma function

The question I have to do is essentially this:

A distribution, X, is modelled by $\displaystyle f(x)= \frac{x}{\sigma^2}e^{-x^2/2\sigma^2},\ x\ge0.$ Show that $\displaystyle E(X)=\sigma \sqrt{\frac{\pi}{2}}$ using the gamma function and its properties.

My attempt:

Using $\displaystyle E(X)=\int_a^bxf(x)\ dx:$

$\displaystyle =\int_0^\infty x(\frac{x}{\sigma^2}e^{-x^2/2\sigma^2})\ dx$

$\displaystyle =\int_0^\infty \frac{x^2}{\sigma^2}e^{-x^2/2\sigma^2}\ dx$

Let $\displaystyle u=\frac{x^2}{2\sigma^2}.$ When $x=\infty,u=\infty$ and when $x=0, u=0$ so our limits of integration are the same.

Also $\displaystyle \frac{du}{dx}=\frac{x}{\sigma^2}$

$\displaystyle \implies du=\frac{x}{\sigma^2}dx$

So $\displaystyle \int_0^\infty \frac{x^2}{\sigma^2}e^{-x^2/2\sigma^2}\ dx = \displaystyle \int_0^\infty xe^{-u}\ du$

which isn't very helpful and not in the gamma function form so I can't substitute anything. Different change of variables maybe?

• How did you get from the line with $xe^{-u}$ to the $\sqrt2$ line? – Sonjov Aug 23 '18 at 6:51
• $u = \frac{x^2}{2\sigma^2}$, take square root on both sides to express $x$ in terms of $u$. – Siong Thye Goh Aug 23 '18 at 6:53