Solve the polynomial
40x^2+2x-65
Notice that for x = 1 the value is -23. The number 23 is a prime number and the only factors are thus 23 and 1 up to signs. So, you can simply the search for the factors of the polynomial a great deal by substituting:
x = 1 + t which yields
40 t^2 + 82 t - 23 =
(10 t + 23) (4 t - 1)
You then substitute back x by putting
t = x - 1:
(10 t + 23) (4 t - 1) =
(10 x + 13) (4 x - 5)