How to expand the sum of a squared bracket?
Solution 1:
We ave:
$$ \sum_{i=1}^n(y_i-\mu)^2=\sum_{i=1}^n(y_i^2-2\mu y_i+\mu^2)= $$ $$ =\sum_{i=1}^ny_i^2 -\sum_{i=1}^n2\mu y_i +\sum_{i=1}^n\mu^2= \sum_{i=1}^ny_i^2 -2\mu\sum_{i=1}^n y_i +n\mu^2 $$
We ave:
$$ \sum_{i=1}^n(y_i-\mu)^2=\sum_{i=1}^n(y_i^2-2\mu y_i+\mu^2)= $$ $$ =\sum_{i=1}^ny_i^2 -\sum_{i=1}^n2\mu y_i +\sum_{i=1}^n\mu^2= \sum_{i=1}^ny_i^2 -2\mu\sum_{i=1}^n y_i +n\mu^2 $$