Sigma Sum Properties My Probability and Statistics teacher wrote the following:
http://imgur.com/z0rgylh

How can I prove such step?
Thank you very much!
 A: $$\begin{align}
\sum_{i=1}^n (x_i - \bar{x})^2&=\sum_{i=1}^n (x_i^2 - 2 x_i \bar{x} +\bar{x}^2)\\
&=\sum_{i=1}^n (x_i^2) - \sum_{i=1}^n (2 x_i \bar{x}) + \sum_{i=1}^n(\bar{x}^2)\\
&=\sum_{i=1}^n x_i^2 - 2\bar{x} \sum_{i=1}^n x_i  + n\bar{x}^2\\
&=\sum_{i=1}^n x_i^2 - 2n\bar{x}^2  + n\bar{x}^2\\
&=\sum_{i=1}^n x_i^2 - n\bar{x}^2
\end{align}$$
A: $\sum_{i=1}^{n} (x_i-\overline x)^2=\sum_{i=1}^{n} (x_i-\overline x)\cdot (x_i-\overline x) $
=$\sum_{i=1}^{n} (x_i^2-2x_i\cdot \overline x+\overline x^2)$
$=\sum_{i=1}^{n}x_i^2- \sum_{i=1}^{n}2x_i\cdot \overline x+ \sum_{i=1}^{n}\overline x^2$
$2,\overline x$ and $\overline x^2$ are constants. Thus they can be put in front of the sigma signs.
$=\sum_{i=1}^{n}x_i^2- 2\cdot \overline x\sum_{i=1}^{n}x_i+ \overline x^2 \sum_{i=1}^{n} 1$


*

*$\sum_{i=1}^{n} 1=n$ and $\sum_{i=1}^{n}x_i=n\cdot \overline x$


$=\sum_{i=1}^{n}x_i^2- 2\cdot \overline x\cdot n\cdot \overline x+ n\cdot \overline x^2 $
$=\sum_{i=1}^{n}x_i^2- 2\cdot n\cdot  \overline x^2+n\cdot \overline x^2 $
$=\sum_{i=1}^{n}x_i^2-  n\cdot  \overline x^2$
