divide the polynomial x^3-3x^2+x+2 by x+2. Express your answer in the form f(x)=d(x)q(x)+r(x).

I use synthetic division for this type of question

-2 | 1 -3 1 2

........ -2 10 -22
....... 1 -5 11 -20

(hard to line up nicely)

x^3-3x^2+x+2 = (x+2)(x^2 - 5x + 11) - 20