# E(|X|) for a normal r.v

I struggle with absolute value. Here I need to find $\mathbb{E}[X^4]$ and $\mathbb{E}[|X|]$ knowing that $X$ is a normally distributed random variable with zero mean and variance $\sigma^2$.

I know the pdf of the normal r.v. and the way to compute $\mathbb{E}[X^4]$:

$$\mathbb{E}[X^4]=\int x^4 f_X(x) dx$$

But how should I handle the absolute sign when I compute:

$$\int \mid x \mid f_X(x) dx$$

I understand I should divide the integral into the part from $-\infty$ to $0$ and 0 to $\infty$ and take that into account, but how ?

Hint: $$\int_{-\infty}^{+\infty}|x|f_X(x)\,dx= -\int_{-\infty}^0xf(x)\,dx+\int_0^{+\infty}xf(x)\,dx$$ this follows simply by definition of the absolute value.

• Exactly the little hint I needed. Simple but extremely helpful. Thanks ! – endlessend2525 Dec 17 '16 at 15:46
• @endlessend2525 you're welcome! – Joe Dec 17 '16 at 18:42

Another way

Set $Y=|X|$ we have \begin{align*} G_Y(y)&=\mathbb{P}(Y\le y)\\ &=\mathbb{P}(\,|X|\le y\,)\\ &=\mathbb{P}(-y\le X\le y)\\ &=F_X(y)-F_X(-y) \end{align*}

Therefore

$$g_Y(y)=f_X(y)+f_X(-y)$$ In other words \begin{align*} g_Y(y)=\begin{cases} \frac{2}{\sqrt{2\pi}}e^{-\frac 12 y^2}\, &,\,y>0\\ 0 &,\text{o.w} \end{cases} \end{align*} thus

$$\mathbb{E}[|X|]=\mathbb{E}[Y]=\frac{2}{\sqrt{2\pi}}\int_{0}^{\infty}ye^{-\frac 12 y^2}dy$$

• Why stop without computing the last integral? – Did Dec 21 '16 at 18:08
• Set $y^2=u$ . we have $2ydy=du$ – Behrouz Maleki Dec 21 '16 at 18:11
• I know, thanks, the mistake not included (you forgot a factor 2)... The point is that this should be in the answer. – Did Dec 21 '16 at 18:25