Determining $E|X^{n}|$ for $X \sim N(0,1)$ and $n$ odd. Let $X \sim N(0,1)$. What is $E|X^{n}|$ for $n \in \mathbb{N}$ odd?
Attempt: Since $X = -X$ in distribution, we have that $(-X)^{n} = X^{n} = -X^{n}$ in distribution. Then
$$E|X^{n}| = E(X^{n})^{+} + E(X^{n})^{-} = EX^{n} = 0$$
since $X^{n} = -X^{n}$ in distribution.
But I have been given to understand that this is not true.
 A: The expected value is
$$
E_n = E[|X|^{2n+1}] = 2 \int_0^\infty \frac1{\sqrt{2\pi}} \exp\left(-\frac{x^2}2\right)x^{2n+1} dx
$$using parity to get rid of the $\{x<0\}$ part.
As you know that $$
\frac d{dx} \exp\left(-\frac{x^2}2\right) = -x \exp\left(-\frac{x^2}2\right)
$$
you can integrate by parts:
$$
E_n = \left[-2 \frac1{\sqrt{2\pi}} \exp\left(-\frac{x^2}2\right)x^{2n} \right]_0^\infty
+ 2\times 2n \int_0^\infty \frac1{\sqrt{2\pi}} \exp\left(-\frac{x^2}2\right)x^{2n-1} dx
\\ = 2n E_{n-1}
$$
if $n\neq 0$ and if $n=0$:
$$
E_0 = 2 \int_0^\infty \frac1{\sqrt{2\pi}} \exp\left(-\frac{x^2}2\right)x dx
= \left[-2 \frac1{\sqrt{2\pi}} \exp\left(-\frac{x^2}2\right) \right]_0^\infty
\\=\sqrt \frac 2\pi
$$
and so:
$$
E_n = 2^n n! \sqrt \frac 2\pi
$$
A: Yes. You are wrong:
$E[|X^n|]=\int_{-\infty}^{\infty}|x|^np(x)\space dx=\int_{-\infty}^{0}(-1)^nx^np(x)dx+\int_{0}^{\infty}x^np(x)\space dx=\int_{0}^{\infty}x^np(x)\space dx-\int_{-\infty}^{0}x^np(x)dx$
Now if you let $x=-u$, you will have:
$\int_{0}^{\infty}x^np(x)\space dx-\int_{-\infty}^{0}x^np(x)dx=\int_{0}^{\infty}x^np(x)\space dx-\int_{\infty}^{0}(-1)^nu^np(u)\space (-du)=\int_{0}^{\infty}x^np(x)\space dx+\int_{0}^{\infty}u^np(u)\space du=2\int_{0}^{\infty}x^np(x)\space dx$
A: If you are familiar with the Gamma function, then there is a shorter way to calculate the moments:
First of all, by symmetry,
$$\mathbb{E}(|X|^{2k+1}) = \frac{1}{\sqrt{2\pi}} \int_{\mathbb{R}} |x|^{2k+1} \exp \left(- \frac{x^2}{2} \right) \, dx = \frac{2}{\sqrt{2\pi}} \int_0^{\infty} x^{2k+1} \exp \left(- \frac{x^2}{2} \right) \, dx.$$
Now substitute $y:= x^2/2$, i.e. $dy/dx=x$:
$$\mathbb{E}(|X|^{2k+1}) = \sqrt{\frac{2}{\pi}} 2^{k} \int_0^{\infty} y^{k} \exp(-y) \, dy = \frac{2^{k+1/2}}{\sqrt{\pi}} \underbrace{\Gamma \left( k+1 \right)}_{k!}.$$
Hence,
$$\mathbb{E}(|X|^n) = \frac{2^{n/2}}{\sqrt{\pi}} \left( \frac{n-1}{2} \right)!$$
for any odd $n$.
