Given,
(x + 1) and (x - 2) are factors of x3 + (a + 1)x2 - (b - 2)x - 6
x + 1 = 0 ⇒ x = -1.
Since, x + 1 is factor of x3 + (a + 1)x2 - (b - 2)x - 6. Hence, on substituting x = -1 in expression, remainder = 0.
⇒ (-1)3 + (a + 1)(-1)2 - (b - 2)(-1) - 6 = 0
-1 + (a + 1)(1) - (-b + 2) - 6 = 0
-1 + a + 1 + b - 2 - 6 = 0
a + b = 8
b = 8 - a ........(i)
x - 2 = 0 ⇒ x = 2.
Since, x - 2 is factor of x3 + (a + 1)x2 - (b - 2)x - 6. Hence, on substituting x = 2 in expression, remainder = 0.
⇒ (2)3 + (a + 1)(2)2 - (b - 2)(2) - 6 = 0
⇒ 8 + (a + 1)(4) - (2b - 4) - 6 = 0
⇒ 8 + 4a + 4 - 2b + 4 - 6 = 0
⇒ 10 + 4a - 2b = 0
⇒ 2b = 4a + 10
⇒ b = 2a + 5 ........(ii)
From (i) and (ii) we get,
⇒ 8 - a = 2a + 5
⇒ 2a + a = 8 - 5
⇒ 3a = 3.
⇒ a = 1.
Substituting a = 1, in (i) we get,
⇒ b = 8 - 1 = 7.
Substituting a = 1, b = 7 in expression we get,
Expression = x3 + (1 + 1)x2 - (7 - 2)x - 6 = x3 + 2x2 - 5x - 6.
On dividing, x3 + 2x2 - 5x - 6 by (x + 1),
$$\begin{array}{l} \phantom{x + 1)}{x^2 + x - 6} \\ x + 1\overline{\smash{\big)}x^3 + 2x^2 - 5x - 6} \\ \phantom{x + 1}\underline{\underset{-}{}x^3 \underset{+}{-} x^2} \\ \phantom{{x + 1}3x^3+}x^2 - 5x \\ \phantom{{x + 1}3x^3\enspace}\underline{\underset{-}{}x^2 \underset{-}{+} x} \\ \phantom{{x + 1}{x^32x^2}{+2}}-6x - 6 \\ \phantom{{x + 1}{x^32x^2}{+2x}}\underline{\underset{+}{-}6x \underset{+}{-} 6} \\ \phantom{{x + 1}{x^32x^2}{+2x^2-}}\times \end{array}$$
we get, quotient = x2 + x - 6.
Factorising, x2 + x - 6
= x2 + 3x - 2x - 6
= x(x + 3) - 2(x + 3)
= (x - 2)(x + 3).
Hence, a = 1, b = 7 and x3 + 2x2 - 5x - 6 = (x + 1)(x - 2)(x + 3).