*6. Polynomials Definition For a set F, a polynomial over F with variable x is of the form a n x n + a n 1 x n 1 + a n 2 x n 2 +... + a 1 x + a 0, where a n, a n 1,..., a 1, a 0 F. The a i, 0 i n are the coefficients of the polynomial. If x n is the largest power of x appearing in the polynomial then n is the degree of the polynomial, a n x n is the leading term and a n 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... + 0x 2 + 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 x 2 + 5x 1 Z [x], 7 x 5 12 x2 + x Q [x], x 2 π R [x]. We could also look at polynomials in Z m [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 x 2 + 5x 1 and 5x x 2 + 2x + 1 is x 2 + 5x 1 ) + 5x x 2 + 2x + 1 ) = 5x + 7x. ii) In Z [x] the difference of x 2 + 1 and 9x + 7 is x 2 + 1 ) 9x + 7 ) = x 2 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 x 2 + 2x + and x 2 + 4 is x 2 + 2x + ) x 2 + 4 ) = x 2 + 12 + 2x + 8x +x 4 + 4x 2 = x 4 + 2x + 7x 2 + 8x + 12 We can do all the above again in more interesting sets. i) Addition in Z [x]. The sum of 2x + 2x 2 + x + 1 and x + 2x 2 + 2 is + 2x + 2x 2 + x + 1 x + 2x 2 + 2 ) = x 2 + x, using 0 mod and 4 1 mod. ii) Subtraction in Z 5 [x]. The difference of 4x + x 2 + x + and 2x + x + 4 is 4x + x 2 + x + ) 2x + x + 4 ) = 2x + x 2 + x + 4 using 2 mod 5 and 1 4 mod 5. iii) Multiplication in Z 2 [x]. The product of x + x + 1 and x 2 + x + 1 is x + x + 1 ) x 2 + x + 1 ) = x 5 + x 4 + x using 2 0 mod 2. + x + x 2 + x + x 2 + x + 1 = x 5 + x 4 + 1. Note that in Z [x], Q [x], R [x], C [x] or Z p [x], with p prime, we have deg fg = deg f + deg g. This may not hold in Z m [x] with m composite. Example In Z 6 [x] multiply f x) = 2x 2 + 1 and g x) = x 5 + 1 to get 2x 2 + 1 ) x 4 + 1 ) = 6x 6 + x 4 + 2x 2 + 1 = x 4 + 2x 2 + 1. Hence, in this example, deg fg < 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) = x 4 + 2x + 1 and g x) = 1 + x) 2 over Z. There are only three elements in Z and for these, f 0) = 1 = g 0), f 1) = 1 = g 1), f 2) = 0 = g 2). So as functions over Z 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 Z p, 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 Z p. Instead we have to remember that to divide by something is to multiply by it s inverse.) Aside: In Z 6 does [] 6 have an inverse? i.e. does there exist an element with [] 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 Z 6 has an inverse. The same argument works in general for Z m 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 x 2 x 1 into x 4 + 2x + x 2 + 4x + 5. Solution x 2 + x + 7 x 2 x 1 ) x 4 + 2x + x 2 + 4x + 5 x 4 + x + x 2 x + 4x 2 + 4x x + x 2 + x 7x 2 + 7x + 5 7x 2 + 7x + 7 14x + 12 Hence x 4 + 2x + x 2 + 4x + 5 = x 2 + x + 7) x 2 x 1) + 14x + 12). Always, always check by multiplying out. You should never end with an incorrect answer.
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 Z [x] x 2 + 2x + 1 x 2 + x + 1 ) x 4 + x 2 + 1 x 4 + x + x 2 2x + 1 2x + 2x 2 + 2x x 2 + x + 1 x 2 + x + 1 0 Often using 2 = 1, 1 = 2 modulo.) Hence x 4 + x 2 + 1 = x 2 + 2x + 1) x 2 + x + 1) and so x 2 + x + 1 divides x 4 + x 2 + 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) 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) 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) 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) = a m x m + a m 1 x m 1 +... + a 1 x + a 0, along with g x) = b n x n + b n 1 x n 1 +... + b 1 x + b 0. So m n, a m 0 and b n 0. Consider the polynomial r x) a m b 1 n x m n g x) = f x) q x) g x)) a m b 1 n x m n g x) = f x) q + a m b 1 n x m n) 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ǵ + r with either r 0 or deg r < deg g and either r 0 or deg r < deg g. Then qg + r = qǵ + 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 x 2 2 Q [x] yet it has no root is Q. Its roots are ± 2 R. Further x 2 + 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) = x 4 + x 2x 2 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 x 2x 4 ) x 4 + x 2x 2 6x 4 x 4 2x 2 4x x 2x 4 x 2x 4 0 x 4 + x 2x 2 6x 4 = x + 1) x 2x 4 ). Writing q x) = x 2x 4 we see that q 2) = 0 so x 2 divides q x). x 2 x 2 + 2x + 2 ) x 2x 4 x + 2x 2 + 2x 2x 2 4x 4 2x 2 4x 4 0 6
x 2x 4 = x 2) x 2 + 2x + 2 ). Does x 2 +2x+2 factorize over R? Note that x 2 +2x+2 = x + 1) 2 +1 1 and so can never be zero for real x. Thus x 2 + 2x + 2 has no linear factors. Hence we finish with x 4 + x 2x 2 6x 4 = x + 1) x 2) x 2 + 2x + 2 ). ii) Factorize p x) = x 4 + x + x 2 + x + 4 over Z 5. Solution We need only check x = 0, 1, 2, 2 or 4 1 mod 5. In turn, p 0) = 4, p 1) = 0, p 2) = 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) = x 2 + x 2) q x), i.e. x 2 + x 2 + x 2 ) x 4 + x + x 2 + x + 4 x 4 + x 2x 2 x 2 + x + 4 x 2 + x + 4 0 x 4 + x + x 2 + x + 4 = x 1) x + 2) x 2 + ). You should check that x 2 + 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 Z p, 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. argument as used for the gcd of integers. We do not use the same 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 = gq 1 + r 1, 0 < deg r 1 < deg g, g = r 1 q 2 + r 2, 0 < deg r 2 < deg r 1, r 1 = r 2 q + r, 0 < deg r < deg r 2,. r j 2 = r j 1 q j + r j, 0 < deg r j < deg r j 1, r j 1 = r j q j+1. 8
Then r j, 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) = 2x 5 + 6x 4 + 10x + x 2 14x 12 and g x) = 2x 4 + x + 4x 2 8x 8 and write the answer as a linear combination of f and g. Solution x + 2 2x 4 + x + 4x 2 8x 8 ) 2x 5 + 6x 4 + 10x + x 2 14x 12 2x 5 + x 4 + 4x 8x 2 8x x 4 + 6x + 9x 2 6x 12 x 4 + 9 2 x + 6x 2 12x 12 2 x + x 2 + 6x So f x) = x + ) g x) + r 1 x) 2 where r 1 x) = 2 x + x 2 + 6x. We need to now divide r 1 x) into g x). So 4 x 2 2 x + x 2 + 6x ) 2x 4 + x + 4x 2 8x 8 2x 4 + 4x + 8x 2 x 4x 2 8x 8 x 2x 2 4x 2x 2 4x 8 g x) = 4 x 2 ) r 1 x) + r 2 x) where r 2 x) = 2x 2 4x 8. We need to now divide r 2 x) into r 1 x). x 4 2x 2 4x 8 ) 2 x + x 2 + 6x 2 x + x 2 + 6x 0 So we have found a zero remainder. The greatest common divisor is the last non-zero remainder, r 2 x) = 2x 2 4x 8. 9
We can work back and write the gcd as a linear multiple of f and g. So 4 r 2 x) = g x) x 2 ) r 1 x) 4 = g x) x 2 ) f x) x + ) ) g x) 2 4 = 1 + x 2 ) x + )) 4 g x) 2 x 2 ) f x) ) ) 4x 2 + 4x 4x 2 = g x) f x). ii) Over Q [x] find a greatest common divisor of f x) = x 4 + x + 6x 2 + 6x + 4 and g x) = x 4 x 2 6x 2 and express your answer as a linear combination of the original polynomials. Solution Firstly x 4 + x + 6x 2 + 6x + 4 = 1 x 4 x 2 6x 2 ) + x + 9x 2 + 12x + 6. Next x 4 x 2 6x 2 = 1 x x + 9x 2 + 12x + 6 ) + x 7x 2 8x 2 ) ) 1 x = x 1 + 9x 2 + 12x + 6 ) + 2x 2 + 4x + 4. Then i.e x + 9x 2 + 12x + 6 = 2 x 2x 2 + 4x + 4 ) + x 2 + 6x + 6 = 2 x + ) 2x 2 + 4x + 4 ). 2 There is no remainder here, and so a gcd is the last non-zero remainder, gcd x 4 x 2 6x 2, x 4 + x + 6x 2 + 6x + 4 ) = 2x 2 + 4x + 4 and 2x 2 + 4x + 4 = x 4 x 2 6x 2 ) ) 1 x x 1 + 9x 2 + 12x + 6 ) ) 1 = g x) x 1 f x) g x)) ) 1 = x 1 f x) + 1 xg x). 10
Always, always check your answer.) ii) Over Z [x] find a greatest common divisor of x + 2x 2 + 2x + 1 and x 4 + 2 and express your answer as a linear combination of the original polynomials. Solution Firstly Next x 4 + 2 = x x + 2x 2 + 2x + 1 ) + x + x 2 + 2x + 2 = x + 1) x + 2x 2 + 2x + 1 ) + 2x 2 + 1. x + 2x 2 + 2x + 1 = 2x 2x 2 + 1 ) + 2x 2 + 1 = 2x + 1) 2x 2 + 1 ). So gcd x + 2x 2 + 2x + 1, x 4 + 2) = 2x 2 + 1. And, quite simply, 2x 2 + 1 = x 4 + 2 ) x + 1) x + 2x 2 + 2x + 1 ). 11