Rational root theorem

Solution 1:

If $z = p/q$ is a rational root $$a_n z^n + a_{n-1}z^{n-1} + \ldots + a_1 z + a_0 = 0$$ reads $$a_n \frac{p^n}{q^n} + \ldots + a_1 \frac{p}{q} + a_0 = 0$$ which multiplied by $q^n$ gives $$a_n p^n + a_{n-1}q p^{n-1} + \ldots + a_1 p q^{n-1} = - a_0 q^n$$

As $p$ divides the lefthand side, p divides the righthand one, and by hypothesis, as $p$ and $q$ cannot have other common factors than $\pm 1$, $p$ divides $a_0$.

But we can also write

$$- a_n p^n = a_{n-1}q p^{n-1} + \ldots + a_1 p q^{n-1} +a_0 q^n$$ so that $q$ dividing the righthand side divides also the lefthand one, and as $p$ and $q$ cannot have other common factors than $\pm 1$, $q$ divides $a_n$.