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.
Your change of variables is off. If you want to reason on integral (though drhab reasonning is much simpler) :
$$ 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$$