Chapter 4 Polynomials In this Chapter we shall see that everything we did with integers in the last Chapter we can also do with polynomials. Fix a field F (e.g. F = Q, R, C or Z/(p) for a prime p). Notation We write F [X] for the set consisting of all expressions a 0 + a 1 X + + a n X n, where a 0, a 1,..., a n F and a n 0, together with the zero symbol 0 F [X]. The elements of F [X] are called polynomials with coefficients in F. We say that the element a i is the coefficient of X i in a 0 +a 1 X + +a n X n. For i > n the coefficient of X i in a 0 +a 1 X + +a n X n is 0. Example in Q. Taking F = Q, the expression 2+3X +( 5)X 2 +0.X 3 +1.X 4 is a polynomial with coefficients Conventions (i) We usually write 0 for 0 F [X] (the zero polynomial) - not to be confused with the zero element of F. (ii) Zero coefficients are usually missed out, e.g. 2 + 0.X + 3X 2 + 0X 3 + 7X 4 is written simply as 2 + 3X 2 + 7X 4. (iii) a 0 + a 1 X + + a i 1 X i 1 + ( b)x i + + a n X n is also written as a 0 + a 1 X + + a i 1 X i 1 bx i + + a n X n, e.g. 2 3X + 4X 2 means 2 + ( 3)X + 4X 2. (iv) We often miss out a coefficient which is 1, e.g. X + X 3 means 1.X + 1.X 3. (v) The polynomial a 0 + a 1 X + + a n X n may also be represented as a 0 + a 1 X + + a n X n + 0X n+1 + + 0.X m, for any m > n. For example 2 + X is also represented as 2 + X + 0.X 2. (vi) A polynomial is often denoted f(x), g(x), h(x) etc. Addition For f(x) = a 0 + a 1 X + + a n X n and g(x) = b 0 + b 1 X + + b n X n we define f(x) + g(x) = (a 0 + b 0 ) + (a 1 + b 1 )X + + (a n + b n )X n. Example (3 + X 2 ) + (2X 2 + 5X 3 + X 4 ) = (3 + 0.X + 0.X 2 + 1.X 3 + 0.X 4 ) + (0 + 0.X + 2X 2 + 5X 3 + X 4 ) = 3 + 0.X + 2.X 2 + 6.X 3 + 1.X 4 = 3 + 2X 2 + 6X 3 + X 4 1
Multiplication Given polynomials f(x) = a 0 + a 1 X + +a m X m and g(x) = b 0 + b 1 X + +b n X n we define f(x) g(x) = c 0 + c 1 X + + c m+n X m+n, where c r is the sum of all terms a i b j with i + j = r (for 0 r m + n). Example (1 + X)(1 + X + X 2 ) = 1 + 2X + 2X 2 + X 3. Proposition 4.1 F [X] is a commutative ring (with respect to the operations of addition and multiplication just defined). Let f(x) = a 0 + a 1 X + + a n X n be a polynomial with a n 0. The degree of f(x) is n. We write deg(f(x)) for the degree of f(x). Note that we do not assign a degree to the zero polynomial. Example deg(5 + X 3 ) = 3, deg(1 + 7X 3 + 8X 4 ) = 4, deg(1 X 2 ) = 2, deg(5) = 0. Lemma 4.2 Let f(x), g(x) be non-zero polynomials. Then f(x)g(x) is non-zero, and deg(f(x)g(x)) = deg(f(x)) + deg(g(x)). Let f(x), g(x) be polynomials with g(x) 0. We say that g(x) divides f(x), and write g(x) f(x), if there exists some polynomial h(x) such that f(x) = g(x)h(x). Examples 1. X + 1 divides X 2 1 because X 2 1 = (X + 1)(X 1). 2. X + 1 divides 1 2 X2 + X + 1 2 because 1 2 X2 + X + 1 2 = (X + 1)( 1 2 X + 1 2 ). Lemma 4.3 If g(x) f(x) then either f(x) = 0 or deg(f(x)) deg(g(x)). Proposition 4.4 (The Division Algorithm) Let f(x), g(x) be polynomials with g(x) 0. Then there are unique polynomials q(x), r(x) such that f(x) = g(x)q(x) + r(x) and either r(x) = 0 or deg(r(x)) < deg(g(x)). The way we find q(x) and r(x) in practice is by long division. Example Let f(x) = X 5 X 4 5X 3 + 3X 2 + 6X + 4 and g(x) = X 3 2X + 1. Find q(x), r(x) such that f(x) = q(x)g(x) + r(x) with either r(x) = 0 or deg(r(x)) < 3. 2
X 2 X 3 X 3 2X +1 X 5 X 4 5X 3 +3X 2 +6X +4 X 5 2X 3 +X 2 X 4 3X 3 +2X 2 +6X +4 X 4 +2X 2 X 3X 3 +7X +4 3X 3 +6X 3 X +7 So X 5 X 4 5X 3 + 3X 2 + 6X + 4 = q(x)(x 3 2X + 1) + r(x), where q(x) = X 2 X 3 and r(x) = X + 7. Notation For a polynomial f(x) = a n X n + + a 1 X + a 0 and c F we write f(c) for a n c n + + a 1 c + a 0. We call f(c) the value of f(x) at X = c. We can think of a polynomial f(x) as defining the function f : F F given by the rule c f(c). Theorem 4.5 (the Remainder Theorem ) and let a F. Then (X a) divides f(x) if and only if f(a) = 0. Let f(x) be a polynomial with coefficients in a field F Example f(x) = (X 1)(X 2)). Let f(x) = X 2 3X + 2 Q[X]. We have f(1) = 1 3 + 2 = 0 and indeed X 1 f(x) (as Call a F a root of the polynomial f(x) if f(a) = 0. Example Take F = Q. Then X 2 + 1 has no roots (in F ), X 2 X has roots 0, 1, and X 2 2X + 1 has the root 1. Proposition 4.6 A (non-zero) polynomial of degree n has at most n roots. The analogue of the idea of a prime number in the algebra of polynomials is the idea of an irreducible polynomial. A non-constant polynomial f(x) is called irreducible if the only way f(x) can be expressed as a product g(x)h(x) is with either g(x) or h(x) a constant polynomial. 3
Examples 1. X 2 + 1 is irreducible in Q[X] and R[X]. 2. X 4 + X 3 + 2X 2 + X + 1 is not irreducible because it factorizes as (X 2 + 1)(X 2 + X + 1). Remark A quadratic or cubic polynomial is irreducible if and only if it has no root. This is not generally true for polynomials of higher degree: the second example above shows that a degree four polynomial might split into a product of two factors neither of which has a root. Any two non-constant polynomials f(x), g(x) have a greatest common divisor, a polynomial d(x) that we can calculate from f(x) and g(x) using the Euclidean algorithm, just as we calculated the gcd of any two non-zero integers in Chapter 3. The gcd of two integers was unique because we required it to be a positive number. The gcd of two polynomials is unique if we require it to be monic: is 1. A (non-zero) polynomial f(x) of degree n is called monic if the coefficient of X n in f(x) Example X 2 + 7 is monic, 2X 3 27X is not. By reversing the steps of the Euclidean algorithm (just as we did for integers) we can show that if d(x) is the gcd of a pair of non-zero polynomials f(x) and g(x) then we can find polynomials u(x) and v(x) such that u(x)f(x) + v(x)g(x) = d(x). For example if f(x) is any non-zero polynomial and g(x) is any irreducible non-zero polynomial which does not divide g(x), so that gcd(f(x), g(x)) = 1 (the constant monic polynomial), we deduce that there exist polynomials u(x) and v(x) such that u(x)f(x) + v(x)g(x) = 1. We are now in a position to prove that irreducible polynomials behave exactly like prime numbers: Proposition 4.7 Suppose that g(x) is irreducible and g(x) p(x)q(x). Then g(x) p(x) or g(x) q(x). Theorem 4.8 Let f(x) be a non-constant polynomial. Then f(x) can be written in the form f(x) = am 1 (X) r1 m 2 (X) r2... m k (X) r k ( ) for some a F and distinct monic irreducible polynomials m 1 (X),..., m k (X). Moreover, the expression ( ) is unique up to order of factors, that is, if f(x) = bn 1 (X) s1 n 2 (X) s2... n l (X) s l is another such expression then a = b, k = l and, after reordering n 1 (X),..., n l (X) if necessary, we have m 1 (X) = n 1 (X), m 2 (X) = n 2 (X),..., m k (X) = n k (X). 4
Example Write f(x) = 1 2 X4 + X 3 + X 2 + X + 1 2 R[X] in the form of Theorem 4.8. First write f(x) = 1 2 (X4 + 2X 3 + 2X 2 + 2X + 1). Does g(x) = X 4 + 2X 3 + 2X 2 + 2X + 1 have a root? Note that g( 1) = 1 2+2 2+1 = 0 so X +1 divides g(x). We have g(x) = (X +1)(X 3 +X 2 +X +1). Does h(x) = X 3 + X 2 + X + 1 have a root? Yes, 1 is a root, since h( 1) = 1 + 1 + 1 + 1 = 0. Now by dividing (X + 1) into h(x) we see that h(x) = (X + 1)(X 2 + 1). Is X 2 + 1 irreducible? If not it can be written as the product of two linear factors but X 2 + 1 has no root (as a 2 + 1 > 0 for all a R) so this is impossible. Hence h(x) is irreducible and f(x) = 1 2 (X + 1)2 (X 2 + 1) is an expression of the required kind. For F = C we have the Fundamental Theorem of Algebra, i.e. every non-constant polynomial in C[X] has a root (in C). It follows that any f(x) C[X] can be written in the form f(x) = a(x c 1 )... (X c r ), for a, c 1,..., c r C. Unfortunately a proof of the Fundamental Theorem of Algebra is far outside the scope of this course (but see Complex Variables, MAS 205). Constructing fields from polynomial rings We saw in Chapter 3 that Z/(m) is a field if and only if m is a prime. In a completely analogous way, if we start with a polynomial ring F [X] in place of Z and consider the elements of F [X] modulo some fixed polynomial m(x), we obtain a ring F [X]/(m(X)) which is a field if and only if m(x) is irreducible. To see how this works in practice we must first choose the field F of coefficients of our polynomials. We might take F to be one of the fields of the form F = Z/(p), p any prime, or we might choose F to be Q or R or C. Now let m(x) = X n + d 1 X n 1 + + d n be a fixed irreducible polynomial in F [X]. We shall make a field from the polynomials a 0 + a 1 X + + a n 1 X n 1 of degree less than n. We proceed in a similar way to the beginning of the section on Congruences and Modular Arithmetic in Chapter 3. We denote the operations of addition and multiplication by and. Addition is defined by: (a 0 + + a n 1 X n 1 ) (b 0 + + b n 1 X n 1 ) = (a 0 + b 0 ) + + (a n 1 + b n 1 )X n 1. Multiplication (which is more subtle) is by throwing away multiples of m(x), that is f(x) g(x) = r(x) where f(x)g(x) = q(x)m(x) + r(x) and r(x) = 0 or deg(r(x)) < n. 5
Example Take F = Z/(p) with p = 2, and take m(x) = X 2 + X + 1. (Note m([0]) = [1], m([1]) = [3] = [1] so m(x) has no roots and, since it has degree 2, is irreducible.) We construct the field K as above from Z/(2)[X] by throwing away multiples of m(x). Writing 0 for the zero polynomial [0] and 1 for the degree zero polynomial [1], the elements of K are 0, 1, X, 1 + X. These add in the obvious way and multiply according to the following table. 0 1 X 1 + X 0 0 0 0 0 1 0 1 X 1 + X X 0 X 1 + X 1 1 + X 0 1 + X 1 X For example (1 + X)(1 + X) = X 2 + 1 = m(x) + X so (1 + X) (1 + X) = X. Similarly, for any prime p, and any irreducible polynomial m(x) of degree 2 over Z/(p), we can construct a field having p 2 elements by taking Z/(p)[X] and throwing away all multiples of m(x). In fact finite fields are completely classified as follows. If F is any finite field then F has p n elements for some given prime p and positive integer n. Moreover, for given p and n there exists a field having p n elements (the construction is similar to the above) and any two fields with p n elements have the same addition and multiplication tables. We shall not prove these facts here, but see Algebraic Structures I, MAS 201, and Coding Theory, MAS 309. 6