Theorem17.6Division Algorithm
Let $f(x)$ and $g(x)$ be polynomials in $F[x]\\text{,}$ where $F$ is a field and $g(x)$ is a nonzero polynomial. Then there exist unique polynomials $q(x), r(x) \\in F[x]$ such that
\n\\begin{equation*}\nf(x) = g(x) q(x) + r(x),\n\\end{equation*}\n
where either $\\deg r(x) \\lt \\deg g(x)$ or $r(x)$ is the zero polynomial.
Proof
We will first consider the existence of $q(x)$ and $r(x)\\text{.}$ If $f(x)$ is the zero polynomial, then
\n\\begin{equation*}\n0 = 0 \\cdot g(x) + 0;\n\\end{equation*}\n
hence, both $q$ and $r$ must also be the zero polynomial. Now suppose that $f(x)$ is not the zero polynomial and that $\\deg f(x) = n$ and $\\deg g(x) = m\\text{.}$ If $m \\gt n\\text{,}$ then we can let $q(x) = 0$ and $r(x) = f(x)\\text{.}$ Hence, we may assume that $m \\leq n$ and proceed by induction on $n\\text{.}$ If
\n\\begin{align*}\nf(x) & = a_n x^n + a_{n-1} x^{n - 1} + \\cdots + a_1 x + a_0\\\\\ng(x) & = b_m x^m + b_{m-1} x^{m - 1} + \\cdots + b_1 x + b_0\n\\end{align*}\n
the polynomial
\n\\begin{equation*}\nf'(x) = f(x) - \\frac{a_n}{b_m} x^{n - m} g(x)\n\\end{equation*}\n
has degree less than $n$ or is the zero polynomial. By induction, there exist polynomials $q'(x)$ and $r(x)$ such that
\n\\begin{equation*}\nf'(x) = q'(x) g(x) + r(x),\n\\end{equation*}\n
where $r(x) = 0$ or the degree of $r(x)$ is less than the degree of $g(x)\\text{.}$ Now let
\n\\begin{equation*}\nq(x) = q'(x) + \\frac{a_n}{b_m} x^{n - m}.\n\\end{equation*}\n
Then
\n\\begin{equation*}\nf(x) = g(x) q(x) + r(x),\n\\end{equation*}\n
with $r(x)$ the zero polynomial or $\\deg r(x) \\lt \\deg g(x)\\text{.}$
To show that $q(x)$ and $r(x)$ are unique, suppose that there exist two other polynomials $q_1(x)$ and $r_1(x)$ such that $f(x) = g(x) q_1(x) + r_1(x)$ with $\\deg r_1(x) \\lt \\deg g(x)$ or $r_1(x) = 0\\text{,}$ so that
\n\\begin{equation*}\nf(x) = g(x) q(x) + r(x) = g(x) q_1(x) + r_1(x),\n\\end{equation*}\n
and
\n\\begin{equation*}\ng(x) [q(x) - q_1(x) ] = r_1(x) - r(x).\n\\end{equation*}\n
If $q(x) - q_1(x)$ is not the zero polynomial, then
\n\\begin{equation*}\n\\deg( g(x) [q(x) - q_1(x) ] )= \\deg( r_1(x) - r(x) ) \\geq \\deg g(x).\n\\end{equation*}\n
However, the degrees of both $r(x)$ and $r_1(x)$ are strictly less than the degree of $g(x)\\text{;}$ therefore, $r(x) = r_1(x)$ and $q(x) = q_1(x)\\text{.}$