Let us consider #((x-5)(x^2-2x+1))/((x-7)(x^2+2x+3))#
We can write this as #((x-5)(x-1)^2)/((x-7)((x+1)^2+2))#
Observe that both #(x-1)^2# and #((x+1)^2+2)# are always positive
Hence sign of #((x-5)(x^2-2x+1))/((x-7)(x^2+2x+3))# depends on sign of #(x-5)/(x-7)# and if former is positive, #(x-5)/(x-7)# is positive. When is #(x-5)/(x-7)# is positive? It is apparent that #(x-5)/(x-7)# is positive, when #x-5# and #x-7# have same signs i.e.
either both #x-5>0# and #x-7>0# i.e. #x>7# then #(x-5)/(x-7)# is positive
or both #x-5<0# and #x-7<0# i.e. #x<5# then #(x-5)/(x-7)# is positive
What happens when value of #x# lies between #5# and #7#? Then while #x-5>0#, #x-7<0# and #(x-5)/(x-7)# is negative.
and hence if #((x-5)(x^2-2x+1))/((x-7)(x^2+2x+3))# is positive, #x# has no value between #5# and #7#.