# Spivak Calculus chapter 2 question 21 on Schwarz Inequality

So I got stuck trying to prove the Schwarz inequality by expressing the product of magnitudes as a sum of two squares, and was reading the solution from the answer book; however I could not understand the last part on "the difference", i.e. $$\sum_{i≠j}({x_i}^2{y_j}^2 - x_iy_ix_jy_j) = 2 \sum_{i. Please help me understand how the terms doubled and why the next line suddenly had a square term.

There are two typos in this page: On the first line after "The difference...", the "2" should be in front of $$x_iy_ix_jy_j$$, the reason being that when you change the index from $$i\neq j$$ to $$i you have to double all the terms: say on the left hand side you have both $$x_1^2y_2^2$$ and $$x_2^2y_1^2$$, and since on the right hand side $$I you have to include the second one. The same applies to the products $$x_iy_ix_jy_j$$. Each of the terms is obviously a square. There is a typo on the following line: there is no "2" in front of the sum, as in the original (and correct) statement of the inequality.