1. Factoring question

Hi, I am factoring somewhat complex polynomials. For example this one:
$
a^3+b^3+c^3-3abc =
$

$
= a^3+b^3+c^3-3abc-3a^2b+3^2b-3ab^2+3ab^2
= (a+b+b)(a^2+b^2+c^2-ab-ac-bc )
$

I only know to solve this kind of problems by guessing ( try to expand polynomial ). Is there a way to solve it by applying some algorithm?
Also link to some material that explains this topic would be great.

2. Hi dontoo, welcome to MHF.
$a^3 + b^3 + c^3 -3abc = (a+b)^3 + c^3 -3abc-3ab^2 - 3a^2b$
$= [(a+b+c)[(a+b)^2 + c^2 -(a+b)c] - 3ab(a+b+c)$
$= (a+b+c)[a^2 + b^2 +2ab -ac - bc -3ab]$
$= (a+b+c)(a^2+b^2+c^2-ab-bc-ac)$

3. Thx for your replay. Is there is the way to solve it using polynomial zeros ( roots )?I don't want to guess how to expand polynomial.