Sum of a Sum of a Squared Difference

118 Views Asked by At

Im Lost How did the author jump from the second equation to the third equation? I suspect there’s a rule I’m forgetting that allows for this, any help is appreciated.

2

There are 2 best solutions below

2
On BEST ANSWER

Note that

\begin{align} -\left(\sum_{i=1}^{160} (x_i - 8)^2 - \sum_{i=1}^{160} (x_i - 7)^2\right) & = -\left(\sum_{i=1}^{160} (x_i^2 - 16x_i + 64) - (x_i^2 - 14x_i + 49)\right) \\ & = -\left(\sum_{i=1}^{160} (-2x_i + 15)\right) \\ & = 2\sum_{i=1}^{160} x_i - 2400 \tag{1}\label{eq1} \end{align}

As you can see, the $15$ is a constant repeating $160$ times for a total of $15 \times 160 = 2400$. Also, the author used the minus sign in front to remove the first minus sign for the $2x_i$, moved the $2$ outside the summation and changed the plus to a minus for the sum of $2400$.

2
On

A simpler way, using $a^2-b^2 = (a-b)(a+b) $, is

$\begin{array}\\ \sum_{i=1}^{160} (x_i - 8)^2 - \sum_{i=1}^{160} (x_i - 7)^2) &=\sum_{i=1}^{160} ((x_i - 8)^2 -(x_i - 7)^2)\\ &=\sum_{i=1}^{160} ((x_i - 8) -(x_i - 7))((x_i - 8) +(x_i - 7))\\ &=\sum_{i=1}^{160} (-1)(2x_i -15)\\ &=160\cdot 15-2\sum_{i=1}^{160} x_i\\ \end{array} $