*6. Polynomials
Definition For a set F , a polynomial over F with variable x is of the form
an xn + an−1 xn−1 + an−2 xn−2 + ... + a1 x + a0 ,
where an , an−1 , ..., a1 , a0 ∈ F . The ai , 0 ≤ i ≤ n are the coefficients of the
polynomial. If xn is the largest power of x appearing in the polynomial then
n is the degree of the polynomial, an xn is the leading term and an is the
leading coefficient. The collection of all polynomials with one variable x and
with coefficients from F will be denoted by F [x] . (Note the square brackets.)
Note that 0 ∈ F [x], being ... + 0x2 + 0x + 0, but it is not said to have a
degree, though some books give it degree −1 or even −∞.
Part of the aim of this section is to show how similar are the properties
of F [x] and Z.
Examples
3x2 + 5x − 1 ∈ Z [x] ,
5
3 3
x − x2 + x ∈ Q [x] ,
7
12
x2 − π ∈ R [x] .
We could also look at polynomials in Zm [x] or C [x].
If we can add and multiply numbers in the set F then we can add and
multiply the polynomials in F [x].
Examples (i) In Z [x] the sum of 3x2 + 5x − 1 and 5x3 − 3x2 + 2x + 1 is
3x2 + 5x − 1
+
5x3 − 3x2 + 2x + 1
= 5x3
+ 7x.
(ii) In Z [x] the difference of x2 + 1 and 9x + 7 is
x2 +
1
−
9x + 7
= x2 − 9x − 6.
Notice how subtraction is easier than for integers. For example 101 − 97
is complicated by the fact that we can subtract 7 from 1 and put −6 in the
units place, we have to instead “borrow” 10 from the next column. (iii) In
1
Z [x] the product of x2 + 2x + 3 and x2 + 4 is
x2 + 2x + 3 x2 + 4 =
3x2
+ 12
3
+ 2x
+ 8x
4
2
+x
+ 4x
4
3
= x + 2x + 7x2 + 8x + 12
We can do all the above again in more interesting sets. (i) Addition in
Z3 [x]. The sum of 2x3 + 2x2 + x + 1 and x3 + 2x2 + 2 is
2x3 + 2x2 + x + 1
+
x3 + 2x2
+2
=
x2 + x,
using 3 ≡ 0 mod 3 and 4 ≡ 1 mod 3. (ii) Subtraction in Z5 [x]. The difference
of 4x3 + 3x2 + x + 3 and 2x3 + 3x + 4 is
4x3 + 3x2 + x + 3
−
2x3
+ 3x + 4
= 2x3 + 3x2 + 3x + 4
using −2 ≡ 3 mod 5 and −1 ≡ 4 mod 5.
(iii) Multiplication in Z2 [x] . The product of x3 + x + 1 and x2 + x + 1 is
x3 + x + 1 x2 + x + 1 = x5 + x4 + x3
+ x3 + x2 + x
+ x2 + x + 1
= x5 + x4
+ 1.
using 2 ≡ 0 mod 2.
Note that in Z [x] , Q [x] , R [x] , C [x] or Zp [x], with p prime, we have
deg f g = deg f + deg g. This may not hold in Zm [x] with m composite.
Example In Z6 [x] multiply f (x) = 2x2 + 1 and g (x) = 3x5 + 1 to get
2x2 + 1 3x4 + 1 = 6x6 + 3x4 + 2x2 + 1
= 3x4 + 2x2 + 1.
Hence, in this example, deg f g < deg f + deg g.
2
Subtle point. Recall that two functions f and g are equal on a set X if,
and only if, f (x) = g (x) for all x ∈ X. Consider f (x) = x4 + 2x3 + 1 and
g (x) = (1 + x)2 over Z3 . There are only three elements in Z3 and for these,
f (0) = 1 = g (0) ,
f (1) = 1 = g (1) ,
f (2) = 0 = g (2) .
So as functions over Z3 these are equal though as polynomials they are
different.
Question If we can multiply polynomials can we factor them?
Assumption From now on F will be one of Q, R, C or Zp , with p prime
because, to look at factorization, or dividing, it is best to restrict to sets F
in which we can find inverses. (We can talk of dividing in Q, R or C but
not in Zp . Instead we have to remember that to divide by something is to
multiply by it’s inverse.)
(Aside: In Z6 does [3]6 have an inverse? i.e. does there exist an element
with [3]6 [x]6 = [1]6 . If there did, we could multiply both sides by [2]6 to get
[6]6 [x]6 = [2]6 , i.e. [0]6 = [2]6 , contradiction. So not every element in Z6 has
an inverse. The same argument works in general for Zm with m composite.)
The first step to answering this question about factoring is to look at long
division for polynomials.
Example In Q [x] divide x2 − x − 1 into x4 + 2x3 + 3x2 + 4x + 5.
Solution
x2 + 3x + 7
x2 − x − 1
x4 + 2x3 + 3x2 + 4x + 5
− x4 + x3 + x2
3x3 + 4x2 + 4x
− 3x3 + 3x2 + 3x
7x2 + 7x + 5
− 7x2 + 7x + 7
14x + 12
4
3
2
Hence x + 2x + 3x + 4x + 5 = (x2 + 3x + 7) (x2 − x − 1) + (14x + 12) .
Always, always check by multiplying out. You should never end with
an incorrect answer.
3
Thus given f and g ∈ Q [x] we have found q, r ∈ Q [x] such that f = qg+r
and deg r < deg g. This is very reminiscent of the division theorem for
integers and we have exactly the same result for polynomials.
Definition If f, g ∈ F [x] we say that g (x) divides f (x) , and write g|f , if
there exists q (x) ∈ F [x] such that f (x) = g (x) q (x). We also say that f if
a multiple of g.
Note that if g|f then either g ≡ 0 or deg g ≤ deg f .
Careful If m, n ∈ Z, then m|n and n|m imply m = ±n. If we then demand
that both m and n are positive we get m = n. But if we have polynomials
f, g ∈ F [x] then f |g implies deg f ≤ deg g. Similarly, g|f implies deg g ≤
deg f . Hence deg f = deg g. But f |g also means f = gu for some polynomial
u. Then deg f = deg g means deg u = 0, and so u is a non-zero constant.
Hence f |g and g|f imply only that f = cg for some constant c.
Example In Z3 [x]
x2 + 2x + 1
x2 + x + 1 x4
+ x2
+1
4
3
x + x + x2
2x3
+1
2x3 + 2x2 + 2x
x2 + x + 1
x2 + x + 1
0
(Often using −2 = 1, −1 = 2 modulo 3.)
Hence x4 + x2 + 1 = (x2 + 2x + 1) (x2 + x + 1) and so x2 + x + 1 divides
x4 + x2 + 1.
Theorem Division Theorem for Polynomials. (H.P p. 264) Let F be as
above.
Let f (x) , g (x) ∈ F [x] with g (x) 6≡ 0. Then there exist unique polynomials q (x) , r (x) ∈ F [x] such that
f (x) = q (x) g (x) + r (x)
and either r (x) ≡ 0 or r is non-zero and has a lower degree than g.
Proof Not given in course.
(Existence) If f (x) ≡ 0 we can write 0 = 0g (x) + 0, so we can assume
that f (x) 6≡ 0.
If g|f then f (x) = g (x) q (x) for some q (x) and the result follows with
r (x) ≡ 0. In particular if deg g = 0, i.e. g (x) ≡ c a non-zero constant, we
can take q (x) = c−1 f (x).
4
Hence we can assume that g - f and n = deg g ≥ 1.
Consider the set
S = {f − qg : q ∈ F [x]} .
Because g - f this set does not contain 0 so every element in this set has
a degree. This set is non-empty, since it contains f − 0g. If we look at D,
the set of degrees of the polynomials in S, we have a non-empty set of nonnegative integers so, by the well-ordering principle, it contains a minimum
element. Choose a q ∈ F [x] such that f − qg takes this minimum value and
set r = f − qg. Since g - f we have r (x) 6≡ 0 and so we have to show that
deg r < deg g.
Assume for the sake of contradiction that deg r ≥ deg g.
Let m = deg r and write r (x) = am xm + am−1 xm−1 + ... + a1 x + a0 , along
with g (x) = bn xn + bn−1 xn−1 + ... + b1 x + b0 . So m ≥ n, am 6= 0 and bn 6= 0.
Consider the polynomial
m−n
m−n
r (x) − am b−1
g (x) = (f (x) − q (x) g (x)) − am b−1
g (x)
n x
n x
−1 m−n
= f (x) − q + am bn x
g (x) ∈ S.
It is in S but the degree of this polynomial is ≤ m − 1, i.e. it is <
deg r, contradicting the choice of r as having minimum degree. Hence our
assumption is false and deg r < deg g as required.
(Uniqueness) Assume for contradiction that, for some f and g, the division is not unique. For this pair we can find distinct divisions
f = qg + r and f = q´g + r´
with either r ≡ 0 or deg r < deg g and either r´≡ 0 or deg r´< deg g. Then
qg + r = q´g + r´, or r − r´= (q´− q) g.
Thus g divides r − r´. This means either r − r´≡ 0, i.e. r = r´, and thus q = q´,
contradicting the fact that we started with distinct divisions, or deg g ≤
deg (r − r´) ≤ max (deg r, deg r´) < deg g, again a contradiction. Hence our
assumption is false and the division is unique.
An important deduction connects the roots of a polynomial with factorization.
Corollary Let F be as above. Let p (x) ∈ F [x]. Then p (a) = 0 if, and only
if, (x − a) |p (x) .
Proof (⇒) Assume p (a) = 0. Apply the Theorem with f = p and g = x − a
to find q, r ∈ F [x] with p (x) = q (x) (x − a) + r (x) , and either r ≡ 0 or
5
deg r < deg g. If r ≡ 0 we are finished. Otherwise deg r < deg g = 1 and
so deg r = 0, i.e. r is a constant, c say. Thus p (x) = q (x) (x − a) + c. Put
x = a to see that c = 0. So again x − a divides p (x) .
(⇐) Assume (x − a) |p (x). But this means p (x) = q (x) (x − a) for some
q (x) ∈ F [x]. Putting x = a and we see that p (a) = 0.
Since a polynomial in F [x] of degree n can be the product of at most n
linear factors x − a, it can have at most n roots in F . But will it have exactly
n roots?
Example 2x − 1 ∈ Z [x] but it has no root is Z. Its root, 1/2√∈ Q.
But x2 − 2 ∈ Q [x] yet it has no root is Q. Its roots are ± 2 ∈ R.
Further x2 + 1 ∈ R [x] but it has no root is R. Its roots are ±i ∈ C.
Something different happens for C.
Theorem Fundamental Theorem of Algebra. If f ∈ C [x] has deg f ≥ 1
then f has a root in C. Thus f factorizes completely into n linear factors.
Proof Not given in this course.
So a polynomial in C [x] of degree n has exactly n roots in C.
The Corollary can help us factorize polynomials; to find linear factors it
suffices to find roots.
Examples (i) Factorize p (x) = x4 + x3 − 2x2 − 6x − 4 over R.
Solution Look at p (a) for small a. So p (0) = −4, p (1) = −8, p (−1) = 0.
Thus x + 1 divides p (x).
x+1
4
3
2
x − 2x − 4 x + x − 2x − 6x − 4
x4
− 2x2 − 4x
x3
− 2x − 4
3
x
− 2x − 4
0
3
x4 + x3 − 2x2 − 6x − 4 = (x + 1) x3 − 2x − 4 .
Writing q (x) = x3 − 2x − 4 we see that q (2) = 0 so x − 2 divides q (x) .
x−2
3
x + 2x + 2 x
− 2x − 4
3
2
x + 2x + 2x
−2x2 − 4x − 4
−2x2 − 4x − 4
0
2
6
x3 − 2x − 4 = (x − 2) x2 + 2x + 2 .
Does x2 +2x+2 factorize over R? Note that x2 +2x+2 = (x + 1)2 +1 ≥ 1
and so can never be zero for real x. Thus x2 + 2x + 2 has no linear factors.
Hence we finish with
x4 + x3 − 2x2 − 6x − 4 = (x + 1) (x − 2) x2 + 2x + 2 .
(ii) Factorize p (x) = x4 + x3 + x2 + 3x + 4 over Z5 .
Solution We need only check x = 0, 1, 2, 3 ≡ −2 or 4 ≡ −1 mod 5. In turn,
p (0) = 4, p (1) = 0, p (2) = 3 while p (−2) = 0 and p (−1) = 2, all calculation
modulo 5. Thus x − 1 and x + 2 divide p (x).
So for some q (x) we have p (x) = (x − 1) (x + 2) q (x) = (x2 + x − 2) q (x) ,
i.e.
x2
+3
2
4
3
2
x + x − 2 x + x + x + 3x + 4
x4 + x3 − 2x2
3x2 + 3x + 4
3x2 + 3x + 4
0
x4 + x3 + x2 + 3x + 4 = (x − 1) (x + 2) x2 + 3 .
You should check that x2 + 3 has no zeros, it could have 1 or −2 as zeros,
just as p (x) did.
The division Theorem above is very similar to a result in integers. Other
ideas can be generalized to polynomials such as
Definition Let F be one of Q, R, C or Zp , with p prime. Let f, g ∈ F [x] be
polynomials not both identically zero. Then a greatest common divisor is a
polynomial d ∈ F [x] such that
(i) d (x) divides both f (x) and g (x),
(ii) if c (x) divides both f (x) and g (x) then c (x) divides d (x).
Note that if the gcd exists it is not unique. For if d satisfies (i) and (ii) and
λ ∈ F is non-zero then λd also satisfies the two properties. A particular gcd
is often picked out take λ = c−1 where c is the leading coefficient of d. Then
c−1 d has leading coefficient 1, and is called a monic polynomial.
We need to justify that such a gcd exists. We do not use the same
argument as used for the gcd of integers.
Theorem Let F be as above. Let f, g ∈ F [x] be polynomials not both
identically zero. Then there exists d ∈ F [x] such that
7
(i) d (x) divides both f (x) and g (x),
(ii) if c (x) divides both f (x) and g (x) then c (x) divides d (x).
Proof Not given in course.
Let
S = {f (x) K (x) + g (x) L (x) : K (x) , L (x) ∈ Q [x]} {0} .
Let D be the set of degrees of polynomials in S. W.l.o.g. assume f is not
identically zero and take K ≡ 1 and L ≡ 0 to see that f = 1.f +0.g ∈ S. Thus
S, and and in turn D, are non-empty. D is a set of non-negative integers so, by
the well-ordering principle it has a least element. Take K (x) , L (x) ∈ F [x]
so that d (x) = f (x) K (x) + g (x) L (x) has this minimum degree. We have
to show that (i) and (ii) of the definition both hold.
(i) Use the division Theorem to write f (x) = q (x) d (x) + r (x) for some
q (x) , r (x) ∈ F [x] with either r ≡ 0 or deg r < deg d. Then
r (x) = f (x) − q (x) d (x) = f (x) − q (x) (f (x) F (x) + g (x) L (x))
= f (x) (1 − q (x) K (x)) + (−q (x) L (x)) g (x)
which is either ≡ 0 or in S. If it is not identically zero then we have r (x) ∈ S
and deg r < deg d, which contradicts the minimality of deg d. Hence r ≡ 0
and f (x) = q (x) d (x), i.e. d|f .
Similarly you can show that d|g.
(ii) Assume that c (x) divides both f (x) and g (x), so f (x) = c (x) u (x)
and g (x) = c (x) v (x) for some u (x) , v (x) ∈ F [x]. Then
d (x) = f (x) K (x) + g (x) L (x) = c (x) u (x) K (x) + c (x) v (x) L (x)
= c (x) (u (x) K (x) + v (x) L (x))
and so c (x) divides d (x).
In any given problem we construct a gcd using repeated use of the Division
Theorem. And if we formalize this method we get
Theorem The Euclidean Algorithm for Polynomials. Let F be as above.
Let f, g ∈ F [x] be polynomials. If g divides f then g is a gcd of f and g.
Otherwise apply the Division Theorem to obtain a series of equations
f = gq1 + r1 , 0 < deg r1 < deg g,
g = r1 q2 + r2 , 0 < deg r2 < deg r1 ,
r1 = r2 q3 + r3 , 0 < deg r3 < deg r2 ,
..
.
rj−2 = rj−1 qj + rj ,
rj−1 = rj qj+1 .
0 < deg rj < deg rj−1 ,
8
Then rj , the last non-zero remainder, is a greatest common divisor of f
and g. Further, by working back up this list we can find p (x) , q (x) ∈ F [x]
such that
gcd (f (x) , g (x)) = p (x) f (x) + q (x) g (x) .
Proof Left to student.
Examples (i) Over Q [x] find a greatest common divisor of f (x) = 2x5 +
6x4 + 10x3 + x2 − 14x − 12 and g (x) = 2x4 + 3x3 + 4x2 − 8x − 8 and write
the answer as a linear combination of f and g.
Solution
x + 23
2x4 + 3x3 + 4x2 − 8x − 8 2x5 + 6x4 + 10x3 + x2 − 14x − 12
2x5 + 3x4 + 4x3 − 8x2 − 8x
3x4 + 6x3 + 9x2 − 6x − 12
3x4 + 92 x3 + 6x2 − 12x − 12
3 3
x + 3x2 + 6x
2
So
f (x) =
3
x+
2
g (x) + r1 (x)
where r1 (x) = 23 x3 + 3x2 + 6x. We need to now divide r1 (x) into g (x).
3 3
x
2
− 32
+ 3x + 6x 2x + 3x + 4x − 8x − 8
2x4 + 4x3 + 8x2
−x3 − 4x2 − 8x − 8
−x3 − 2x2 − 4x
−2x2 − 4x − 8
2
So
g (x) =
4
3
4
2
x−
3
3
2
4
x
3
r1 (x) + r2 (x)
where r2 (x) = −2x2 − 4x − 8. We need to now divide r2 (x) into r1 (x) .
− 34 x
−2x2 − 4x − 8 32 x3 + 3x2 + 6x
3 3
x + 3x2 + 6x
2
0
So we have found a zero remainder. The greatest common divisor is the
last non-zero remainder, r2 (x) = −2x2 − 4x − 8.
9
We can work back and write the gcd as a linear multiple of f and g. So
4
2
r2 (x) = g (x) −
x−
r1 (x)
3
3
4
2
3
= g (x) −
x−
f (x) − x +
g (x)
3
3
2
2
3
4
2
4
x−
x+
g (x) −
x−
f (x)
=
1+
3
3
2
3
3
2
4x + 4x
4x − 2
=
g (x) −
f (x) .
3
3
(ii) Over Q [x] find a greatest common divisor of f (x) = x4 + 3x3 + 6x2 +
6x + 4 and g (x) = x4 − 3x2 − 6x − 2 and express your answer as a linear
combination of the original polynomials.
Solution Firstly
x4 + 3x3 + 6x2 + 6x + 4 = 1 × x4 − 3x2 − 6x − 2 + 3x3 + 9x2 + 12x + 6.
Next
1
x 3x3 + 9x2 + 12x + 6 + −3x3 − 7x2 − 8x − 2
3
1
=
x − 1 3x3 + 9x2 + 12x + 6 + 2x2 + 4x + 4.
3
x4 − 3x2 − 6x − 2 =
Then
3
x 2x2 + 4x + 4 + 3x2 + 6x + 6
2
3
3
x+
2x2 + 4x + 4 .
=
2
2
3x3 + 9x2 + 12x + 6 =
There is no remainder here, and so a gcd is the last non-zero remainder,
i.e
gcd x4 − 3x2 − 6x − 2, x4 + 3x3 + 6x2 + 6x + 4 = 2x2 + 4x + 4
and
1
2x + 4x + 4 = x − 3x − 6x − 2 −
x − 1 3x3 + 9x2 + 12x + 6
3
1
= g (x) −
x − 1 (f (x) − g (x))
3
1
1
= −
x − 1 f (x) + xg (x) .
3
3
2
4
2
10
(Always, always check your answer.)
(ii) Over Z3 [x] find a greatest common divisor of x3 + 2x2 + 2x + 1
and x4 + 2 and express your answer as a linear combination of the original
polynomials.
Solution Firstly
x4 + 2 = x x3 + 2x2 + 2x + 1 + x3 + x2 + 2x + 2
= (x + 1) x3 + 2x2 + 2x + 1 + 2x2 + 1.
Next
x3 + 2x2 + 2x + 1 = 2x 2x2 + 1 + 2x2 + 1
= (2x + 1) 2x2 + 1 .
So gcd (x3 + 2x2 + 2x + 1, x4 + 2) = 2x2 + 1. And, quite simply,
2x2 + 1 = x4 + 2 − (x + 1) x3 + 2x2 + 2x + 1 .
11
© Copyright 2026 Paperzz