[proofplan]
We differentiate the power series $G_X(z) = \sum_{k=0}^{\infty} \mathbb{P}(X = k) z^k$ term by term, then take the left-hand limit $z \to 1^-$. The first derivative yields $\mathbb{E}[X]$, the second yields $\mathbb{E}[X(X-1)]$, and the general $r$-th derivative yields the $r$-th factorial moment. The variance formula follows by expanding $\operatorname{Var}(X) = \mathbb{E}[X^2] - (\mathbb{E}[X])^2$ and rewriting $\mathbb{E}[X^2]$ in terms of factorial moments.
[/proofplan]
[step:Differentiate $G_X$ term by term and take $z \to 1^-$]
Since $G_X(z) = \sum_{k=0}^{\infty} \mathbb{P}(X = k) z^k$ is a [power series](/page/Power%20Series) with radius of convergence at least $1$, term-by-term differentiation is valid on $(-1, 1)$. The first derivative is
\begin{align*}
G_X'(z) = \sum_{k=1}^{\infty} k\, \mathbb{P}(X = k)\, z^{k-1}.
\end{align*}
Each term $k\, \mathbb{P}(X = k)\, z^{k-1}$ is non-negative for $z \in [0,1)$, so by the [monotone convergence theorem](/theorems/509) for series (applied to the partial sums as $z \nearrow 1$),
\begin{align*}
G_X'(1^-) = \lim_{z \to 1^-} \sum_{k=1}^{\infty} k\, \mathbb{P}(X = k)\, z^{k-1} = \sum_{k=1}^{\infty} k\, \mathbb{P}(X = k) = \mathbb{E}[X].
\end{align*}
This value may be $+\infty$ if $\mathbb{E}[X]$ is infinite.
[/step]
[step:Compute $G_X''(1^-)$ to obtain $\mathbb{E}[X(X-1)]$]
Differentiating once more,
\begin{align*}
G_X''(z) = \sum_{k=2}^{\infty} k(k-1)\, \mathbb{P}(X = k)\, z^{k-2}.
\end{align*}
Again each term is non-negative for $z \in [0,1)$, so the same monotone convergence argument gives
\begin{align*}
G_X''(1^-) = \sum_{k=2}^{\infty} k(k-1)\, \mathbb{P}(X = k) = \mathbb{E}[X(X-1)].
\end{align*}
[/step]
[step:Establish the general factorial moment formula by induction]
For the $r$-th derivative, repeated term-by-term differentiation gives
\begin{align*}
G_X^{(r)}(z) = \sum_{k=r}^{\infty} k(k-1)\cdots(k-r+1)\, \mathbb{P}(X = k)\, z^{k-r}.
\end{align*}
Taking $z \to 1^-$ with non-negative terms,
\begin{align*}
G_X^{(r)}(1^-) = \sum_{k=r}^{\infty} k(k-1)\cdots(k-r+1)\, \mathbb{P}(X = k) = \mathbb{E}[X(X-1)\cdots(X-r+1)],
\end{align*}
which is the $r$-th factorial moment of $X$.
[/step]
[step:Derive the variance formula from the first two factorial moments]
The second factorial moment is $\mathbb{E}[X(X-1)] = \mathbb{E}[X^2] - \mathbb{E}[X]$, so
\begin{align*}
\mathbb{E}[X^2] = \mathbb{E}[X(X-1)] + \mathbb{E}[X] = G_X''(1^-) + G_X'(1^-).
\end{align*}
The variance is
\begin{align*}
\operatorname{Var}(X) &= \mathbb{E}[X^2] - (\mathbb{E}[X])^2 \\
&= G_X''(1^-) + G_X'(1^-) - \bigl(G_X'(1^-)\bigr)^2.
\end{align*}
[/step]