Rewrite in form of ax^3+bx^2+cx+d

(x-1)(x^2+x+1)=2x^2-17

I got x^3-2x^2-18

Is this correct?

I am also then asked to show that (x+2) is a factor of the above polynomial.

Thanks

(x-1)(x^2+x+1)

= x^3 + x^2 + x - x^2 - x - 1
= x^3 - 1

so
(x-1)(x^2+x+1)=2x^2-17
x^3 - 1 = 2x^2 - 17
x^3 - 2x^2 + 16 = 0

error in the constant
you also lost the fact that it was an equation
your instructions should have been:
"Rewrite in form of ax^3+bx^2+cx+d = 0 "

let f(x) = x^3 - 2x^2 + 16
if x+2 is a factor, then f(-2) = 0
let's see ....
f(-2) = (-2)^3 - 2(-2)^2 + 16
= -8 - 8 + 16
= 0

then x+2 is a factor of x^3 - 2x^2 + 16