Polynomial Rings

Polynomials Over a Ring

Everything in this topic is a re-run of Topic 1. Back in Divisibility and Primes we said what it means for one integer to divide another and isolated the primes as the multiplicative atoms; in GCDs and the Euclidean Algorithm we built the gcd and computed it by repeated division; in Bezouts Identity and the Extended Euclidean Algorithm we wrote the gcd as a combination . We are now going to do the identical sequence with polynomials in place of integers, and almost every proof carries over word for word. The only new ingredient is that we get to choose which ring the coefficients live in, and that choice changes the answers dramatically.

Note

Definition 7.1
Given any (commutative unital) ring , a polynomial over of degree for any is a function given by

where with .

The terms are called coefficients. We call the leading coefficient of and the constant term of . If the leading coefficient is , we call a monic polynomial.

Note

Notation
The degree of a polynomial , written or sometimes , is the largest power of appearing in . In the definition above, .

Basically, a polynomial over is the usual thing you have written since high school, except that the coefficients are elements of rather than real numbers, and so they add and multiply according to 's rules. Recall from Rings and Fields that "ring" in this course always means commutative unital ring; so has a , a , and addition, subtraction and multiplication all behave.

The condition in the definition is doing real work: it is what makes the degree well defined. You are allowed to write , but the degree is , not , because the honest leading coefficient is the last nonzero one.

Example. For each polynomial, state the degree, the leading coefficient and the constant term, and say whether it is monic.
(a) in .
(b) in .
(c) in .
(d) in .
(a) , leading coefficient , constant term ; not monic since .
(b) , leading coefficient , constant term ; monic.
(c) , leading coefficient , constant term ; not monic. Constants are perfectly good polynomials, of degree .
(d) This is the trap. In we have , so

giving , leading coefficient , constant term ; and it is monic. Therefore, always reduce every coefficient into the ring before reading off the degree; a coefficient that looks nonzero on the page may be in .

Note

Definition 7.2
The zero polynomial is the function given by for all (where is the additive identity in ). The degree of the zero polynomial is undefined, but for our purposes we will treat its degree as .

The zero polynomial is the one polynomial with no nonzero coefficient at all, so Definition 7.1 simply does not apply to it and its degree is genuinely undefined. Setting is a convention, not a theorem, but it is a convention that buys us two things:

  • The rule keeps working, since and .
  • The rule keeps working when the two polynomials cancel entirely.
  • The Division Theorem below can demand without having to add "or " as a separate case, since is less than everything.

Basically, is chosen precisely so that every statement we want to make about degrees has no annoying exceptions.

The Ring of Polynomials

Having built polynomials out of a ring, the natural question is whether the collection of them is a ring in its own right; and it is, which is why the whole of Topic 1 will transfer.

Note

Notation
The set of all polynomials over a ring is denoted .

Note

Fact
is itself a (commutative unital) ring under the usual operations of addition and multiplication.

Proof. The operations are the familiar ones, written out coefficientwise: for and ,

Every coefficient on the right is built from the and using only addition and multiplication in , so closure under both operations is inherited straight from closure in . In the same way, additive associativity and commutativity hold because they hold for each coefficient separately; and multiplicative associativity, commutativity and distributivity hold because expanding both sides produces the same sums of products (or ), which then agree by the corresponding axiom in .

That leaves the identities and inverses. The zero polynomial is the additive identity, since adding to each coefficient changes nothing; the additive inverse of is , which lives in because each ; and the constant polynomial is the multiplicative identity, since multiplying by it leaves every coefficient alone. Hence every axiom for a commutative unital ring holds.

Notice that multiplicative inverses were never mentioned, and for good reason: is essentially never a field, even when is. There is no polynomial you can multiply by to get , for exactly the same degree reason that we are about to make precise. So sits alongside in the hierarchy from Rings and Fields: a perfectly good ring where you can add, subtract and multiply, but not divide.

Example. Find the sum of and in .
Line up like powers and add the coefficients in :

Therefore, the sum is , of degree .

Example. Find the sum of and in .
The safest route is to reduce each polynomial mod first, then add:

