============================================================
Explanation:
If x = 3i is a root, then x^2+9 is a factor because of the steps below
x = 3i
x^2 = (3i)^2
x^2 = 9i^2
x^2 = 9(-1)
x^2 = -9
x^2+9 = 0
That last equation produces the roots x = 3i and x = -3i. They are a conjugate pair. Keep in mind that [tex]i = \sqrt{-1}[/tex] leads to [tex]i^2 = -1[/tex]
The root x = -1 leads to the factor x+1 since we add 1 to both sides to get 0 on the other side.
Similarly, x = 2 leads to x-2 = 0, so x-2 is the last factor needed.
------------------
The key takeaway from that last section is that we have these three factors
Multiply out the factors to get the final answer
(x^2+9)(x+1)(x-2)
(x^2+9)(x^2-x-2)
w(x^2-x-2) .......... let w = x^2+9
wx^2-wx-2w
x^2(w) - x(w) - 2(w)
x^2(x^2+9) - x(x^2+9) - 2(x^2+9) ..... plug in w = x^2+9
x^4+9x^2-x^3-9x - 2x^2-18
x^4 - x^3 + 7x^2 - 9x - 18