Solution (source code)

= Solution

The <moment-generating function> of a <random variable> $X$ is $M_X(t)=\mathbb E(e^{tX})$, defined for real $t$ where that expectation is finite. For a <standard normal distribution>, completing the square gives
$$
M_X(t)=\frac1{\sqrt{2\pi}}\int_{-\infty}^{\infty}e^{tx-x^2/2}\,dx
=e^{t^2/2}\frac1{\sqrt{2\pi}}\int_{-\infty}^{\infty}e^{-(x-t)^2/2}\,dx
=\boxed{e^{t^2/2}}.
$$
It is finite for every real $t$. Derivatives at zero give the <moments>: the expansion $e^{t^2/2}=1+t^2/2+t^4/8+O(t^6)$ therefore gives
$$
\boxed{\mathbb EX^0=1,\quad \mathbb EX=0,\quad \mathbb EX^2=1,
\quad \mathbb EX^3=0,\quad \mathbb EX^4=3.}
$$
For $Y$ with the <normal distribution> of mean $\mu$ and variance $\sigma^2$, write $Y=\mu+\sigma X$ in distribution. Its <moment-generating function> is consequently
$$
\boxed{M_Y(t)=e^{\mu t}M_X(\sigma t)
=\exp(\mu t+\sigma^2t^2/2).}
$$
This formula also covers the constant random variable when $\sigma=0$.