# How to factor $a^n - b^n$?

Wikipedia provides a proof, but I don't understand how:

$$a^n - b^n = (a-b)(a^{n-1} + ba^{n-2} +\cdots + b^{n-1})$$

follows from

$$x^{n-1} + x^{n-2} +\cdots + x + 1 = \frac{x^n - 1}{x-1}$$

Could someone explain to me how the summation of the the geometric series explains the factorization?

-
Plug $x=a/b$ into the geometric sum formula, then clear denominators (multiply the left by $b^{n-1}$, the right's numerator by $b^n$, and the right's denominator by $b$, then multiply both sides by $a-b$). – anon Feb 21 '13 at 1:17
@anon Thanks anon! Just wondering, but how did you figure that out? It seems like a very complex connection to make- could you please share your train of thought? – asdf Feb 21 '13 at 1:19
But we don't need to obtain the factorization from the $x$ stuff. Just find (or imagine finding) the product $(a-b)(a^{n-1}+a^{n-2}b+\cdots +b^{n-1})$ and observe that almost all the terms in the product cancel. – André Nicolas Feb 21 '13 at 1:20
@AndréNicolas But how could someone just "find" it? How would someone discover such a connection? Is it just the result of randomly trying out different things? Or does it follow from a specific train of thought? – asdf Feb 21 '13 at 1:23
Presumably it came from $a^2-b^2=(a-b)(a+b)$, and $a^3-b^3=(a-b)(a^2+ab+b^2)$, and then looking for something similar for higher powers. – André Nicolas Feb 21 '13 at 1:26

The long parenthesized term is a geometric series with first term $a^{n-1}$ and ratio $\frac ba$ so set $x=\frac ba$

-
The two formulae agree better, if you divide the first equation by $b^n$ and then set $x=a/b$ (instead of $x=b/a$). Then simply divide by the first rhs-parenthese... – Gottfried Helms Feb 21 '13 at 1:13
Thanks Ross! One more thing: this might be a strange question, but how could anyone possibly see the intuition between the substitution? I mean how could possibly see the connection between the sum of a geometric series, a fraction substitution and the factorization? It seems like someone connected distinct parts of math and suddenly came upon the factorization! – asdf Feb 21 '13 at 1:18
@asdf: I find it easier to find the factorization by considering what happens with each term. A typical term $a^ib^{n-i-1}$ gets multiplied by $(a-b)$ and makes $a^{i+1}b^{n-i-1}-a^ib^{n-i}$ The first cancels with the second term of the previous one and the second cancels with the first term of the next. All that survives is $a^n$ from the first term (because there is no term before) and $-b^n$ from the last one (because there is no term after). – Ross Millikan Feb 21 '13 at 1:23

Just multiply out the right hand side, you'll see that all terms except for the left hand side cancel.

-
This seems to me to be the best explanation of that factorization. I would have said that calling in the formula for a finite geometric series was overkill. – Lubin Nov 27 '15 at 16:52

I see the answer is accepted. But for future reference, a far simpler proof would be

Let $p(x)=x^n-a^n$. Clearly, $x=a$ is a solution. This means $x-a$ is a factor of $x^n-a^n.$

It is just a matter of simple polynomial division aafter that and so dividing $x^n-a^n$ by $x-a$ gives us $$x^{n-1} + ax^{n-2} +\cdots + a^{n-1}$$

So, $$x^n-a^n=(x-a)(x^{n-1} + ax^{n-2} +\cdots + a^{n-1})$$. Replace x and a with a and b.

-
That proves $a-b$ is one factor, but gives no clue to the other one. – vonbrand Dec 26 '15 at 2:05
Its just simple polynomial division after that. I thought people would figure that out on their own but I will editit now. Thanks. – Skawang Dec 26 '15 at 15:38
I am sorry but I don't know how exactly to write polynomial long division in latex. I would appreciate it if someone did it for me. – Skawang Dec 26 '15 at 15:45