I don't understand how the following is equivalent.

$\displaystyle n\Sigma(X_{i}-\overline{X})^2 = n\Sigma X_{i}^2 - (\Sigma X_{i})^2$

$\displaystyle \overline{X}$ is the average of all $\displaystyle X_{i}$ So, $\displaystyle \overline{X} = \Sigma X_{i}/n$

Could someone walk me through this. I've been staring at it for a long while now. I'll try to show my confusion below:

So, expanding the left side I get

$\displaystyle n\Sigma(X_{i}^2 - 2X_{i}\overline{X} + \overline{X}^2)$

Then substituting for $\displaystyle \overline{X}$, I get

$\displaystyle n\Sigma(X_{i}^2 - 2X_{i}\Sigma X_{i}/n + (\Sigma X_{i}/n)^2$

Then multiplying it out, I get

$\displaystyle n\Sigma X_{i}^2 -\Sigma(2X_{i}\Sigma X_{i}) + \Sigma((\Sigma X_{i})^2/n)$

And I'll stop there, because I really don't know what taking the summation of a summation means???

But, I do think I'm not too far off track because I now see the first term from the right hand side of the initial equality.