The number of arithmetic operations necessary to compute can be reduced by using an alternative formula.

shortcut formula

In using this formula, $E\left( {X}^{2}\right)$ is computed first without any subtraction; then $E\left( X\right)$ is computed, squared, and subtracted (once) from $E\left( {X}^{2}\right)$ . [[EX 3.25 (EX 3.24 continued)]] `\begin{proof}` Expand ${\left( x - \mu \right) }^{2}$ in the definition of ${\sigma }^{2}$ to obtain ${x}^{2} - {2\mu x} + {\mu }^{2}$ , and then carry $\sum$ through to each of the three terms:

\begin{align} \sigma^2 &= \sum_{D} x^2 \cdot p(x) - 2\mu \cdot \sum_{D} x \cdot p(x) + \mu^2 \sum_{D} p(x) \ &= E(X^2) - 2\mu \cdot \mu + \mu^2 \ &= E(X^2) - \mu^2 \end{align}

`\end{proof}`