how to compute $E(X^4)$ when $X$ follow the normal law $N(0,1)$

Let $W = X^2$. Then $E[X^4] = E[W^2]$. From the formula for variance,

$$E[W^2] = Var(W) + E[W]^2 $$

$$E[W]^2 = E[X^2]^2 = (Var(X) + E[X]^2)^2 = (1 + 0^2)^2 = 1$$

Note that $W$ is a $\chi^2$ r.v. with one degree of freedom. The variance of a chi-squared is twice its degrees of freedom, thus $Var(W)=2$.

Then: $$E[X^4] = E[W^2] = 2 + 1 = 3$$

(assuming you can use facts about the chi-squared distribution)


\begin{align} & \frac 1 {\sqrt{2\pi}} \int_{-\infty}^\infty x^4 e^{-x^2/2}\,dx \\[10pt] = {} & 2\cdot\frac 1 {\sqrt{2\pi}} \int_0^\infty x^4 e^{-x^2/2} \, dx & & \text{since the integral is of an even} \\ & & & \text{function over an interval that} \\[8pt] & & & \text{is symmetric about 0} \\[10pt] = {} & \sqrt{\frac 2 \pi} \int_0^\infty x^3 e^{-x^2/2} (x\,dx) \\[10pt] = {} & \sqrt{\frac 2 \pi} \int_0^\infty (2u)^{3/2} e^{-u} \, du \\[10pt] = {} & \frac 4 {\sqrt\pi} \int_0^\infty u^{3/2} e^{-u} \, du \\[10pt] = {} & \frac 4 {\sqrt\pi}\,\, \Gamma\left(\frac 5 2 \right) \\[10pt] = {} & \frac 4 {\sqrt\pi} \cdot\frac 3 2 \Gamma\left( \frac 3 2 \right) \\[10pt] = {} & \frac 4 {\sqrt\pi} \cdot \frac 3 2 \cdot \frac 1 2 \cdot \Gamma\left( \frac 1 2 \right) \\[10pt] = {} & \frac 4 {\sqrt\pi} \cdot \frac 3 2 \cdot \frac 1 2 \cdot \sqrt\pi \\[10pt] = {} & 3. \end{align}


If you know about the moment-generating function for the standard normal, which is $M_X(t) = e^{t^2/2}$, then you have $E(X^4) = M_X^{(4)}(0)$ (i. e. the fourth derivative of $M_X$ evaluated at 0.) But by the usual series expansion you have

$$M_X(t) = 1 + {t^2 \over 2} + {1 \over 2!} \left( {t^2 \over 2} \right)^2 + \cdots $$

and so the $t^4$ term of that series is $1/8$; thus the fourth derivative is $4!/8 = 3$.