a³-b³+c³+3abc
=(a³-3a²b+3ab²-b³)+c³+3a²b-3ab²+3abc
=(a-b)³+c³+3ab(a-b+c)
=(a-b+c)[(a-b)²-(a-b)c+c²]+3ab(a-b+c)
=(a-b+c)[(a-b)²-(a-b)c+c²+3ab]
=(a-b+c)[(a²-2ab+b²)-(a-b)c+c²+3ab]
=(a-b+c)(a²+b²+c²+ab+bc-ac)
a^3-b^3+c^3+3abc
=(a^3-3a^2b+3ab^2-b^3+c^3)+(3abc+3a^2b-3ab^2)
=[(a-b)^3+c^3]+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-2ab+3ab-ac+bc)
=(a+b+c)(a^2+b^2+c^2+ab+bc-ac)