for a polynomial with real coefients, if a+bi is a root then a-bi is also a root
-3i is a root so 3i must aslso be a root
the factored form of a polynomial with roots r1,r2,r3 is (x-r1)(x-r2)(x-r3)
so
roots are -3i, 3i and 3
(x-(-3i))(x-(3i))(x-(3))
(x+3i)(x-3i)(x-3)
expanded
x³-3x²+9x-27