Here in the given question,

Dividend = *x*^{3} - 3*x*^{2} + *x* + 2

Quotient = *x* - 2

Remainder = -2*x* + 4

Divisor = *g*(*x*)

We know that,

Dividend = Quotient × Divisor + Remainder

⇒ *x*^{3} - 3*x*^{2} + *x* + 2 = (*x* - 2) × *g*(*x*) + (-2*x* + 4)⇒ *x*^{3} - 3*x*^{2} + *x* + 2 - (-2*x* + 4) = (*x* - 2) × *g*(*x*)

⇒ *x*^{3} - 3*x*^{2} + 3*x* - 2 = (*x* - 2) × *g*(*x*)

⇒ *g*(*x*) = (*x*^{3} - 3*x*^{2} + 3*x* - 2)/(*x* - 2)

**∴ ***g*(*x*) = (*x*^{2} - *x* + 1)