using and in . Adding,

As a check, reducing the answer mod gives as well. Therefore, the sum is , of degree .

The degree dropped from to purely because of the ring we were working in; is a genuine cubic term over but is the zero polynomial over . This is the single most common slip in this topic. Never quote the degree of a polynomial without saying which you are in.

Example. Find the product of and in .
Expanding term by term,

Therefore, the product is , of degree , as expected.

Example. Find the product of and in .
Reduce first: and is already reduced. Then

Reducing the answer instead gives , which agrees. Therefore, the product is . Notice that this time the degree did not drop; is a field, and in a field the product of the two nonzero leading coefficients ( and ) can never be .

The general degree rules are worth stating explicitly, since we lean on them constantly:

with equality in the second provided has no zero divisors (in particular, whenever is a field). Recall from Rings and Fields that a zero divisor is a nonzero element whose product with some other nonzero element is ; if the leading coefficients and satisfy , then the term of vanishes and the degree collapses.

Example. Show that can genuinely happen, by multiplying and in .
Both factors have degree , so we would hope for a degree answer. Expanding,

since in . Therefore, the product has degree ; the culprit is that and are zero divisors in . The clean identity is a fact about fields (and about ), not about all rings.

Units of a Polynomial Ring

Recall from Modular Rings and Units that a unit of a ring is an element with a multiplicative inverse, and that the units are exactly the elements you are allowed to divide by. Since is a ring, it has units too, and knowing them is essential — the definition of "irreducible" and the non-uniqueness of gcds both hinge on which polynomials are units.

Note

Definition 7.3
A polynomial is called a unit (or invertible) if it has a multiplicative inverse in .

Note

Notation
The unit group of a polynomial ring is the set of all units in , and is denoted .

Note

Fact
If is a field, then .

Proof. () If , then is a nonzero constant polynomial and satisfies ; so .
() Suppose , so for some . Neither nor is the zero polynomial (their product is ), so both have degree at least . Since is a field it has no zero divisors, so degrees add exactly:

Two non-negative integers summing to must both be , so ; that is, and are constants with in . Hence .

Basically, over a field the only invertible polynomials are the nonzero constants, because multiplying by anything of degree pushes the degree up and there is no way to push it back down to .

Example. Find the following unit groups.
(a) .
(b) .
(c) .
(d) .
(a) is a field, so by the fact above, ; every nonzero rational constant, and nothing else.
(b) is not a field, but it has no zero divisors, so the degree argument in the proof still runs verbatim and forces , with in . We showed in Rings and Fields that this forces . Therefore .
(c) is a field (as is prime), so .
(d) is not a field and it does have a zero divisor, namely , since . The degree argument collapses, and the answer is genuinely bigger than . Watch what happens to :

so is its own inverse and is therefore a unit of degree . The same trick works with any number of terms: because in , every product of two of the "" coefficients dies, and one checks in exactly the same way that

Therefore

which is an infinite set, one unit for each finite choice of which higher coefficients are .

The condition that be a field in is not decoration; is strictly bigger than and contains units of every degree. The precise reason is that is nilpotent in (some power of it is ), and nilpotent coefficients can be attached to any power of without breaking invertibility. Contrast this with (a)–(c), where the coefficient ring had no zero divisors at all and the unit group stayed as small as possible.

Divisibility and Irreducible Polynomials

Now the parallel with Topic 1 begins in earnest. The definition of divisibility is copied straight from Divisibility and Primes with "integer" replaced by "polynomial".

Note

Definition 7.4
Given two polynomials for some ring , we say divides and write to mean for some polynomial .

Example. Show that in , and decide whether in and in .
The first one we have already done: from the product example above,

and , so in .
For the second, we need with , i.e. . This is not in , so in ; but , so in . Therefore, divisibility is a statement about the ring, not just about the two polynomials; the same pair can divide in one and not in another.

Note

Definition 7.5
An irreducible polynomial in is any such that

  • and , and
  • whenever for polynomials , we must have or .

