Confused about answer to Spivak's calculus in prologue I have attached the question and answer to this question from Spivak's Calculus.
The proposition we are supposed to prove:

$$
x^n - y^n = (x - y)\, 
(x^{n-1} + x^{n-2}y + \dots + xy^{n-2} + y^{n-1})
$$

The proof of this proposition:

\begin{align}
(x - y) \, 
(x^{n-1} + x^{n-2}y &+ \dots + xy^{n-2} + y^{n-1}) \\[2pt] 
&= x \, (x^{n-1} + x^{n-2}y + \dots + xy^{n-2} + y^{n-1}) \\ 
&\qquad{} - y \, (x^{n-1} + x^{n-2}y + \dots + xy^{n-2} + y^{n-1}) \\[2pt]
&= \bigl[ x^n + x^{n-1}y + \dots + x^2y^{n-2} + xy^{n-1} \bigr] \\ 
&\qquad{} - \bigl[ x^{n-1}y + x^{n-2}y^2 + \dots + xy^{n-1} + y^n  \bigr] \\[2pt]
&= x^n - y^n
\end{align}

I do not understand how $x^2\,y^{n-2}$ in the third to last line cancels with $x^{n-2}\,y^2$ in the second to last line (after the negative sign is distributed to $x^{n-2}\,y^2$).
Also, I do not understand how what is within the ellipses is treated. do we conceive of what is in the ellipses as multiplied by $x$ and $-y$ when $x$ and $-y$ are distributed to the expression with which $(x-y)$ is multiplied originally? If so, how can the ellipses cancel with each other as they are multiplied by different variables which we don't know are equal?
thanks, let me know if my question lacks clarity and I will explain my questions better/further.
 A: You can avoid the $\cdots$ which is confusing you.
