[example: A Random Variable with No Positive Exponential Moment]
Let $X \sim \operatorname{Exp}(\lambda)$ with $\lambda>0$, so its density is $f_X(x)=\lambda e^{-\lambda x}$ on $[0,\infty)$. Throughout this example, $d\mathcal L^1(x)$ means integration with respect to one-dimensional [Lebesgue measure](/page/Lebesgue%20Measure) on the real line. We write $M_X(t):=\mathbb E[e^{tX}]$ whenever this expectation is finite, and $D_X:=\{t\in\mathbb R:\mathbb E[e^{tX}]<\infty\}$ for the set of such parameters. For $t \in \mathbb R$, the expectation formula for a [random variable](/page/Random%20Variable) with density gives
\begin{align*}
\mathbb E[e^{tX}]=\int_0^\infty e^{tx}\lambda e^{-\lambda x}\,d\mathcal L^1(x).
\end{align*}
Since $e^{tx}e^{-\lambda x}=e^{(t-\lambda)x}=e^{-(\lambda-t)x}$, this becomes
\begin{align*}
\mathbb E[e^{tX}]=\lambda\int_0^\infty e^{-(\lambda-t)x}\,d\mathcal L^1(x).
\end{align*}
If $t<\lambda$, then $\lambda-t>0$, and for each $R>0$,
\begin{align*}
\lambda\int_0^R e^{-(\lambda-t)x}\,d\mathcal L^1(x)=\lambda\left[\frac{-e^{-(\lambda-t)x}}{\lambda-t}\right]_{0}^{R}.
\end{align*}
Evaluating the endpoints gives
\begin{align*}
\lambda\left[\frac{-e^{-(\lambda-t)x}}{\lambda-t}\right]_{0}^{R}=\frac{\lambda}{\lambda-t}\left(1-e^{-(\lambda-t)R}\right).
\end{align*}
Letting $R\to\infty$ and using $e^{-(\lambda-t)R}\to 0$ gives
\begin{align*}
\mathbb E[e^{tX}]=\frac{\lambda}{\lambda-t}.
\end{align*}
If $t=\lambda$, then the integrand is $\lambda e^0=\lambda$, so
\begin{align*}
\lambda\int_0^R 1\,d\mathcal L^1(x)=\lambda R,
\end{align*}
which tends to $\infty$ as $R\to\infty$. If $t>\lambda$, then $t-\lambda>0$, and
\begin{align*}
\lambda\int_0^R e^{(t-\lambda)x}\,d\mathcal L^1(x)=\frac{\lambda}{t-\lambda}\left(e^{(t-\lambda)R}-1\right),
\end{align*}
which also tends to $\infty$ as $R\to\infty$. Hence
\begin{align*}
D_X=(-\infty,\lambda)
\end{align*}
and
\begin{align*}
M_X(t)=\frac{\lambda}{\lambda-t}
\end{align*}
for $t<\lambda$. This example shows that the formula for $M_X(t)$ is inseparable from its domain: the same expression that is finite near $0$ reaches a boundary at $t=\lambda$, where the positive exponential weight overwhelms the exponential tail of $X$.
[/example]