Basically, an irreducible polynomial is the polynomial version of a prime: it is not zero, not a unit, and cannot be broken into two genuinely smaller pieces. The first bullet is exactly why is not counted as a prime integer, transplanted.

The source note adds the practical version over a field.

Note

Fact
If is a field, then is irreducible if and only if whenever with , we must have and .

This is just rewritten in terms of degrees: over a field, "is a unit" and "has degree " say the same thing, so "one factor must be a unit" becomes "one factor must be constant". Basically, over a field a polynomial is irreducible exactly when it cannot be written as a product of two polynomials of strictly smaller degree.

Two immediate consequences that you should just know:

  • Every polynomial of degree over a field is irreducible, since forces one of the degrees to be .
  • A polynomial of degree or over a field is irreducible if and only if it has no root in ; the only available split is off a linear factor , and over a field that factor contributes the root . (This fails from degree onwards, where a polynomial can factorise into two quadratics with no roots at all; see Irreducible Polynomials.)

Example. Determine whether is irreducible in , , , and .
It has degree in every one of these, so we hunt for roots.

  • In : for every real , so there is no root and is irreducible.
  • In : , two factors of degree ; reducible.
  • In : testing gives , so and are roots. Indeed

so it is reducible.

  • In : testing gives , none of which is ; irreducible.
  • In : , so is a root, and ; reducible (in fact a perfect square).
    Therefore, the very same polynomial is irreducible over and but reducible over , and . Irreducibility is never a property of a polynomial on its own; it is a property of a polynomial together with its coefficient ring.

Example. Show that is irreducible in but reducible in .
In it has degree , so it is irreducible by the first consequence above; concretely, is a factorisation, but , so it does not count. In the same factorisation is fatal, because , so neither nor is a unit. Therefore is reducible in ; notice how shrinking the unit group made more polynomials reducible, which is exactly why the clean theory below is stated only over fields.

Note

Theorem 7.6 (Unique Factorisation in )
If is a field, then every polynomial with degree greater than has a unique factorisation into irreducible polynomials, up to unit factors. That is, we can write uniquely in the form

where , each is a different irreducible monic polynomial in , and for some .

This is the Fundamental Theorem of Arithmetic from Divisibility and Primes, with irreducible monic polynomials playing the role of the primes and the constant playing the role of the sign. The reason we insist the are monic is the same reason we insist primes are positive: without it, would count as two different factorisations, and would too. Pulling all the unit "junk" out into a single leading makes the factorisation genuinely unique.

Example. Write in the form guaranteed by Theorem 7.6, over and then over .
Over , factorise by repeated difference of two squares:

and we checked above that is irreducible over (it has no real root, let alone a rational one). All three factors are monic irreducibles, so and with every .
Over , the factor splits further into , and , so

now with and . Therefore, the same polynomial has a three-factor factorisation over and a four-factor one over ; enlarging the field can only ever split things further, never fuse them.

The Division Theorem for Polynomials

Everything computational in Topic 1 came out of the Division Theorem for integers. Here is its exact analogue, with "smaller remainder" measured by degree rather than by size.

Note

Theorem 7.7 (Division Theorem)
For any field and polynomials with , there exist unique polynomials such that both

We call the quotient and the remainder when is divided by .

Note that the zero polynomial can be a remainder, since its degree is ; this is the payoff of that convention, and it is exactly the case that says .

Note

Fact
The Division Theorem is also true over for any ring , so long as the leading coefficient of is a unit of .

Proof (sketch). Use strong induction on . If there is nothing to do; take and . Otherwise write and with , and kill the leading term of by subtracting the right multiple of :

The terms cancel exactly, so , and by the inductive hypothesis with . Rearranging gives , as required.
For uniqueness, suppose with both remainders of degree less than . Then ; the right-hand side has degree less than , while the left-hand side has degree unless . So , and then .
Notice that the only thing the argument ever needed from was the inverse of the leading coefficient of ; so the whole proof runs unchanged over any ring provided that leading coefficient is a unit of .