You have to use alternatives.
We want to Prove :
$ x^{n}-y^{n} = (x-y)(x^{n-1}y^{0}+x^{n-2}y^{1}+x^{n-3}y^{2}+\cdots+x^{2}y^{n-3}+x^{1}y^{n-2}+x^{0}y^{n-1}) $
Write it alternately like this :
$$Z = (x-y)(x^{n-1}y^{0}+x^{n-2}y^{1}+x^{n-3}y^{2}+\cdots+x^{2}y^{n-3}+x^{1}y^{n-2}+x^{0}y^{n-1})$$
$$Z = (x-y)[\Sigma_{m=0}^{m=n-1} x^{n-1-m}y^{m}]$$
(You can verify that this $ \Sigma $ matches Exactly what we want)
$$Z = (x[\Sigma_{m=0}^{m=n-1} x^{n-1-m}y^{m}]-y[\Sigma_{m=0}^{m=n-1} x^{n-1-m}y^{m}])$$
$$Z = ([\Sigma_{m=0}^{m=n-1} x^{n-1-m+1}y^{m}]-[\Sigma_{m=0}^{m=n-1} x^{n-1-m}y^{m+1}])$$
$$Z = (x^{n}y^{0}+[\Sigma_{m=1}^{m=n-1} x^{n-1-m+1}y^{m}]-[\Sigma_{m=0}^{m=n-2} x^{n-1-m}y^{m+1}]-x^{0}y^{n})$$
( here I have taken out the first & the last terms from the two $ \Sigma $ terms )
$$Z = (x^{n}y^{0}-x^{0}y^{n})+[\Sigma_{m=1}^{m=n-1} x^{n-1-m+1}y^{m}]-[\Sigma_{m=0}^{m=n-2} x^{n-1-m}y^{m+1}]$$
We can see that that 2 $ \Sigma $ terms will cancel ; To make it Explicit , we can change the variables to $ i = m-1 $ ( or $ m = i+1 $ )  in the first $ \Sigma $ term & to $ i = m $ ( or $ m = i $ ) in the second $ \Sigma $ term.
$$0 = [\Sigma_{i=1}^{i=n-2} x^{n-1-i-1+1}y^{i+1}]-[\Sigma_{i=0}^{i=n-2} x^{n-1-i}y^{i+1}]$$
$$0 = [\Sigma_{i=1}^{i=n-2} x^{n-1-i}y^{i+1}]-[\Sigma_{i=0}^{i=n-2} x^{n-1-i}y^{i+1}]$$
$$0 = [\Sigma_{i=1}^{i=n-2} ( x^{n-1-i}y^{i+1} - x^{n-1-i}y^{i+1} )]$$
$$0 = [\Sigma_{i=1}^{i=n-2} ( 0 )]$$
Hence :
$$Z = (x^{n}y^{0}-x^{0}y^{n})+[0]$$
$$(x^{n}-y^{n}) = (x-y)(x^{n-1}y^{0}+x^{n-2}y^{1}+x^{n-3}y^{2}+\cdots+x^{2}y^{n-3}+x^{1}y^{n-2}+x^{0}y^{n-1})$$
A: First, I will start with your last question. I presume you are asking here whether the $(x-y)$ will distribute to the $(x^{n-1}+x^{n-2}y+...+xy^{n-2}+y^{n-1})$. Consider
$$(x^{n-1}+x^{n-2}y+...+xy^{n-2}+y^{n-1}) = k$$
You have $(x-y)k$ which we know is just $xk - yk$. Putting back the value of $k$, we get the same expression on the second line of the proof. Please let me know if I did not understand your last question. We have:
$$x\color{green}{(x^{n-1}+x^{n-2}y+...+xy^{n-2}+y^{n-1})}- y\color{blue}{(x^{n-1}+x^{n-2}y+...+xy^{n-2}+y^{n-1})}$$ The $x$ will get multiplied to every term in the green brackets, while the $y$ will be multiplied to every term in the blue brackets. I will use these results, and I'm assuming you're aware of them:
$$p^\color{red}{m} \times p = p^\color{red}{m+1}$$
$$pq^\color{red}m \times q = pq^\color{red}{m+1}$$
$$p^\color{red}lq^m \times p = p^\color{red}{l+1}q^m$$
Getting back to our question, the $x$ will get multiplied to every term in green. From the above results, the power of $x$ will increase by $1$, while that of $y$ will remain unchanged. So, you'll have something of the form
$$x^n + \color{red}{x^{n-1}y+...+x^2y^{n-2}+xy^{n-1}}$$
On the other hand, for the terms in blue, the power of $y$ will increase and that of $x$ will remain the same. We will get:
$$\color{red}{x^{n-1}y+x^{n-2}y^2 + ... + xy^{n-1}} + y^n$$Subtracting the two, you will notice that all the terms from $\color{red}{x^{n-1}y ... xy^{n-1}}$ cancel out, while only $$x^n - y^n$$ remains. Let's check this for $n = 6$. Also, $p^0 = 1$ and $p^1 = p$. We have (notice the highlighted terms):
$$(x-y)(x^5 + x^4y + x^3y^2+x^2y^3+xy^4+y^5)$$
$$x(x^5 + x^4y + x^3y^2+x^2y^3+xy^4+y^5) - y(x^5 + x^4y + x^3y^2+x^2y^3+xy^4+y^5)$$
$$x(x^\color{red}5 + x^\color{red}4y + x^\color{red}3y^2+x^\color{red}2y^3+x^\color{red}1y^4+x^\color{red}0y^5) - y(x^5y^\color{orange}0 + x^4y^\color{orange}1 + x^3y^\color{orange}2+x^2y^\color{orange}3+xy^\color{orange}4+y^\color{orange}5)$$
$$x^\color{red}6 + x^\color{red}5y + x^\color{red}4y^2+x^\color{red}3y^3+x^\color{red}2y^4+x^\color{red}1y^5 - (x^5y^\color{orange}1+x^4y^\color{orange}2+x^3y^\color{orange}3+x^2y^\color{orange}4+xy^\color{orange}5+y^\color{orange}6)$$
$$\color{green}{x^6} + \color{red}{x^5y} + \color{orange}{x^4y^2}+\color{violet}{x^3y^3}+\color{blue}{x^2y^4}+\color{purple}{xy^5} - (\color{red}{x^5y}+\color{orange}{x^4y^2}+\color{violet}{x^3y^3}+\color{blue}{x^2y^4}+\color{purple}{xy^5}+\color{green}{y^6})$$
$$\color{green}{x^6 - y^6}$$Notice that $x^2y^4$ term cancels with $x^2y^4$ term (both in blue) and not with $x^4y^2$ term (in orange). This means that the $\color{blue}{x^2y^{n-2}}$ terms cancels with itself and not $\color{orange}{x^{n-2}y^2}$ term.The problem with your approach was that you did not write out the expressions completely, which often leads one to wrong conclusions.
