Let be a polynomial with integer coefficients and constant coefficient . Use this Demonstration to find the rational roots of .

Each rational root is of the form , where and are integers such that divides and divides , the leading term. Make a list of all the possible rational roots by considering divisors of and .

At the start, the set of rational roots found is empty. Choose a candidate from the list. Using the Ruffini–Horner algorithm, divide by to get a polynomial and remainder (cyan box). If , then , and is a root of ; add to . Repeat this process with and the next candidate; continue until all the rational roots have been found. (The maximum number of roots is , so there may be no need to test all the candidates.)