Variance of Negative Binomial Distribution/Second Form

Theorem
Let $X$ be a discrete random variable with the negative binomial distribution (second form) with parameters $n$ and $p$.

Then the variance of $X$ is given by:
 * $\displaystyle \operatorname{var} \left({X}\right) = \frac {n q} {p^2}$

Proof
From Variance of Discrete Random Variable from PGF, we have:
 * $\operatorname{var} \left({X}\right) = \Pi''_X \left({1}\right) + \mu - \mu^2$

where $\mu = E \left({x}\right)$ is the expectation of $X$.

From the Probability Generating Function of Negative Binomial Distribution (Second Form), we have:
 * $\Pi_X \left({s}\right) = \dfrac {ps} {1 - qs}$

where $q = 1 - p$.

From Expectation of Negative Binomial Distribution/Second Form, we have:
 * $\mu = \dfrac n p$

From Second Derivative of PGF of Negative Binomial Distribution/Second Form, we have:
 * $\dfrac {\mathrm d^2} {\mathrm d s^2} \Pi_X \left({s}\right) = \left({\dfrac {ps} {1 - qs} }\right)^{n+2} \left({\dfrac {n \left({n-1}\right) + 2 n q s} {\left({p s^2}\right)^2} }\right)$

Putting $s = 1$ and using the formula $\Pi''_X \left({1}\right) + \mu - \mu^2$: