I would like to learn how to calculate the expected value of a continuous random variable. It appears that the expected value is E[X]=∫∞−∞xf(x)dx where f(x) is the probability density function of X.

Suppose the probability density function of X is f(x)=1√2πe−x22 which is the density of the standard normal distribution.

So, I would first plug in the PDF and get

E[X]=∫∞−∞x1√2πe−x22dx

which is a rather messy looking equation. The constant 1√2π can be moved outside the integral, giving

E[X]=1√2π∫∞−∞xe−x22dx.I get stuck here. How do I calculate integral? Am I doing this correctly this far? Is the simplest way to get the expected value?

**Answer**

You are almost there,

follow your last step:

E[X]=1√2π∫∞−∞xe−x22dx=−1√2π∫∞−∞e−x2/2d(−x22)=−1√2πe−x2/2∣∞−∞=0.

Or you can directly use the fact that xe−x2/2 is an odd function and the limits of the integral are symmetry.

**Attribution***Source : Link , Question Author : mmh , Answer Author : Deep North*