Variance of Geometric Distribution/Formulation 2/Proof 2

Proof
By Moment Generating Function of Geometric Distribution, the moment generating function of $X$ is given by:


 * $\map {M_X} t = \dfrac p {1 - \paren {1 - p} e^t}$

for $t < -\map \ln {1 - p}$, and is undefined otherwise.

From Variance as Expectation of Square minus Square of Expectation:


 * $\ds \var X = \expect {X^2} - \paren {\expect X}^2$

From Expectation of Geometric Distribution/Formulation 2, we have:


 * $\expect X = \dfrac {1 - p} p$

From Moment Generating Function of Geometric Distribution: Second Moment:


 * $\map { {M_X}''} t = \dfrac {p \paren {1 - p} e^t + p \paren {1 - p}^2 e^{2t} } {\paren {1 - \paren {1 - p} e^t}^3 }$

From Moment in terms of Moment Generating Function, we also have:


 * $\expect {X^2} = \map { {M_X}''} 0$

Setting $t = 0$, we obtain the second moment:

So: