Expectation of Square of Discrete Random Variable

Theorem
Let $X$ be a discrete random variable whose probability generating function is $\Pi_X \paren s$.

Then the square of the expectation of $X$ is given by the expression:
 * $\expect {X^2} = \Pi''_X \paren 1 + \Pi'_X \paren 1$

where $\Pi''_X \paren 1$ and $\Pi'_X \paren 1$ denote the second and first derivative respectively of the PGF $\Pi_X \paren s$ evaluated at $1$.

Proof
From Derivatives of Probability Generating Function at One:
 * $\Pi''_X \paren 1 = \expect {X \paren {X - 1} }$

and from Expectation of Discrete Random Variable from PGF:
 * $\Pi'_X \paren 1 = \expect X$

So: