Sum of a Sum of a Squared Difference 
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.

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$.
