Timeless Theorems of Mathematics/Rational Root Theorem

The rational root theorem states that, if a rational number $$\frac{p}{q}$$ (where $$p$$ and $$q$$ are relatively prime) is a root of a polynomial with integer coefficients, then $$p$$ is a factor of the constant term and $$q$$ is a factor of the leading coefficient. In other words, for the polynomial, $$P(x) = a_{n}x^n + a_{n-1}x^{n-1} + a_{n-2}x^{n-2} + ...+ a_0$$, if $$P\left( \frac{p}{q}\right) = 0$$, (where $$a_i\in\Z$$ and $$a_0, a_n \neq 0$$) then $$\frac{a_0}{p}\in\Z$$ and $$\frac{a_n}{q}\in\Z$$

Proof
Let $$P(x) = a_{n}x^n + a_{n-1}x^{n-1} + a_{n-2}x^{n-2} + ...+ a_0$$, where $$a_i\in\Z$$.

Assume $$P(\frac{p}{q}) = 0$$ for coprime $$p, q\in\Z$$. Therefore, $$P(\frac{p}{q})=a_n(\frac{p}{q})^n+a_{n-1}(\frac{p}{q})^{n-1} + a_{n-2}(\frac{p}{q})^{n-2}+...+a_1(\frac{p}{q})+a_0 = 0$$ $$\Rightarrow a_np^n + a_{n-1}p^{n-1}q+a_{n-2}p^{n-2}q^2+...+a_1pq^{n-1}+a_0q^n=0$$ $$\Rightarrow p(a_np^n-1 + a_{n-1}p^{n-2}q+a_{n-3}p^{n-2}q^2+...+a_1q^{n-1})=-a_0q^n$$

Let $$w=a_np^n-1 + a_{n-1}p^{n-2}q+a_{n-3}p^{n-2}q^2+...+a_1q^{n-1}\in\Z$$

Thus, $$w=-\frac{a_0q^n}{p}$$

As $$p$$ is coprime to $$q$$ and $$w\in\Z.$$, thus $$\frac{a_0}{p}\in\Z$$.

Again, $$a_np^n + a_{n-1}p^{n-1}q+a_{n-2}p^{n-2}q^2+...+a_1pq^{n-1}+a_0q^n=0$$ $$\Rightarrow q(a_{n-1}p^{n-1}+a_{n-2}p^{n-2}q+...+a_1pq^{n-2}+a_0q^{n-1})=-a_np^n$$

Let $$(a_{n-1}p^{n-1}+a_{n-2}p^{n-2}q+...+a_1pq^{n-2}+a_0q^{n-1})=v\in\Z$$

Thus, $$qv=-a_np^n$$ $$\Rightarrow v=-\frac{a_np^n}{q}$$

As $$q$$ is coprime to $$p$$ and $$v\in\Z.$$, thus $$\frac{a_n}{p}\in\Z$$.

$$\therefore$$ For $$P(x) = a_{n}x^n + a_{n-1}x^{n-1} + a_{n-2}x^{n-2} + ...+ a_0$$, if $$P(\frac{p}{q}) = 0$$, (where $$a_i\in\Z$$ and $$a_0, a_n \neq 0$$) then $$\frac{(a_0)}{p}\in\Z$$ and $$\frac{a_n}{q}\in\Z$$. [Proved]