# Finding the Moment Generating Function of $X^2$ when $X\sim N(0,1)$

If $$X\sim N(0,1)$$, integrate to find the moment generating function of a random variable $$X^2$$ and identify the distribution of $$X^2$$ using the moment generating function.

$$E\left[e^{tX^2}\right]=\int_{-\infty}^{\infty}{e^{tx^2}e^{-x^2}\over{\sqrt{2\pi}}}dx$$

which reduces to

$$=\frac1{\sqrt{2\pi}} \int_{-\infty}^{\infty}{e^{tx^2}e^{-x^2}}dx =\frac1{\sqrt{2\pi}} \int_{-\infty}^{\infty}{e^{x^2(t-\frac12)}}dx$$

and thus I am stuck. I'm sure there must be some trick to this (like completely the square for the mgf of a standard normal variable X) but I can't figure out what it might be.

Any hints?

The mgf will only be defined when $t\lt 1/2$.
We need $$\int_{-\infty}^\infty \frac{1}{\sqrt{2\pi}}e^{-x^2(1/2-t)}\, dx.$$ The exponent can be written as $-(x^2/2)(1-2t)$.
Make the change of variable $u=x\sqrt{1-2t}$. Then $dx =\frac{1}{\sqrt{1-2t}}\,du$. Note that as $x$ travels from $-\infty$ to $\infty$, so does $u$. You should end up with something like $$\frac{1}{\sqrt{1-2t}}\int_{-\infty}^\infty \frac{1}{\sqrt{2\pi}}e^{-u^2/2}\,du.$$ Now we recognize that the integral part is $1$.