I am going through a proof for the binomial theorem: $\begin{align*} (x+y)^n &= (x+y)(x+y)^{n-1}\\ &= (x+y)\sum_{k=0}^{n-1}\binom{n-1}{k}x^{n-1-k}y^k\\ &= x\sum_{k=0}^{n-1}\binom{n-1}{k}x^{n-1-k}y^k + y\sum_{k=0}^{n-1}\binom{n-1}{k}x^{n-1-k}y^k\\ &= \sum_{i=0}^{n-1}\binom{n-1}{k}x^{n-k}y^k + \sum_{k=0}^{n-1}\binom{n-1}{k}x^{n-1-k}y^{k+1} \end{align*}$ Let $i=k$ in the first equation and $i=k+1$ in the second equation. Then: $ (x+y)^n = \sum_{i=0}^{n-1}\binom{n-1}{i}x^{n-i}y^i + \sum_{i=1}^n\binom{n-1}{i-1}x^{n-i}y^i$
Why can $i$ be both $k$ and $k+1$ in the same formula? Seems like cheating... and a bit confusing later if I want to replace $i$ should I use $k$ or $k+1$?
$ = x^n + \sum_{i=1}^{n-1}\left(\binom{n-1}{i}+\binom{n-1}{i-1}\right)x^{n-i}y^i + y^n$ I am not sure where the $x^n$ and $y^n$ come from. Are they taken out of the left summation in order to make $i=0$ become $i=1$? $\begin{align*} \qquad &= x^n + y^n+\sum_{i=1}^{n-1}\binom{n}{i}x^{n-i}y^i\\ &= \sum_{i=0}^n \binom{n}{i}x^{n-i}y^i. \end{align*}$