WOLFRAM|DEMONSTRATIONS PROJECT

Rational Roots of a Polynomial

​
only integer roots
degree
2
3
4
new polynomial
if the candidate
is a root, click:
next step
zoom
1
2
3
4
original polynomial:
3
x
-
2
x
+x-1
rational roots found so far = {}
current polynomial =
3
x
-
2
x
+x-1
candidates for new rational roots:
-1
1
1
-1
1
-1
1
0
1
1
0
1
0
current quotient =
2
x
+1
Let
P(x)=
n
x
+
a
n-1
n-1
x
+⋯+
a
1
x+
a
0
be a polynomial with integer coefficients and constant coefficient
a
0
≠0
. Use this Demonstration to find the rational roots of
P(x)
.
Each rational root is of the form
±
k
0
/
k
n
, where
k
0
and
k
n
are integers such that
k
0
divides
a
0
and
k
n
divides
a
n
, the leading term. Make a list of all the possible rational roots by considering divisors of
a
0
and
a
n
.
At the start, the set
S
of rational roots found is empty. Choose a candidate
h
from the list. Using the Ruffini–Horner algorithm, divide
P(x)
by
x-h
to get a polynomial
Q(x)
and remainder
R
(cyan box). If
R=0
, then
P(x)=Q(x)(x-h)
, and
h
is a root of
P(x)
; add
h
to
S
. Repeat this process with
P(x)/(x-h)
and the next candidate; continue until all the rational roots have been found. (The maximum number of roots is
n
, so there may be no need to test all the candidates.)
When
a
n
=1
, the rational roots are integers.