[Math] Moment Generating Function of Gaussian Distribution

moment-generating-functionsnormal distributionprobabilityprobability distributions

Derive from first principles, the moment generating function of a Gaussian Distribution with $$PDF= \dfrac{1}{\sqrt{2\pi \sigma^2}}e^{-(x- \mu)^2/2\sigma^2}$$

MY ATTEMPT

MGF= E[$e^{tx}$]= $$\int_{-\infty}^{\infty} e^{tx} \dfrac{1}{\sqrt{2\pi \sigma^2}}e^{-(x- \mu)^2/2\sigma^2}dx$$
Now to perform a substitution;
z= $\dfrac{(x- \mu)}{\sigma}$
$x=z\sigma + \mu$
$dx=\sigma \ \ du$
$$\int_{-\infty}^{\infty} e^{tz\sigma}e^{t\mu} \dfrac{1}{\sqrt{2\pi }}e^{-z^2/2}dz$$ which can be rewritten as ;
$$e^{t\mu}\int_{-\infty}^{\infty} e^{tz\sigma} \dfrac{1}{\sqrt{2\pi }}e^{-z^2/2}dz \ \ \ \ \ \ (*)$$

I have also noted that for the standard gaussian distribution the moment generating function is as follows;
MGF=E[$e^{tx}$]=$$\int_{-\infty}^{\infty} e^{tx} \dfrac{1}{\sqrt{2\pi }}e^{-x^2/2}dx=e^{t^2/2}$$
Now what Im having trouble with is combining these two facts…..
I know the
CORRECT ANSWER I SHOULD GET; $$MGF \ \ = \ \ e^{\mu t}e^{\sigma^2 t^2 /2}$$

Now I can rewrite (*) as ;
$$e^{t\mu}e^{ \sigma}\int_{-\infty}^{\infty} e^{tz} \dfrac{1}{\sqrt{2\pi }}e^{-z^2/2}dz$$ and this equals (by comparison to standard gaussian); $$e^{t\mu}e^{ \sigma}e^{t^2/2}$$ but it seems ive lost a $\sigma $ somewhere?!

Best Answer

$$\int_{-\infty}^{\infty} e^{tx} \dfrac{1}{\sqrt{2\pi \sigma^2}}e^{-(x- \mu)^2/2\sigma^2}dx$$

$$=\int_{-\infty}^{\infty} \dfrac{1}{\sqrt{2\pi \sigma^2}}e^{-(x^2 -2x(\mu+t\sigma^2)+ \mu^2)/2\sigma^2}dx$$

$$=e^{((\mu+t\sigma^2)^2-\mu^2)/2\sigma^2}\int_{-\infty}^{\infty} \dfrac{1}{\sqrt{2\pi \sigma^2}}e^{-(x -(\mu+t\sigma^2))^2/2\sigma^2}dx$$

and the integral should be obvious while the term outside can be tidied up