Formula for expanding powers I can't seem to understand the following: 
$$A^n-B^n=\left(A-B\right)\cdot \left(A^{n-1}+A^{n-2}\cdot B+\cdots+A\cdot B^{n-2}+B^{n-1}\right)$$
How can i derive this formula ? Also, when does the $A^\text{something}$ end and when does $B^\text{something}$ start.
Thank you.
 A: Hint: Write it in sum notation and try to work out the brackets.
$$
\left(A-B\right)\cdot \left(A^{n-1}+A^{n-2}\cdot B+\cdots+A\cdot B^{n-2}+B^{n-1}\right) = (A-B)\sum_{i=0}^{n-1}A^{n-i-1}B^{i} = \cdots
$$
A: You can do the computations:

$$A\left(A^{n-1}+A^{n-2}\cdot B+\cdots+A\cdot B^{n-2}+B^{n-1}\right)$$ $$=A^n+A^{n-1}B+A^{n-2}B^2+....+A^2B^{n-2}+AB^{n-1}$$

.

$$B\left(A^{n-1}+A^{n-2}\cdot B+\cdots+A\cdot B^{n-2}+B^{n-1}\right)$$ $$=BA^{n-1}B^2A^{n-2}+A^{n-3}B^3+....+B^n$$

If substract: 
$$A\left(A^{n-1}+A^{n-2}\cdot B+\cdots+A\cdot B^{n-2}+B^{n-1}\right)-B\left(A^{n-1}+A^{n-2}\cdot B+\cdots+A\cdot B^{n-2}+B^{n-1}\right)=A^n-B^n$$
In other words,if you notice, everything will be canceled  out and the only thing remaining will be $A^n-B^n$
A: Note:
$$A^n-B^n=(A-B)(A^{n-1}+A^{n-2}B+\cdots+AB^{n-2}+B^{n-1}),$$
where:
$$S_n=A^{n-1}+A^{n-2}B+\cdots+AB^{n-2}+B^{n-1}$$
is the sum of the first $n$ terms of geometric progression with the first term $A^{n-1}$ and the common ratio $\frac{B}{A}$, hence:
$$(A-B)\cdot S_n=(A-B)\cdot \frac{A^{n-1}\left(1-\left(\frac{B}{A}\right)^n\right)}{1-\frac{B}{A}}=A^n-B^n.$$
A: 
when does the $A^\text{something}$ end and when does $B^\text{something}$ start

$$
A^6 - B^6 = (A-B)(A^5 + A^4B + A^3B^2 + A^2B^3+AB^4+B^5)
$$
When $n=6$ then the powers of $A$ are $5,4,3,2,1,0$ in that order, and the powers of $B$ are $0,1,2,3,4,5$ in that order.
