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.