a = -40/8 = -5 ---> b = -2 - a = -2 - (-5) = 3
a = -5, b = 3
f(x) = 2x^3 -5x^2 - 4x+3
you have to find the 3rd factor Q(x) = cx + d (f(x) is 3rd order and (x+1)(x-3) is 2nd order, so Q(x) must be 1st order for the multiplication of the three terms to give something with a cubic highest term
apply horner's synthetic division:
-1 || 2...-5...-4....3
--------------------------------
..........-2....7...-3
--------------------------------
......2...-7....3....0
2x^3 -5x^2 - 4x+3 = (x+1)(2x^2-7x+3)
then do it again for x = 3
3||....2...-7....3
----------------------------
.............6....-3
----------------------------
.......2....-1....0
(2x^2-7x+3) = (x-3)(2x-1)
so
f(x) = (x+1)(x-3)(2x-1)
Short Cut
----------------
You can use this method for all degree equations as it's a contracted form of long division. But you can use a short cut when you know two factors out of three like in this question:
(x+1)(x-3) = x*x+....+(1)(-3)
likewise
2x^3 -5x^2 - 4x+3 = (x+1)(x-3)(cx+d)
x*x*(cx) = 2x^3
cx^3 = 2x^3 ---> c=2, and
(1)*(-3)*(d) = 3 ----> -3d = 3 ---> d= -1, so
cx + d = 2x -1
you can get the last term this way too.
(didn't realize my horners were out of shape so had to add dots to get them in line)