Simplify (x^3+3x^2+1)(3x^2+6x-2)