# Please explain the formula for the sum of the cubes and the difference: $a^3 - b^3$ and $a^3 + b^3$?

I have not yet fully mastered the formula for accelerated multiplication. I was able to understand everything except the last two. I would like to deal with them. Why have : $$a^3 + b^3 = (a+b)(a^2 -ab + b^2)^*$$ and $$a^3 - b^3 = (a-b)(a^2 + ab + b^2)$$ Can someone paint me a formula in detail. Why is this the way it works.

• Try multiplying the right sides out? – Don Thousand Aug 30 '19 at 8:28
• right sides to left? – Boujozo Aug 30 '19 at 8:30

There is a very general factorisation formula, once taught in high school: $$a^n-b^n=(a-b)(a^{n-1}+a^{n-2}b+\dots+a^{n-k}b^k+\dots+ab^{n-2}+b^{n-1}).$$ (To memorise it, the second factor is the sum of all monomials in $$a$$ and $$b$$ of total degree $$n-1$$.)

The simplest proof consists in showing first by induction the particular case $$1-x^n=(1-x)\cdot(1+x+x^2+\dots+x^n),$$ then, for the general case, we may suppose that $$a\ne 0$$ and we set $$x=\frac ba$$, so that \begin{align} a^n-b^n&=a^n(1-x^n)=a^n(1-x)(1+x+x^2+\dots+x^{n-1})\\ &=(a-ax)(a^{n-1}+a^{n-1}x+a^{n-1}x^2+\dots+a^{n-1}x^{n-1}) \end{align} and observing that, for each $$k$$, $$\;a^{n-1}x^k=a^{n-1-k}b^k$$.

For the sum of powers, there is an analogous formula for $$n$$ odd, with an alternating sum: $$a^n+b^n=(a+b)(a^{n-1}-a^{n-2}b+\dots+(-1)^{k-1}a^{n-k}b^k+\dots-ab^{n-2}+b^{n-1}).$$

• Wait first, it turns out you prove with the help of mat induction a special case. How else did you get $x = \frac{b}{a}.$ The question can be regarded that $a ^ n - b ^ n$ is equal to $a ^ n - (ax) ^ n$? – Boujozo Aug 30 '19 at 11:03
• I didn't get $x=\frac ba$, I set it. The process is known as dehomogeneisation. For your second question, yes: $a^,-b^n=a^n-(ax)^=a^n(1-x^n)$. The ‘special case’, furthermore, is the simplest way to make beginners understand induction with an easy, but nontrivial example. – Bernard Aug 30 '19 at 11:10
• =_= That feeling when you try to understand induction using polynomials. – Boujozo Aug 30 '19 at 11:14
• What's the problem? It uses polynomial functions, not the abstract definition of polynomials. Everyone understands such formulæ. – Bernard Aug 30 '19 at 11:19

Multiply out the RHSs, and you get the LHSs. That's how to verify such stuff immediately.

To see how they may have been deduced, try working out the identities $$(a\pm b)^n=\sum_{k=0}^{k=n}\binom{n}{k}a^{n-k}b^k$$ for the first few values of $$n$$ and trying to separate out the first and last terms on one side of the equation, namely, the terms $$a^n$$ and $$\pm b^n.$$ Then you will notice a pattern and see how to prove the difference of powers formula in general. Not all sums of powers can be so factored using only real numbers, but sums of odd powers can too. (Also, one can factor sums of all even powers that are not powers of $$2$$ by performing an appropriate substitution. So, for example, we may factor $$a^6+b^6$$ by writing it as $$(a^2)^3+(b^2)^3,$$ and since we already know how to factor sums of odd powers, we can factor our sum, but none of the factors is linear in this case.)

So, for example, for the case $$n=3,$$ since we have $$(a\pm b)^3=a^3\pm b^3\pm 3ab(a\pm b),$$ it follows that $$(a\pm b)^3\mp 3ab(a\pm b)=a^3\pm b^3.$$ If you now factor the LHS and simplify one of the factors, you'd get what you want for this specific case. Something similar works for all odd $$n.$$ If $$n$$ is even, this way works only for those even $$n$$ that are not of the form $$2^m,$$ for any positive integer $$m.$$

Let $$x=a/b$$. We want to factor $$b^3(x^3\pm1)$$. Note that $$1$$ is a root of $$x^3-1$$, so $$x-1$$ is a factor of $$x^3-1$$. You could find the quotient by polynomial long division. Also, $$-1$$ is a root of $$x^3+1$$, so $$x+1$$ is a factor of $$x^3+1$$, and again you could find the quotient by polynomial long division.

(From this, it is easy to see why $$a^n+b^n$$ has that kind of factorization only for $$n$$ odd.)