Example 3. Find the variance of a random variable $X$ that has a geometric distribution.
Solution. To calculate the variance, we will use formula $(2.5 .4)$ and the formulas for the sums of series:

$$
\sum_{m=1}^{\infty} m q^{m-1}=\frac{1}{(1-q)^{2}}, \sum_{m=2}^{\infty} m(m-1) q_{-}^{m-2}=\frac{2}{(1-q)^{3}}
$$

First, we find the expected value of the square of the quantity $X$:

$$
\begin{aligned}
& M\left(X^{2}\right)=\sum_{m=1}^{\infty} m^{2} q^{m-1} p=p\left(\sum_{m=1}^{\infty} m(m-1) q^{m-1}+\sum_{m=1}^{\infty} m q^{m-1}\right)= \\
& =p\left(q \frac{2}{(1-q)^{3}}+\frac{1}{(1-q)^{2}}\right)=p \frac{2 q+1-q}{(1-q)^{3}}=p \frac{1+q}{p^{3}}=\frac{1+q}{p^{2}}
\end{aligned}
$$

Thus,

$$
\begin{gathered}
D(X)=M\left(X^{2}\right)-(M(X))^{2}=\frac{1+q}{p^{2}}-\frac{1}{p^{2}}=\frac{q}{p^{2}}=\frac{1-p}{p^{2}} \\
D(X)=\frac{1-p}{p^{2}}
\end{gathered}
$$