# Integral involving gamma function (finding the MGF of gamma distribution)

A question on this probability paper is asking to find the moment generating function of a gamma distribution with parameters $(\alpha,\theta)$. The pdf is given as $$f_{\alpha,\theta}(x)=\frac{x^{\alpha-1}e^{-x/\theta}}{\Gamma(\alpha)\theta^\alpha}$$ when $x>0$, and $0$ otherwise, where $\Gamma(\alpha)=\int_0^\infty x^{\alpha-1}e^{-x}$ is the gamma function.

Using the law of the unconscious statistician, the MGF can be found as follows: \begin{align} E[e^{tX}] &=\int_0^\infty e^{tx}f_{\alpha,\theta}(x)\,dx \\ &=\frac{1}{\Gamma(\alpha)\theta^\alpha}\int_0^\infty e^{tx}x^{\alpha-1}e^{-x/\theta}\,dx\\ &=\frac{1}{\Gamma(\alpha)\theta^\alpha}\int_0^\infty x^{\alpha-1}e^{-x(\frac 1\theta-t)}\,dx. \end{align} At this point I notice that the integral is very similar to $\Gamma(\alpha)$, and I feel like it would be good to somehow cancel these. Is there a way to extract the $(\frac 1\theta-t)$?

First note that the integral only converges if $\frac{1}{\theta}>t$. Then make the substitution $u=(\frac{1}{\theta}-t)x$, and the result will be a gamma integral.