(a + b + c)(ab + bc + ac) - abc
= a2b + abc +a2c + ab2 + b2c + abc + abc + bc2 + ac2
= (a2b + 2abc + bc2) + (ac2 + a2c) + (ab2 + b2c)
= b(a2 + 2ac + c2) + ac(c + a) + b2(a + c)
= b(a + c) + ac(a + c) + b2(a + c)
= (a + c)[b(a + c) + ac + b2]
= (a + c)(ab + bc + ac + b2)
= (a + c)[b(a + b) + c(a + b)]
= (a + c)(b + c)(a + b)
\(\left(a+b+c\right)\left(ab+bc+ac\right)-abc\)
\(=a^2b+abc+a^2c+b^2a+b^2c+abc+abc+c^2b+c^2a-abc\)
\(=ab\left(a+b\right)+c^2\left(a+b\right)+c\left(a^2+b^2+2ab-2ab\right)+2abc\)
\(=ab\left(a+b\right)+c^2\left(a+b\right)+c\left(a+b\right)^2-2abc+2abc\)
\(=\left(a+b\right)\left(ab+c^2+ca+cb\right)\)
\(=\left(a+b\right)\left(b+c\right)\left(a+c\right)\)