Could somebody explain how they derive the term in the red highlight.
What I get:
$$n\sum^n_{j=1}(x_j)^2-n^2\overline{x}^2=n\left(\sum x_j^2-n\overline{x}^2\right)$$ $$=n\left(\sum x^2_j-\frac{n}{n^2}\left(\sum x_j\right)^2\right)=n\left(\sum x_j^2-\frac{1}{n}\left(\sum x^2_j\right)\right)=n\left(\sum x^2_j-\overline{x}\sum x_j\right)$$
But this is nowhere near to what they get. How is this derived? If somebody could show me that would be great
