## Appendix

### Rational root test

We saw in the section Solving polynomial equations that, to find the roots of a polynomial (with integer coefficients), a good place to look is the factors of the constant term. In fact, we proved that any integer root must be a factor of the constant term.

As long as we're prepared to try a few more possibilities, we can determine whether there are any roots which are rational numbers (i.e., fractions).

###### Theorem (Rational root test)

Let \(f(x) = a_n x^n + a_{n-1} x^{n-1} + \dots + a_1 x + a_0\) be a polynomial with integer coefficients. If \(\dfrac{r}{s}\) is a rational root of \(f(x)\), and \(\dfrac{r}{s}\) is in simplest form, then \(r\) is a factor of \(a_0\) and \(s\) is a factor of \(a_n\).

###### Proof

Since \(f\big(\dfrac{r}{s}\big) = 0\), we have \[ a_n \left( \frac{r}{s} \right)^n + a_{n-1} \left( \frac{r}{s} \right)^{n-1} + a_{n-2} \left( \frac{r}{s} \right)^{n-2} + \dots + a_1 \left(\frac{r}{s}\right) + a_0 = 0. \]

Multiplying through by \(s^n\) gives \[ a_n r^n + a_{n-1} r^{n-1} s + a_{n-2} r^{n-2} s^2 + \dots + a_2 r^2 s^{n-2} + a_1 r s^{n-1} + a_0 s^n = 0. \]

Examining this equation, we see that every term on the left-hand side except the last is divisible by \(r\); so we have a multiple of \(r\), plus \(a_0 s^n\), equal to 0. Hence \(a_0 s^n\) is a multiple of \(r\); equivalently, \(r\) is a factor of \(a_0 s^n\). But, as \(\frac{r}{s}\) is in simplest form, \(r\)~and \(s\) have no factor in common; hence \(r\) is a factor of \(a_0\).

Similarly, every term on the left-hand side except the first is divisible by \(s\), so \(a_n r^n\) is also divisible by \(s\); equivalently, \(s\) is a factor of \(a_n r^n\). Again, since \(r\) and \(s\) have no common factor, \(s\) is a factor of~\(a_n\).

\(\Box\)