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