Proving $E[X^4]=3σ^4$

First with $\sigma=1$, omitting the range $(-\infty,\infty)$ for convenience and integrating twice by parts

$$E[X^4]=\frac{\displaystyle\int x^4e^{-x^2/2}dx}{\displaystyle\int e^{-x^2/2}dx}=\frac{-x^3e^{-x^2/2}+3\displaystyle\int x^2e^{-x^2/2}dx}{\displaystyle\int e^{-x^2/2}dx}=\frac{0-3xe^{-x^2/2}+3\displaystyle\int e^{-x^2/2}dx}{\displaystyle\int e^{-x^2/2}dx}=3.$$

Then by rescaling the variable,

$$3\sigma^4.$$


By observing the pattern, you easily generalize to

$$E[X^{2n}]=(2n-1)!!\sigma^{2n}.$$


I list some hints below.

The probability density function of a normally distributed random variable with mean $0$ and variance $\sigma^2$ is

\begin{equation} f(x) = \frac{1}{\sqrt{2 \pi \sigma^2}} \mathrm{e}^{-\frac{x^2}{2\sigma^2}}. \end{equation}

In general, you compute an expectation of a continuous random variable as

\begin{equation} \mathbb{E}[g(X)] = \int_{-\infty}^\infty g(x) f(x) \, \mathrm{d}x. \end{equation}

For your particular question we have that $g(x) = x^4$ and therefore

\begin{equation} \mathbb{E}[X^4] = \int_{-\infty}^\infty x^4 f(x) \, \mathrm{d}x = \frac{1}{\sqrt{2 \pi \sigma^2}} \int_{-\infty}^\infty x^4 \mathrm{e}^{-\frac{x^2}{2\sigma^2}} \, \mathrm{d}x. \end{equation}

You can solve this integral by using partial integration a number of times.

An alternative approach is to determine the moment generating function and differentiate. The moment generating function of a continuous random variable $X$ is defined as

\begin{equation} M_X(t) := \mathbb{E}[\mathrm{e}^{tX}] = \int_{-\infty}^\infty \mathrm{e}^{t x} f(x) \, \mathrm{d}x, \quad t \in \mathbb{R}. \end{equation}

For your random variable $X$ we have

\begin{equation} M_X(t) = \frac{1}{\sqrt{2 \pi \sigma^2}} \int_{-\infty}^\infty \mathrm{e}^{t x} \mathrm{e}^{-\frac{x^2}{2\sigma^2}} \, \mathrm{d}x. \end{equation}

Conveniently

\begin{equation} \mathbb{E}[X^n] = \frac{\mathrm{d}^n}{\mathrm{d}t^n} M_X(t) \bigg\vert_{t = 0}. \end{equation}


The moment generating function of the standard normal $$M_{Z}(t)= e^{t^2/2}$$ has fouth derivative $$M_{Z}''''(t)=3M_{Z}''(t)+tM_{Z}'''(t)$$ Setting $t=0$ results in $E(Z^4) = 3$. Now, $$ E(X^4)=\sigma^4E(Z^4)=3\sigma^4 $$