# Moment Generating Function for Gamma Distribution

Let $X$ be a Gamma random variable with shape parameter $\alpha=2$ and scale parameter $\theta=1$. Then the moment generating function of $X$ is

$$m_X(t) = \frac{1}{(1-t)^2}, t<1.$$

It is clear that the $t\neq 1$. However, it is also clear that $m_X(t)$ is defined when $t>1$ as shown in the following picture. Then, why do we need to impose the condition $t<1$ here, please?

First, you've mixed up your variables, using $r$ in some cases and $t$ in others. I will use $t$.
Next, you should think about what it means to evaluate an MGF at a point. Recall that $$M_X(t) = {\rm E}[e^{tX}].$$ So if $X \sim {\rm Gamma}(2,1)$, then in order for the MGF of $X$ at, say, $t = 2$ to be defined, we would require the integral $${\rm E}[e^{2X}] = \int_{x=0}^\infty e^{2x} xe^{-x} \, dx$$ to be convergent. But it isn't, so even though the formula $M_X(t) = (1-t)^{-2}$ is valid for $t < 1$, it isn't valid when $t > 1$ because in order to have obtained that expression, we had to impose a condition on the value of $t$ for which the integral converges.