Solution (source code)

= Solution

The <moment-generating function> of a <random variable> $Z$ is $m_Z(\theta)=\mathbb E[e^{\theta Z}]$, at the real values of $\theta$ for which that <expectation> is finite. For a <standard normal distribution> variable $X$, combining the exponentials in its <probability density function> yields
$$
\mathbb E[e^{\theta X^2}]=\frac1{\sqrt{2\pi}}\int_{-\infty}^{\infty}e^{-(1-2\theta)x^2/2}\,dx=(1-2\theta)^{-1/2},\qquad \theta<\tfrac12.
$$
The last equality follows by scaling the <Gaussian integral>. The variables $X_i^2$ are <independent random variables>, so the <expectation> of their product factorizes. Therefore
$$
\boxed{m_Z(\theta)=\prod_{i=1}^n\mathbb E[e^{\theta X_i^2}]=(1-2\theta)^{-n/2},\qquad \theta<\tfrac12.}
$$
This is the <moment-generating function of a chi-squared distribution> with $n$ degrees of freedom. For positive $n$ the defining <integral> diverges at and above $\theta=1/2$.