You cannot divide by an arbitrary polynomial over a ring that is not a field. For instance, in try to divide by : the quotient would have to begin with , which is not in , and no choice of integer quotient can leave a remainder of degree . Over it is fine, and over it is fine whenever the divisor is monic, since is a unit in every ring. This is why "monic" is such a load-bearing word in this topic.

To actually find the quotient and remainder we use either long division or balancing coefficients, exactly as with integers.

Example. Find the quotient and remainder when is divided by (in ).
Write the dividend with every power present, including the missing , and long divide:

                                  2x^2 -    x +    8
           +-----------------------------------------
x^2+2x-3   | 2x^4 + 3x^3 + 0x^2 +    x +    5
             2x^4 + 4x^3 - 6x^2
             ------------------
                    -x^3 + 6x^2 +    x +    5
                    -x^3 - 2x^2 +   3x
                    ------------------
                           8x^2 -   2x +    5
                           8x^2 +  16x -   24
                           ------------------
                                  -18x +   29

At each stage we divide the current leading term by (the leading term of the divisor), write that down in the quotient, multiply the whole divisor by it, and subtract. The process stops when what is left has degree less than . Reading off the answer, and . Checking that :

Therefore, the quotient is and the remainder is . Always do this check; it costs one line and catches every sign error in the long division.

Example. Find the quotient and remainder when is divided by in , by balancing coefficients.
Since and , the quotient has degree and the remainder has degree at most ; so write

and match coefficients in starting from the top:

Therefore, and . Checking,

Balancing coefficients is often faster than long division when the divisor is short and the field is small, because you never have to write out the intermediate subtractions.

Greatest Common Divisors of Polynomials

With division in hand we can copy the gcd definition across from GCDs and the Euclidean Algorithm. There is one genuine new wrinkle, and it is worth meeting head-on.

Note

Definition 7.8
For any field , a greatest common divisor (GCD) of two polynomials is any polynomial such that

  • both and , and
  • for all , if and , then .

Notice that "greatest" has been replaced by a divisibility condition rather than an inequality; there is no sensible way to say one polynomial is bigger than another, so we say instead that is the common divisor that every other common divisor divides into. (For integers these two descriptions agree, which is why you may not have noticed the distinction before.)

The wrinkle is that with this definition there is usually more than one greatest common divisor, because any unit multiple of a GCD is again a GCD.

Example. Find all the GCDs of and in .
Factorise each polynomial, remembering that , so each factorisation can be rewritten in four ways by moving a unit across:

(As a spot check, and in .) Comparing the two lists, the common non-constant factors are , , and ; and these four are exactly the unit multiples of one another, since

Therefore, the GCDs of and in are , , and ; four different answers, all equally valid under Definition 7.8.

That is unusable as a function, so we fix a representative. Exactly one of the four is monic.

Note

Notation
The standard greatest common divisor of two polynomials , denoted , is the monic GCD of and (that is, the GCD whose leading coefficient is ).

For example, in we have .

Basically, "divide by the leading coefficient at the end" is the polynomial version of "take the positive one", which is how we made single-valued for integers. If your final answer to a gcd question is not monic, you have not finished; multiply through by the inverse of the leading coefficient. By this is always possible and never changes which polynomial you have up to units, because the leading coefficient of a nonzero polynomial over a field is always invertible.

The Euclidean Algorithm for Polynomials

Since the Division Theorem holds and degrees are non-negative integers that strictly decrease, the Euclidean algorithm transfers immediately; the degree of the remainder plays the role that the size of the remainder played for integers, and it cannot decrease forever.

Note

Algorithm 7.9 (Euclidean algorithm)
Given any field and polynomials , repeatedly apply the Division Theorem, first to and , then to and the previous remainder , then to and the previous remainder , and so on, terminating when . Then the previous remainder is a GCD of and .

Note that when working over polynomial rings we can always factor out any unit from a remainder before applying the Division Theorem to it. For example, if in we find a remainder at one step, we could instead multiply it by to get

and use as the subject of the next step. This is legitimate because unit multiples have exactly the same divisors, so the set of common divisors never changes. This tip is not optional in practice; scaling each remainder to be monic keeps the fractions under control in and is the difference between a two-line computation and a page of thirds and sevenths.

