There has reportedly been some discussion among scholars whether the Egyptians knew the formula [tex]a^3-b^3=(a-b)(a^2+ab+b^2)[/tex].
In fact, the Babylonians knew formulas like [tex]xy=\frac{(x+y)^2-(x-y)^2}{2}[/tex]. So it wouldn't seem unlikely that already the Babylonians and the Egyptians knew about [tex](a+b)(a-b)=a^2-b^2[/tex]. But, to my knowledge, there is no proof that they did.
But the Greeks almost certainly knew the formula. It seems like one of the things that Pythagoras liked to prove geometrically...