Derivation of $\frac{\sum (x - \bar{x})^2}{N} = \frac{\sum x^2 - \frac{(\sum x)^2}{N}}{N}$ I saw the above equation in an introductory statistics textbook, as a shortcut for evaluating the variance of a population.
I tried to prove it myself:
 
 
$$\sigma^2 = \frac{\sum (x - \bar{x})^2}{N} \tag{1}$$
$$\sigma^2 = \frac{\sum x^2 - \frac{(\sum x)^2}{N}}{N} \tag{2}$$
We are given that $(1) = (2)$:
$$\frac{\sum (x - \bar{x})^2}{N} = \frac{\sum x^2 - \frac{(\sum x)^2}{N}}{N} \tag{3}$$
Multiply $(3)$ through by $N$:
$$\sum(x - \bar{x})^2 = \sum x^2 - \frac{(\sum x)^2}{N} \tag{4}$$
Expand the LHS in $(4)$:
$$\sum\left(x^2 - 2x\bar{x} + \bar{x}^2\right) = {\sum x^2 - \frac{(\sum x)^2}{N}} \tag{5}$$
Expanding both sides in $(5)$:
$$\sum x^2 - 2x\sum\bar{x} + \sum\bar{x}^2 = \sum x^2 - \frac{\sum x\sum x}{N} \tag{6}$$
From $(6)$:
$$\sum\bar{x}^2 - 2\bar{x}\sum{x} = -\bar{x}\sum{x} \tag{7}$$
From $(7)$:
$$\sum\bar{x}^2 = \bar{x}\sum{x} \tag{8}$$
I don't know how to make the LHS equal RHS in $(8)$.
 A: First of all, in order to prove $A = B$ in general, start with either A or B, and show that it equals the other. Working with both of them together, is not the "proper" way of proving something, since in each step you are already assuming that they are equal.
Regardless, note that $\sum \bar{x}^2$ = $N\bar{x}^2$. This is because $\bar{x}^2$ doesn't depend on the index. That is,
$$\sum \bar{x}^2 = \sum_{i=1}^{N} \bar{x}^2  = \bar{x}^2 \sum_{i}^{N} 1 = N\bar{x}^2\,.$$
So now in (8)
\begin{align*}
\sum \bar{x}^2 & = N\bar{x}^2\\
& = N \bar{x} \bar{x}\\
& = N\bar{x} \sum \dfrac{x}{N}\\
& = \bar{x} \sum x\,.
\end{align*}
Thus the LHS and RHS of (8) are equal.
A: Starting from what you know:
$\sigma^2 =\dfrac{\sum (x - \bar{x})^2}{N} $
$= \dfrac{ \sum\left(x^2 - 2x\bar{x} +\bar{x}^2 \right)}{N}$
$= \dfrac{\sum x^2}N  - \dfrac{2\sum x\bar{x}}N  +\dfrac{\sum\bar{x}^2}N  $
$=\dfrac{\sum x^2}N - 2\bar{x}\dfrac{\sum x}{N} + \bar{x}^2 $
$=\dfrac{\sum x^2}N - {2\bar{x}^2} + \bar{x}^2 $
$= \dfrac{\sum x^2}N - {\bar{x}^2} $
$= \dfrac{\sum x^2}N - \dfrac {\sum{\bar{x}^2}}N $
$= \dfrac{\sum (x^2 - \bar{x}^2) }N $
