# Thread: Probabilty Density Function

1. ## Probabilty Density Function

Hi guy's
I have been given this question.

The Random variable X follows the distribution given by the density
f(x) = cxe^(-x^2/2)

determine c and E(x)

I've taken the integral of cxe^(-x^2/2) between 0 and infinity and tried to solve for 1.

But I'm getting the result of the intergral as C = 1

Is this right?

regards

2. Originally Posted by boneill3
Hi guy's
I have been given this question.

The Random variable X follows the distribution given by the density
f(x) = cxe^(-x^2/2)

determine c and E(x)

I've taken the integral of cxe^(-x^2/2) between 0 and infinity and tried to solve for 1.

But I'm getting the result of the intergral as C = 1

Is this right?

regards
Yes.

Now, the expected value would be $E(X)=\int_0^{\infty}x^2e^{-\frac{x^2}{2}}\,dx$

Here are two different approaches (one requires the definition of the Gamma Function, the other requires integration by parts):

To integrate this guy, make the substitution $u=\frac{x^2}{2}\implies\,du=x\,dx$

Now, we have $\int_0^{\infty}x\cdot e^{-u}\,du$

But, $u=\frac{x^2}{2}\implies x=\sqrt{2u}$

Thus, we have $\sqrt{2}\int_0^{\infty}u^{\frac{1}{2}}e^{-u}\,du$

Now, we can recognize $\int_0^{\infty}u^{\frac{1}{2}}e^{-u}\,du$ as $\Gamma\left(\tfrac{3}{2}\right)=\frac{\sqrt{\pi}}{ 2}$

Therefore, $\sqrt{2}\int_0^{\infty}u^{\frac{1}{2}}e^{-u}\,du=\sqrt{2}\cdot\frac{\sqrt{\pi}}{2}=\color{re d}\boxed{\frac{\sqrt{2}\sqrt{\pi}}{2}}$

--OR--

$\int_0^{\infty}x^2e^{-\frac{x^2}{2}}\,dx=\int_0^{\infty}x\cdot xe^{-\frac{x^2}{2}}\,dx$

Let $u=x\implies \,du=\,dx$ and $\,dv=xe^{-\frac{x^2}{2}}\,dx\implies v=-e^{-\frac{x^2}{2}}$

Thus, $\int_0^{\infty}x^2e^{-\frac{x^2}{2}}\,dx=\left.\left[-xe^{-\frac{x^2}{2}}\right]\right|_0^{\infty}+\int_0^{\infty}e^{-\frac{x^2}{2}}\,dx=\left[0+0\right]+\frac{1}{2}\sqrt{\frac{\pi}{1/2}}=\frac{1}{2}\sqrt{2\pi}=\color{red}\boxed{\frac {\sqrt{2}\sqrt{\pi}}{2}}$

Thus, $\color{red}\boxed{E(X)=\frac{\sqrt{2}\sqrt{\pi}}{2 }}$

Does this make sense?

--Chris

3. Thanks Chris,
That makes a lot of sense.

I found out what I was doing wrong in my own calculations for E(x) as well.

I was taking the integral of 1*x*e^-2^2/2 instead of x*x*e^-2^2/2 =... x^2*e^-2^2/2

Thanks alot I'll have to be more carefull in the future!
regards
Brendan