How did people come up with the formula $a^3+b^3=(a+b)(a^2-ab+b^2)$? Every resource that I've read proves the formula
$$ a^3 + b^3 = (a+b)(a^2-ab+b^2) \tag1$$
by just multiplying $(a+b)$ and $(a^2 - ab + b^2)$.
But how did people come up with that formula? Did they think like, "Oh, let's just multiply these polynomials, I don't know why, let's just do it." I don't think that people just pointed a finger at the sky and came up with that formula.
So, how to prove $(1)$?
 A: $«$Who first factored the expression $a^3+b^3$ and what was the method used?$»$ - I don't know the exact answer to this question, but the similar question I'm trying to answer is:
$«$How can we factor $a^3+b^3$ using the most basic algebraic techniques?$»$
It seems to me that, this formula basically comes from the Binomial theorem:
$$(a+b)^3=a^3+3a^2b+3ab^2+b^3$$
But, without the binomial theorem you can obtain this result as follows:
$$\begin{aligned}(a+b)^3&=(a+b) \left((a+b)\times (a+b)\right)\\
&=(a+b)(a^2+2ab+b^2)\\
&=a^3+3a^2b+3ab^2+b^3\end{aligned}$$
Then observe that,
$$\begin{aligned}a^3+3a^2b+3ab^2+b^3&=(a^3+b^3)-3ab(a+b)\end{aligned}$$
This leads,
$$
\begin{aligned}a^3+b^3&=(a+b)^3-3ab(a+b)\\
&=(a+b)\left((a+b)^2-3ab\right)\\
&=(a+b)(a^2-ab+b^2).\end{aligned}
$$
A: As noticed by $a=-b$ we obtain $a^3+b^3=0$ therefore we can guess by homogeneity
$$a^3+b^3=(a+b)(Xa^2+Yab+Zb^2)$$
with $X$, $Y$ and $Z$ unknown, to obtain
$$(a+b)(Xa^2+Yab+Zb^2)=Xa^3+Ya^2b+Zab^2+Xa^2b+Yab^2+Zb^3=$$
$$=Xa^3+(Y+X)a^2b+(Z+Y)ab^2+Zb^3$$
which requires

*

*$X=1$

*$Z=1$

*$Y+X=0 \implies Y=-1$

*$Z+Y=0 \implies Y=-1$
A: Alternative approach:
Stealing the insight from the comment of Ethan Bolker.
Mathematicians discovered that
$$(1 + x + x^2 + \cdots + x^n) \times (1 - x) = 1 - x^{n+1}. \tag1 $$
For $0 \neq a,b$, 
$a^3 + b^3$ can be rewritten as
$$a^3 \times \left[1 - \left(\frac{-b}{a}\right)^3\right]. \tag2 $$
Setting $~\displaystyle x = \left(\frac{-b}{a}\right)~$ (1) and (2) collectively imply that
$$a^3 + b^3 = a^3 \times \left[1 - \frac{-b}{a}\right] \times \left[ ~1 + \frac{-b}{a} + \left(\frac{-b}{a}\right)^2 ~\right]$$
$$ = a^3 \times \left[\frac{a + b}{a}\right] \times \left[\frac{a^2 - ab + b^2}{a^2}\right] = (a+b) \times (a^2 - ab + b^2).$$
A: In this answer I wanted to suggest a method where I get results by applying substitutions (based on the idea that it is the most basic algebraic technique).
Let, $a=m+n$ and $b=m-n$ then:
$$
\begin{aligned}a^3+b^3=m^3+3m^2n+3mn^2+n^3+m^3-3m^2n+3mn^2-n^3=2m^3+6mn^2=2m(m^2+3n^2)\end{aligned}
$$
and note that,
$$
\begin{cases} m+n=a\\m-n=b\end{cases}\implies \begin{cases}m=\frac {a+b}{2}\\n=\frac {a-b}{2}\end{cases}
$$
Putting $m=\frac {a+b}{2}$ and $n=\frac {a-b}{2}$, we have:
$$
\begin{aligned}a^3+b^3&=2m(m^2+3n^2)\\
&=2\times \frac {a+b}{2}\left(\frac {(a+b)^2}{4}+3\times \frac {(a-b)^2}{4}\right)\\
&=(a+b)\left(\frac {(a+b)^2+3(a-b)^2}{4}\right)\end{aligned}
$$
Now, let's open the parentheses and do some basic simplifications:
$$
\begin{aligned}
(a+b)^2+3(a-b)^2&=a^2+2ab+b^2+3(a^2-2ab+b^2)\\
&=a^2+2ab+b^2+3a^2-6ab+3b^2\\
&=4a^2-4ab+4b^2\\
&=4(a^2-ab+b^2)\end{aligned}
$$
Thus, we get the following result:
$$
\begin{aligned}a^3+b^3&=(a+b)\times \frac {4(a^2-ab+b^2)}{4}\\
&=(a+b)(a^2-ab+b^2).\end{aligned}
$$
