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