Let $X_1,...,X_n$ be an iid (independent and identically distributed) sample with mean $ \mu $ and variance $\sigma^2$.
How to show $$ (n-1)S^2 = \sum_{i=1}^n (Xi-\overline X)^2 = \sum_{i=1}^n (Xi-\mu ) ^2 - n(\mu-\overline X) ^2 $$
I found that if I treat $\mu$ equals $\overline X$ , it would do. But I don't think that's right.
Let $Y_i:=X_i-\mu$. We have $\overline Y=\overline X-\mu$.
Then
$$\sum_i(Y_i-\overline Y)^2=\sum_iY_i^2-2\overline Y\sum_i Y+n\overline Y^2=\sum_iY_i^2-n\overline Y^2.$$