I have the following in my textbook:

And I'm trying to verify that $M(t) = (1-t)^{-1}$ on my own. I'm getting: $$ f(x) = e^{-x} $$ $$ M(t) = \int_0^\infty e^{tx}f(x) ~dx $$ $$ = \int_0^\infty e^{tx}e^{-x} ~dx $$ $$ = \int_0^\infty e^{x(t - 1)} ~dx $$ $$ = \left. \frac{e^{x(t - 1)}}{t - 1} \right|_{x = 0}^\infty $$ But this appears to be infinity. I saw this post where the person evaluates the integral from t=0 to infinity, but if that's correct, I'm not sure why it would be evaluated over the t range and not the x range.
Any help on this would be appreciated.
As kmitov says in a comment, $\displaystyle \left. \frac{e^{x(t - 1)}}{t - 1} \right|_{x = 0}^\infty$ is not infinity because $t\lt 1$, and thus $t-1$ is negative and $e^{x(t - 1)}$ tends to $0$ as $x$ increases without limit.
So the integral evaluates to $\dfrac{0}{t-1}-\dfrac{1}{t-1}= \dfrac{1}{1-t}$.