How do I prove that #sum_(i=1)^n(x_i-mu)^2=sum_(i=1)^n(x_i)^2-nmu^2#?

1 Answer
Aug 7, 2018

Start with:

#sum_(i=1)^n (x_i-mu)^2#

Within the sum, distribute the square:

#=sum_(i=1)^n (x_i-mu)(x_i-mu)#

#=sum_(i=1)^n (x_i^2-2x_i mu + mu^2)#

Distribute the sum notation to each term:

#=sum_(i=1)^n x_i^2- sum_(i=1)^n 2x_i mu + sum_(i=1)^n mu^2#

Factor out the #2mu# from the middle sum (since #2mu# doesn't depend on #i#) and notice that the last term is just #underset (n" times") underbrace(mu^2 + mu^2 + ... + mu^2):#

#=sum_(i=1)^n x_i^2- 2musum_(i=1)^n x_i + nmu^2#

Using #mu = 1/n sum_(i=1)^n x_i,# rearrange to get #sum_(i=1)^n x_i = nmu,# then sub this in:

#=sum_(i=1)^n x_i^2- 2mu(nmu) + nmu^2#

#=sum_(i=1)^n x_i^2- 2nmu^2 + nmu^2#

Combine like terms:

#=sum_(i=1)^n x_i^2- nmu^2#

Done!