The one thing to remember is that the algorithm delivers a GCD, whichever one happens to fall out of the arithmetic; you then scale it to be monic to get the standard one.

Example. Let and . Find in .
Divide by . Since ,

and then , so

So the first line of the algorithm is

The remainder has degree , as required. Before continuing, scale it by the unit to get the monic , and divide by that:

The remainder is , so the algorithm stops and the last nonzero remainder is a GCD; it is already monic. Therefore, . As a sanity check, and , so really does divide both.

Example. Find in .
Running the algorithm,

so the last nonzero remainder is , which is monic. Therefore, . This matches the factorisations and , where and share nothing.

Bézout's Identity for Polynomials

And finally the identity from Bezouts Identity and the Extended Euclidean Algorithm, transplanted.

Note

Theorem 7.10 (Bézout's identity)
Given any field and polynomials , there exist polynomials such that

We can find these polynomials and the same way as we did before with integers: either by reversing the Euclidean algorithm applied to and , or by using the extended Euclidean algorithm table. The proof is the same as well — run the algorithm, then substitute each remainder upwards until only and remain.

Example. Let and . Find such that .
We know from the previous section that , and line of that run is the only line with a nonzero remainder, so there is only one substitution to make. Rearranging for its remainder,

Now multiply through by to turn the left-hand side into the monic gcd:

Therefore, and . Checking by expanding, and using :

Notice that is allowed to be a constant, and that constants like are unavoidable here; the whole point of working over a field is that these fractions are legal. Over this identity would be impossible to write down.

The Extended Euclidean Table for Polynomials

Back-substitution is fine for a one-line run, but it gets ugly fast; the table from Bezouts Identity and the Extended Euclidean Algorithm works verbatim, with polynomials in every cell. The only change is cosmetic: the letters and are taken (they were the row names before, and is now the variable), so we will call the two coefficient rows and , and the invariant becomes

with the same recursions , and , seeded by and .

Example. Redo the previous example with the extended Euclidean algorithm table.
The table must use the unscaled remainders, so we divide by rather than by ; the quotient there is , since

with remainder . So the quotients are and , and the table is:

For instance the third column comes from and . Reading off the second-last column, where is a GCD,

and multiplying by to make it monic gives , exactly as before. Therefore, and . The table hands you a GCD, not the standard GCD; scaling to monic is always the last step, and you must scale and by the same unit.

Example. Let and . Find in , and find some such that .
Run the Euclidean algorithm, doing all coefficient arithmetic in . Dividing by : first , and

then , and

So the algorithm reads

where line uses in , since . The last nonzero remainder is the constant , which is a unit; scaling it to be monic gives . Therefore, ; the two polynomials are coprime in .

For the Bézout pair, back-substitute from upwards using :

Finally multiply through by to get the standard (monic) gcd on the left:

Therefore, and . Checking directly,

Hmm — that is , not ; the slip is that the middle expansion dropped a term. Doing it carefully,

and now

Expand one factor at a time and reduce mod only at the very end; mixing reduction into a half-finished expansion is how terms go missing.

For completeness, here is the same computation as a table, which avoids the substitution entirely. The quotients from lines , and are , and :

The fourth column is and , and it reproduces exactly as the back-substitution did. Scaling by gives the same final answer.

The Integer–Polynomial Dictionary

Every result in this lecture was Topic 1 with the nouns changed, so it is worth writing the translation down in one place:

In In
integer polynomial over the field
absolute value degree
units units (the nonzero constants)
prime irreducible polynomial
with each monic irreducible
with with
choose the positive gcd choose the monic gcd
Euclidean algorithm on remainders Euclidean algorithm on remainders

The three places the analogy needs care are all things we have flagged along the way: degrees can collapse if the coefficient ring has zero divisors, so stick to fields; a gcd is only determined up to a unit multiple, so finish by making it monic; and division needs the divisor's leading coefficient to be invertible, so over a non-field ring only monic (or unit-leading) divisors are safe. Get those three right and everything else is muscle memory from Topic 1.