# What's wrong with my calculation? $\mathrm E[X^3]$ where $X\sim N(0,1)$

Let $$X\sim N(0,1)$$, compute $$\mathrm E[X^3]$$:

My attempt:

$$\mathrm E[X^3]=\int_{-\infty}^{\infty}x^3\frac{1}{\sqrt{2\pi}}e^{-\frac{x^2}{2}}\mathrm d x \\ x^2=t \Rightarrow \mathrm dx=\frac{\mathrm dt}{2x}\\ \mathrm E[X^3]=\frac{1}{\sqrt{2\pi}}\int_{0}^{\infty} t\frac{1}{2}e^{-\frac{t}{2}}\mathrm dt=\frac{1}{\sqrt{2\pi}}E[Y] \\ Y\sim \exp(\frac{1}{2}) \\ \Rightarrow \mathrm E[X^3]=\frac{1}{\sqrt{2\pi}}\frac{1!}{0.5^1}=\frac{2}{\sqrt{2\pi}}$$

I used the fact that if $$X\sim \exp(\lambda)$$ then $$\mathrm E[X^n]=\dfrac{n!}{\lambda^n}$$

But the actual is result is $$0$$! Why is that? what am I missing here??

Thanks.

• Observe that the first written integrand takes negative values, and the second does not. Btw, $X$ and $-X$ have equal distribution. So also $X^3$ and $(-X)^3=-X^3$ have equal distribution so that $\mathbb EX^3=\mathbb E[-X^3]=-\mathbb EX^3$. This implies that $\mathbb EX^3=0$. – drhab Feb 11 at 10:17
• @drhab I am not sure I'm following – superuser123 Feb 11 at 10:19
• You integrate an odd function on a symmetric interval... – Bertrand Feb 11 at 10:25
• The change of variable formula is not valid here. Read the theorem on change of variables in baby Rudin. – Kavi Rama Murthy Feb 11 at 10:28

$$E[X^3]=\int_{-\infty}^{+\infty} x^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx$$ $$E[X^3]=\int_{-\infty}^{0} x^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx + \int_{0}^{+\infty} x^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx$$ Applying the change of variable $$x\mapsto -x$$ in the first integral, step by step $$E[X^3]=\int_{+\infty}^{0} (-x)^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}(-dx) + \int_{0}^{+\infty} x^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx$$ $$E[X^3]=\int_{+\infty}^{0} x^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx + \int_{0}^{+\infty} x^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx$$ $$E[X^3]=-\int_{0}^{+\infty} x^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx + \int_{0}^{+\infty} x^3\frac{1}{\sqrt{2\pi}}e^{-x^2/2}dx$$ $$E[X^3]=0$$
If $$x$$ runs from $$-\infty$$ to $$\infty$$, $$t:=x^2$$ runs from $$\infty$$ to $$0$$ then back to $$\infty$$, and the two contributions cancel each other.
The good news is that your one-sided integral, from $$0$$ to $$\infty$$ is correct.