# Rational root theorem

In algebra, the rational root theorem (or rational root test, rational zero theorem or rational zero test) states a constraint on rational solutions (or roots) of a polynomial equation

$a_nx^n+a_{n-1}x^{n-1}+\cdots+a_0 = 0\,\!$

with integer coefficients.

If a0 and an are nonzero, then each rational solution x, when written as a fraction x = p/q in lowest terms (i.e., the greatest common divisor of p and q is 1), satisfies

The rational root theorem is a special case (for a single linear factor) of Gauss's lemma on the factorization of polynomials. The integral root theorem is a special case of the rational root theorem if the leading coefficient an = 1.

## Proofs

### A proof

Let P(x) = anxn + an−1xn−1 + ... + a1x + a0 for some a0, ..., anZ, and suppose P(p/q) = 0 for some coprime p, qZ:

$P\left(\tfrac{p}{q}\right) = a_n\left(\tfrac{p}{q}\right)^n + a_{n-1}\left(\tfrac{p}{q}\right)^{n-1} + \cdots + a_1\left(\tfrac{p}{q}\right) + a_0 = 0.$

If we multiply both sides by qn, shift the constant term to the right hand side, and factor out p on the left hand side, we get

$\qquad p(a_np^{n-1} + a_{n-1}qp^{n-2} + \cdots + a_1q^{n-1}) = -a_0q^n.$

We see that p times the integer quantity in parentheses equals −a0qn, so p divides a0qn. But p is coprime to q and therefore to qn, so by (the generalized form of) Euclid's lemma it must divide the remaining factor a0 of the product.

If we instead shift the leading term to the right hand side and factor out q on the left hand side, we get

$\qquad q(a_{n-1}p^{n-1} + a_{n-2}qp^{n-2} + \cdots + a_0q^{n-1}) = -a_np^n.$

And for similar reasons, we can conclude that q divides an.[1]

### Proof using Gauss's lemma

Should there be a nontrivial factor dividing all the coefficients of the polynomial, then one can divide by the greatest common divisor of the coefficients so as to obtain a primitive polynomial in the sense of Gauss's lemma; this does not alter the set of rational roots and only strengthens the divisibility conditions. That lemma says that if the polynomial factors in ℚ[X], then it also factors in ℤ[X] as a product of primitive polynomials. Now any rational root p/q corresponds to a factor of degree 1 in ℚ[X] of the polynomial, and its primitive representative is then qxp, assuming that p and q are coprime. But any multiple in ℤ[X] of qxp has leading term divisible by q and constant term divisible by p, which proves the statement. This argument shows that more generally, any irreducible factor of P can be supposed to have integer coefficients, and leading and constant coefficients dividing the corresponding coefficients of P.

## Example

For example, every rational solution of the equation

$3x^3 - 5x^2 + 5x - 2 = 0\,\!$

must be among the numbers symbolically indicated by

± $\tfrac{1,2}{1,3}\,,$

which gives the list of 8 possible answers:

$1, -1, 2, -2, \frac{1}{3}, -\frac{1}{3}, \frac{2}{3}, -\frac{2}{3}\,.$

These root candidates can be tested using the Horner's method (for instance). In this particular case there is exactly one rational root. If a root candidate does not satisfy the equation, it can be used to shorten the list of remaining candidates.[2] For example, x = 1 does not satisfy the equation as the left hand side equals 1. This means that substituting x = 1 + t yields a polynomial in t with constant term 1, while the coefficient of t3 remains the same as the coefficient of x3. Applying the rational root theorem thus yields the following possible roots for t:

$t=\pm\tfrac{1}{1,3}$

Therefore,

$x = 1+t = 2, 0, \frac{4}{3}, \frac{2}{3}$

Root candidates that do not occur on both lists are ruled out. The list of rational root candidates has thus shrunk to just x = 2 and x = 2/3.

If a root r1 is found, Horner's method will also yield a polynomial of degree n − 1 whose roots, together with r1, are exactly the roots of the original polynomial. It may also be the case that none of the candidates is a solution; in this case the equation has no rational solution. If the equation lacks a constant term a0, then 0 is one of the rational roots of the equation.