MGF of a Gamma and Chi square
The probability density function (pdf) of a gamma distribution with shape parameter \(\alpha\) and rate parameter \(\beta\) is given by: \[ f(x; \alpha, \beta) = \frac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha-1} e^{-\beta x}, \quad x > 0 \]
The moment-generating function (MGF) is then defined as: \[ M_X(t) = E\left(e^{tX}\right) = \int_{0}^{\infty} e^{tx} \frac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha-1} e^{-\beta x} \, dx \]
Simplifying the integral, we have: \[ M_X(t) = \int_{0}^{\infty} \frac{\beta^\alpha}{\Gamma(\alpha)} x^{\alpha-1} e^{-(\beta - t) x} \, dx \]
Sub \(u = x(\beta - t)\) which implies \(\frac{1}{\beta - t} = x\) and \(dx = \frac{u}{\beta - t} du\)
\[ \begin{aligned} M_X(t) &= \frac{\beta^\alpha}{\Gamma(\alpha)} \int_{0}^{\infty} \left(\frac{u}{\beta - t}\right)^{\alpha - 1} e^{-u} \frac{1}{\beta - t} du \\ &= \frac{\beta^\alpha}{\Gamma(\alpha) (\beta - t)^\alpha} \int_{0}^{\infty} u^{\alpha - 1} e^{-u} du \\ &= \frac{\beta^\alpha}{\Gamma(\alpha) (\beta - t)^\alpha} \Gamma(\alpha) \\ &= \left(\frac{\beta}{\beta - t}\right)^{\alpha} \\ &= \left(\frac{\beta}{\beta(1- \frac{t}{\beta})}\right)^{\alpha} \\ &= \left(1 - \frac{t}{\beta}\right)^{-\alpha} \\ \end{aligned} \]
Note that we are using the shape and rate parameterization of the gamma distribution. To see the proof using the scale parameter \(\theta = 1/\beta\) parameterization see: https://online.stat.psu.edu/stat414/lesson/15/15.6
Chi-square
Note that the \(\chi^2_n\), a chi square RV with \(n\) degrees of freedom, is a special case of the gamma distribution. That is if \[ \begin{align} X &\sim \chi^2_n \text{ and } c> 0 \text{ then } \\ cX &\sim \text{Gamma}(\alpha = n/2, \beta = 1/2c) \end{align} \] Hence the MGF of a \(\chi^2_n\) is: \[ (1-2t)^{-n/2} \text{ for } t<{\frac {1}{2}} \]