# Why is $\sum{(x_i-\overline{x})^2}$ = $\sum{(x_i-\overline{x})x_i}$ true? [duplicate]

I have seen this equality many times in books but I never found an explanatory derivation.

• It has appeared a very great many times on this site. The main difficulty is that it's almost impossible to search for the answers! – whuber Jan 5 '20 at 21:48
• It is quite difficult to search equations in a text-match-based searcher – E. Williams Jan 5 '20 at 22:07
• Agreed! The duplicates I found are only the tip of the iceberg; I searched stats.stackexchange.com/search?q=regression+orthogonal+residual. Most of the demonstrations are absolutely identical to the answer you received (right down to the variable names), but the threads mention none of these terms. – whuber Jan 5 '20 at 22:20

$$\sum{(x_i-\overline{x})^2} = \sum{(x_i-\overline{x})x_i} - \sum{(x_i-\overline{x})\overline{x}} = \sum{(x_i-\overline{x})x_i} - \overline{x}\sum{x_i} + n\overline{x}^2 = \sum{(x_i-\overline{x})x_i} - \overline{x}n\overline{x} + n\overline{x}^2 = \sum{(x_i-\overline{x})x_i}$$
$$\sum{x_i} = n\overline{x}$$