We can easily see that #(x+-1)# are not the factors of #f(x).#
Now, let us observe that, the leading co-eff. of #f(x)# is #1#, and has
factor #1#, and, the const. term is #40#, having factors,
#1,2,4,5,8,10,20,40.#
Therefore, by the Rational Root Theorem, the probable factors can
be worked out :-
#1x+-1,1x+-2,1x+-4,x+-5,x+-8,x+-10,+-20, x+-40#
Of these, #x+-1# have already been considered as non-factors.
As for, #x-2#, we have, #f(2)=8-28+4+40ne0.# It is not a factor.
For, #x+2, f(-2)=-8-28-4+40=0 :. (x+2)# is a factor.
Now to factorise #f(x)# completely, the Long / Synthetic Division can
be used. Instead, we proceed as under :-
#f(x)=x^3-7x^2+2x+40#
#=ul(x^3+2x^2)-ul(9x^2-18x)+ul(20x+40)#
#=x^2(x+2)-9x(x+2)+20(x+2)#
#=(x+2)(x^2-9x+20)#
#=(x+2){ul(x^2-5x)-ul(4x+20)}........[5xx4=20, 5+4=9]#
#=(x+2){x(x-5)-4(x-5)}#
#=(x+2)(x-5)(x-4).#
Thus, all the rational zeroes of #f(x)=0#are, #-2, 4, and, 5.#