(c+g)(c^2-cg+g^2)

I do this:

c(c^2-cg+g^2) + g(c^2-cg+g^2) then combine terms.