> [!definition]
>
> $
> M_X(t) = \ev(e^{tX})
> $
> The moment generating [[Function|function]] of a [[Random Variable|random variable]] $X$ is the [[Expectation|expected value]] of $e^{tX}$. The $n$-th [[Derivative|derivative]] of a moment generating function of a [[Probability Distribution|probability distribution]], evaluated at $t = 0$, is known as its **$n$-th moment**.
> [!theorem]
>
> The moment generating function generates [[Moment|moments]].
> $
> \ev{(X^n)} = \frac{d^n}{dt^n}M_{X}(t)|_{t = 0}
> $
> *Proof (Discrete Case)*. By repeatedly applying the [[Math/Calculus/Derivative/Chain Rule|chain rule]]:
> $
> \begin{align*}
> \frac{d^n}{dt^n}M_X(t) &= \frac{d^n}{dt^n}\ev(e^{tX}) \\
> &= \frac{d^n}{dt^n}\sum_{j = 0}^{n}e^{tx_j}p_j \\
> &= \frac{d^{n - 1}}{dt^{n - 1}}\sum_{j = 0}^{n}x_je^{tx_j}p_j \\
> &= \frac{d^{n - 2}}{dt^{n - 2}}\sum_{j = 0}^{n}x_j^2e^{tx_j}p_j \\
> &= \cdots \\
> &= \sum_{j = 0}^{n}x_j^ne^{tx_j}p_j \\
> &= \sum_{j = 0}^{n}x_j^n p_j \quad (t = 0) \\
> &= \ev(X^n)
> \end{align*}
> $
> [!theorem]
>
> $
> M_X(t) = \sum_{n = 0}^{\infty}\frac{t^n}{n!}\ev(X^n)
> $
> *Proof*. Using the [[Taylor Series|Taylor series]] of the [[Exponential Function|exponential function]],
> $
> \begin{align*}
> e^{x} &= \sum_{n = 0}^{\infty}\frac{x^n}{n!} \\
> \ev(e^{tX}) &= \sum_{n = 0}^{\infty}\frac{t^n}{n!}\ev(X^n)
> \end{align*}
> $