The question is as follows:
Let $X$ be exponentially distributed with parameter $\lambda$, Find $\mathbb{E}[e^{sX}]$, where $s$ is a real parameter. For what values of $s$ does the expectation exist?
I understand how to find the expectation, but I am not sure exactly how to interpret the $\mathbb{E}[e^{sX}]$ part. I am only used to finding $\mathbb{E}[X]$, not the expectation of a composite function. How do I go about solving this?
Since $x\mapsto e^{sx}$ is a measurable function, we may use the law of the unconscious statistician to compute \begin{align} \mathbb E[e^{sX}] &= \int_{\mathbb R}\lambda e^{-\lambda x}e^{sx}\ \mathsf dx\\ &= \lambda\int_0^\infty e^{(s-\lambda)x}\ \mathsf dx\\ &= \frac\lambda{\lambda-s}. \end{align} Recall that $\sum_{n=0}^\infty z^n = \frac1{1-z}$ for $|z|<1$. Writing $z:=\frac s\lambda$, we have $$ \sum_{n=0}^\infty \left(\frac s\lambda\right)^n = \frac1{1-\frac s\lambda}= \frac \lambda{\lambda-s}, $$ and this series converges precisely when $s<\lambda$.