I am trying to get the mgf for the chi-squared distribution but I keep getting $(1-2t)^{1/2}$ instead of $(1-2t)^{-\frac{1}{2}}$.
My method was:
$E(e^{tZ}) = \int_{-\infty}^{\infty}{e^{tz}\frac{}{\sqrt z\sqrt {2\pi}}{e^{-z/2}}} dz$
Then multiplying in I get: $\int_{-\infty}^{\infty}\frac{e^{\frac{-z(1-2t)}{2}}}{\sqrt z \sqrt {2\pi}} dz$
Now I want to force a $\sqrt {1-2t}$ into the denominator and cancel the integral to $1$. But then I have to multiply by $\frac{\sqrt{1-2t}}{\sqrt{1-2t}}$ and then the denominator of the integral absorbs the denominator of the fraction leaving me with $\sqrt{1-2t}$ as the M.G.F. Where am I going wrong???
Hint: use the substitution $u = \frac{1-2t}{2}x$. Then $du= \frac{1-2t}{2}dx$. Also, remember that you're only integrating over $(0, \infty)$, not $(-\infty, \infty)$.