Given: #color(white)("XXX")color(red)(1)x^3-color(blue)(3)x-color(red)(2)#
Note that #color(red)(-1-2)=color(blue)(-3)#
which implies #x=-1# is a solution to the given equation
and therefore #color(white)("XXX")(x+1)# is a factor of the expression:
#(x^3-3x-2) div (x+1) = (x^2-x-2)# #color(white)("XXX")#use polynomial long division or some other method to get this
#x^2-2-2# can be factored normally as #(x+1)(x-2)#