Q^n + k^(n-1).... + P = 0
Like: 3x^3+9x-6=0
All rational roots will be rational factors of P/Q such that:
Q = 3 Factors: 1,3
P = -6 Factors: [+/-] 1,2,3,6
Possible Rational Roots: [1/1,1/3,2/1,2/3,3/1,3/3,6/1,6/3] = [+/-] 1,1/3,2,2/3,3,6
Now you just test them in the equation itself and where the input makes the function equal 0, you have a root.
For this polynomial, no roots are rational, so when you test it you'll find that it must only contain irrational roots and may only be solved by other means.