MATH2400 4,821 words·25 min read

Irreducible Polynomials

Irreducibles Are the Primes of a Polynomial Ring#

Recall from Polynomial Rings that a polynomial p(x)∈R[x]p(x) \in R[x] is irreducible if p(x)p(x) is neither the zero polynomial nor a unit, and whenever p(x)=f(x)g(x)p(x) = f(x)g(x) we are forced to have f(x)∈R[x]∗f(x) \in R[x]^* or g(x)∈R[x]∗g(x) \in R[x]^*. Over a field FF the units of F[x]F[x] are exactly the nonzero constants, so irreducibility says that the only factorisations available are the trivial ones where you peel a constant off the front.

Now compare that with the definition of a prime from Divisibility and Primes: an integer p>1p > 1 whose only divisors are ±1\pm 1 and ±p\pm p, i.e. an integer whose only factorisations are the ones where you peel a unit of Z\mathbb{Z} off the front. The two definitions are the same sentence with the ring swapped out, and this whole lecture is the payoff: essentially every result about primes has a polynomial twin.

in Z\mathbb{Z} in F[x]F[x]
units ±1\pm 1 units F∗F^*, the nonzero constants
primes irreducible polynomials
size ∣n∣\lvert n \rvert size deg⁡(f(x))\deg(f(x))
Division Theorem Division Theorem in F[x]F[x]
Euclidean algorithm, gcd⁡(a,b)\gcd(a,b) Euclidean algorithm, monic gcd⁡(f(x),g(x))\gcd(f(x),g(x))
Bézout's identity Bézout's identity in F[x]F[x]
Fundamental Theorem of Arithmetic unique factorisation into irreducibles (Theorem 7.6)
trial division by primes up to n\sqrt{n} trial division by irreducibles up to 12deg⁡(f(x))\tfrac{1}{2}\deg(f(x))

Basically, "irreducible" is just the word "prime" wearing a different hat, and the job for this lecture is the polynomial version of a primality test: given f(x)f(x), decide whether it factors. Everything we build below — degree bounds, root tests, reduction mod pp — is a translation of something we already did to integers.

There is one genuinely new wrinkle, and it is the thing students get wrong most often. An integer is prime or not, full stop; but a polynomial can be irreducible in one ring and split apart in a bigger one. For instance x2−2x^2 - 2 has no factorisation at all in Q[x]\mathbb{Q}[x], yet x2−2=(x−2)(x+2)x^2 - 2 = (x - \sqrt{2})(x + \sqrt{2}) in R[x]\mathbb{R}[x]. Irreducibility is never a property of a polynomial on its own; it is a property of the polynomial together with the ring its coefficients are allowed to live in, so always say "irreducible in Q[x]\mathbb{Q}[x]" and never just "irreducible".

Roots and the Factor Theorem#

The single most useful tool for spotting a factor is the observation that linear factors and roots are the same information. It falls straight out of the Division Theorem.

Note

Theorem 7.13 (Remainder Theorem)
For any ring RR, polynomial f(x)∈R[x]f(x) \in R[x], and a∈Ra \in R, the remainder when f(x)f(x) is divided by x−ax - a is f(a)f(a).

Proof. The divisor x−ax - a is monic, so its leading coefficient 11 is a unit of RR; hence the Division Theorem applies over any ring RR (this is the Fact from Polynomial Rings). It gives unique q(x),r(x)∈R[x]q(x), r(x) \in R[x] with

f(x)=q(x)(x−a)+r(x),deg⁡(r(x))<deg⁡(x−a)=1.f(x) = q(x)(x-a) + r(x), \qquad \deg(r(x)) < \deg(x-a) = 1.

A polynomial of degree less than 11 is either the zero polynomial or a constant, so r(x)=rr(x) = r for some fixed r∈Rr \in R. Now evaluate both sides at x=ax = a:

f(a)=q(a)(a−a)+r=q(a)⋅0+r=r.\begin{align*} f(a) &= q(a)(a-a) + r \\ &= q(a) \cdot 0 + r \\ &= r. \end{align*}

So the remainder is the constant f(a)f(a). ■\blacksquare

Basically, dividing by x−ax - a and substituting x=ax = a are two ways of doing the same computation; the (x−a)q(x)(x-a)q(x) part is annihilated by the substitution and only the remainder survives. Setting the remainder to zero immediately gives the result we actually use.

Note

Corollary 7.14 (Factor Theorem)
For any ring RR, polynomial f(x)∈R[x]f(x) \in R[x], and a∈Ra \in R, we have (x−a)∣f(x)(x-a) \mid f(x) if and only if f(a)=0f(a) = 0.
Proof. By definition (x−a)∣f(x)(x-a) \mid f(x) exactly when the remainder on division by x−ax-a is the zero polynomial, and by Theorem 7.13 that remainder is f(a)f(a). ■\blacksquare

Note

Definition 7.15
Given any ring RR and polynomial f(x)∈R[x]f(x) \in R[x], we say a∈Ra \in R is a root (or zero) of f(x)f(x) to mean f(a)=0f(a) = 0.

Example. Find the remainder when f(x)=x4+3x2−2x+5f(x) = x^4 + 3x^2 - 2x + 5 is divided by x−2x - 2 in Q[x]\mathbb{Q}[x], and decide whether x−2x-2 is a factor.
By the Remainder Theorem the remainder is just f(2)f(2);

f(2)=24+3(22)−2(2)+5=16+12−4+5=29.\begin{align*} f(2) &= 2^4 + 3(2^2) - 2(2) + 5 \\ &= 16 + 12 - 4 + 5 \\ &= 29. \end{align*}

Therefore the remainder is 2929, and since 29≠029 \neq 0 we have (x−2)∤f(x)(x-2) \nmid f(x). Notice how much cheaper this was than actually running the long division; whenever the divisor is linear, evaluate instead of dividing.

Example. Find all a∈Z5a \in \mathbb{Z}_5 such that (x−a)∣x3+x+1(x - a) \mid x^3 + x + 1 in Z5[x]\mathbb{Z}_5[x].
By the Factor Theorem this is asking for the roots of f(x)=x3+x+1f(x) = x^3 + x + 1 in Z5\mathbb{Z}_5, and since Z5\mathbb{Z}_5 is finite we can simply substitute every element:

f(0)=0+0+1=1,f(1)=1+1+1=3,f(2)=8+2+1=11=1,f(3)=27+3+1=31=1,f(4)=64+4+1=69=4 in Z5.\begin{align*} f(0) &= 0 + 0 + 1 = 1, \\ f(1) &= 1 + 1 + 1 = 3, \\ f(2) &= 8 + 2 + 1 = 11 = 1, \\ f(3) &= 27 + 3 + 1 = 31 = 1, \\ f(4) &= 64 + 4 + 1 = 69 = 4 \text{ in } \mathbb{Z}_5. \end{align*}

None of the five values is 00, so f(x)f(x) has no roots in Z5\mathbb{Z}_5. Therefore no linear polynomial x−ax - a divides x3+x+1x^3 + x + 1 in Z5[x]\mathbb{Z}_5[x]. This "just try everything" move is only available because the ring is finite, and it is the reason irreducibility questions over Zn\mathbb{Z}_n are so much easier than over Q\mathbb{Q}.

How Many Roots a Polynomial Can Have#

Over Z\mathbb{Z} a positive integer only has finitely many divisors, and the polynomial version of that bound is a statement about roots.

Note

Theorem 7.16
Any polynomial in R[x]R[x] of degree n>0n > 0 has at most nn roots.

Proof. We induct on nn, using the Factor Theorem at every step. Throughout we use the fact that RR has no zero divisors, i.e. that uv=0uv = 0 forces u=0u = 0 or v=0v = 0 (see the warning below).

Base case (n=1n = 1). Let f(x)=a1x+a0f(x) = a_1x + a_0 with a1≠0a_1 \neq 0, and suppose bb and cc are both roots. Then

a1b+a0=0=a1c+a0,a1b=a1c,a1(b−c)=0,\begin{align*} a_1b + a_0 &= 0 = a_1c + a_0, \\ a_1b &= a_1c, \\ a_1(b - c) &= 0, \end{align*}

and since a1≠0a_1 \neq 0 we must have b−c=0b - c = 0, i.e. b=cb = c. So a degree 11 polynomial has at most one root.

Inductive step. Suppose every polynomial of degree n−1n - 1 has at most n−1n-1 roots, and let deg⁡(f(x))=n\deg(f(x)) = n. If f(x)f(x) has no roots at all then it certainly has at most nn of them and we are done. Otherwise pick a root aa; by the Factor Theorem,

f(x)=(x−a)g(x)for some g(x)∈R[x],f(x) = (x - a)g(x) \quad \text{for some } g(x) \in R[x],

and comparing degrees gives deg⁡(g(x))=n−1\deg(g(x)) = n - 1. Now let bb be any root of f(x)f(x) with b≠ab \neq a. Then

0=f(b)=(b−a)g(b),\begin{align*} 0 &= f(b) \\ &= (b-a)g(b), \end{align*}

and b−a≠0b - a \neq 0, so we are forced into g(b)=0g(b) = 0. In other words every root of f(x)f(x) other than aa is a root of g(x)g(x), and by the inductive hypothesis there are at most n−1n-1 of those. Hence f(x)f(x) has at most 1+(n−1)=n1 + (n-1) = n roots. ■\blacksquare

Basically, each root you find lets you strip off one linear factor, and the degree only has nn layers to give away before it runs out.

The proof used "uv=0⇒u=0uv = 0 \Rightarrow u = 0 or v=0v = 0" twice, and that is exactly the axiom a general ring does not have. A ring with no zero divisors is called an integral domain; Z\mathbb{Z}, Q\mathbb{Q}, R\mathbb{R}, C\mathbb{C} and Zp\mathbb{Z}_p for prime pp are all integral domains, and those are the only rings this course ever applies Theorem 7.16 to. If you drop that assumption the theorem is flat out false. The standard counterexample is x2−1x^2 - 1 over Z8\mathbb{Z}_8:

12−1=0,32−1=8=0,52−1=24=0,72−1=48=0 in Z8,\begin{align*} 1^2 - 1 &= 0, \\ 3^2 - 1 &= 8 = 0, \\ 5^2 - 1 &= 24 = 0, \\ 7^2 - 1 &= 48 = 0 \text{ in } \mathbb{Z}_8, \end{align*}

so a degree 22 polynomial has four roots. There is no contradiction with the proof, because x2−1=(x−1)(x+1)x^2 - 1 = (x-1)(x+1) and at x=3x = 3 we get 2×4=8=02 \times 4 = 8 = 0 in Z8\mathbb{Z}_8 from two nonzero factors; the zero divisors let a product vanish without either bracket vanishing. So before quoting the at-most-nn-roots theorem, check that your ring has no zero divisors — in practice, that RR is a field, or Z\mathbb{Z}, or Zp\mathbb{Z}_p with pp prime. Recall from Modular Rings and Units that Zn\mathbb{Z}_n has zero divisors precisely when nn is composite, which is the whole reason we insist on prime moduli in this topic.

Irreducibles over C and R#

The complex numbers are the easiest case, because there is nowhere left for a root to hide.

Note

Theorem 7.17 (Fundamental Theorem of Algebra)
Every polynomial in C[x]\mathbb{C}[x] has at least one root.

The proof of this is well beyond the course (every proof of it smuggles in some analysis or topology somewhere), so we just quote it. Read the statement as being about non-constant polynomials; a nonzero constant polynomial obviously never takes the value 00.

Note

Corollary 7.18
Any polynomial f(x)∈C[x]f(x) \in \mathbb{C}[x] with deg⁡(f(x))=n\deg(f(x)) = n has exactly nn roots, counting multiplicity.

Proof (sketch). Induct on nn. For n=1n = 1, f(x)=a1x+a0f(x) = a_1x + a_0 has the single root −a0/a1-a_0/a_1. For the step, Theorem 7.17 hands us a root aa of f(x)f(x), and the Factor Theorem turns it into f(x)=(x−a)g(x)f(x) = (x-a)g(x) with deg⁡(g(x))=n−1\deg(g(x)) = n-1; by the inductive hypothesis g(x)g(x) has exactly n−1n-1 roots with multiplicity, and C\mathbb{C} has no zero divisors so the roots of f(x)f(x) are exactly aa together with the roots of g(x)g(x). That is nn altogether. ■\blacksquare

Basically, over C\mathbb{C} the process of stripping off linear factors never gets stuck; it keeps going until the degree is exhausted, so every complex polynomial splits completely into linear pieces.

Note

Theorem 7.19
A polynomial f(x)∈C[x]f(x) \in \mathbb{C}[x] is irreducible if and only if f(x)f(x) is linear (that is, deg⁡(f(x))=1\deg(f(x)) = 1).

Proof. (⇐\Leftarrow) Suppose deg⁡(f(x))=1\deg(f(x)) = 1 and f(x)=g(x)h(x)f(x) = g(x)h(x). Degrees add over a field, so deg⁡(g(x))+deg⁡(h(x))=1\deg(g(x)) + \deg(h(x)) = 1 and one of the two factors has degree 00, i.e. is a nonzero constant. Since C[x]∗=C∗\mathbb{C}[x]^* = \mathbb{C}^*, that factor is a unit; so f(x)f(x) is irreducible.
(⇒\Rightarrow) Suppose f(x)f(x) is irreducible, so f(x)f(x) is not a unit and hence deg⁡(f(x))≥1\deg(f(x)) \geq 1. If deg⁡(f(x))=n≥2\deg(f(x)) = n \geq 2, then by Theorem 7.17 there is a root a∈Ca \in \mathbb{C}, and by the Factor Theorem

f(x)=(x−a)g(x),deg⁡(g(x))=n−1≥1.f(x) = (x-a)g(x), \qquad \deg(g(x)) = n - 1 \geq 1.

Neither factor is a constant, so neither is a unit, contradicting irreducibility. Hence n=1n = 1. ■\blacksquare

Over R\mathbb{R} the story is only slightly longer, because a real polynomial can have complex roots — but those always come in conjugate pairs, and multiplying a pair back together lands you in the reals again.

Note

Theorem 7.20
Every irreducible polynomial f(x)∈R[x]f(x) \in \mathbb{R}[x] is either linear or quadratic (that is, deg⁡(f(x))∈{1,2}\deg(f(x)) \in \{1,2\}).

Proof. Suppose deg⁡(f(x))=n≥3\deg(f(x)) = n \geq 3; we show f(x)f(x) is reducible in R[x]\mathbb{R}[x]. Regard f(x)f(x) as an element of C[x]\mathbb{C}[x]; by Theorem 7.17 it has a root z∈Cz \in \mathbb{C}.

Case 1: z∈Rz \in \mathbb{R}. Then the Factor Theorem applies inside R[x]\mathbb{R}[x] and gives f(x)=(x−z)g(x)f(x) = (x - z)g(x) with g(x)∈R[x]g(x) \in \mathbb{R}[x] and deg⁡(g(x))=n−1≥2\deg(g(x)) = n - 1 \geq 2. Neither factor is a constant, so f(x)f(x) is reducible.

Case 2: z∉Rz \notin \mathbb{R}. Write z=α+βiz = \alpha + \beta i with α,β∈R\alpha, \beta \in \mathbb{R} and β≠0\beta \neq 0. Writing f(x)=∑k=0nakxkf(x) = \sum_{k=0}^n a_kx^k with every ak∈Ra_k \in \mathbb{R}, and using the fact that conjugation respects sums and products while fixing every real number,

f(zˉ)=∑k=0nakzˉ k=∑k=0nak‾ zk‾(since ak‾=ak as ak∈R)=∑k=0nakzk‾=f(z)‾=0ˉ=0,\begin{align*} f(\bar{z}) &= \sum_{k=0}^n a_k \bar{z}^{\,k} \\ &= \sum_{k=0}^n \overline{a_k} \, \overline{z^k} \quad (\text{since } \overline{a_k} = a_k \text{ as } a_k \in \mathbb{R}) \\ &= \overline{\sum_{k=0}^n a_k z^k} \\ &= \overline{f(z)} \\ &= \bar{0} = 0, \end{align*}

so zˉ=α−βi\bar{z} = \alpha - \beta i is also a root, and zˉ≠z\bar{z} \neq z because β≠0\beta \neq 0. Hence (x−z)(x - z) and (x−zˉ)(x - \bar{z}) are two distinct linear factors of f(x)f(x) in C[x]\mathbb{C}[x], so their product divides f(x)f(x). But that product is

(x−z)(x−zˉ)=x2−(z+zˉ)x+zzˉ=x2−2αx+(α2+β2),\begin{align*} (x - z)(x - \bar{z}) &= x^2 - (z + \bar{z})x + z\bar{z} \\ &= x^2 - 2\alpha x + (\alpha^2 + \beta^2), \end{align*}

which has real coefficients. Call it d(x)d(x). Dividing f(x)f(x) by the monic real polynomial d(x)d(x) inside R[x]\mathbb{R}[x] gives f(x)=q(x)d(x)+r(x)f(x) = q(x)d(x) + r(x) with q(x),r(x)∈R[x]q(x), r(x) \in \mathbb{R}[x] and deg⁡(r(x))<2\deg(r(x)) < 2; and since the Division Theorem in C[x]\mathbb{C}[x] has a unique answer, which we already know has remainder 00, we get r(x)=0r(x) = 0. Hence

f(x)=d(x)q(x),q(x)∈R[x],deg⁡(q(x))=n−2≥1,f(x) = d(x)q(x), \qquad q(x) \in \mathbb{R}[x], \quad \deg(q(x)) = n - 2 \geq 1,

and again f(x)f(x) is reducible. Either way n≥3n \geq 3 makes f(x)f(x) reducible, so an irreducible real polynomial has degree 11 or 22. ■\blacksquare

Basically, real irreducible quadratics are exactly the ones with a conjugate pair of complex roots — the ones with negative discriminant. So the complete factorisation of a real polynomial is a product of linear factors (one per real root) and irreducible quadratics (one per conjugate pair).

Factoring the Same Polynomial in Different Rings#

The best way to feel how much the ambient ring matters is to factor one polynomial three times.

Example. Write x4−4x^4 - 4 as a product of irreducible polynomials in (a) Q[x]\mathbb{Q}[x], (b) R[x]\mathbb{R}[x], (c) C[x]\mathbb{C}[x].
Every case starts from the difference of two squares, x4−4=(x2)2−22x^4 - 4 = (x^2)^2 - 2^2:

x4−4=(x2−2)(x2+2).\begin{align*} x^4 - 4 &= (x^2 - 2)(x^2 + 2). \end{align*}

(a) In Q[x]\mathbb{Q}[x] we claim both brackets are already irreducible. Each has degree 22, so a nontrivial factorisation would have to be (linear)(linear), and by the Factor Theorem a linear factor x−ax - a exists exactly when there is a rational root. Testing the only candidates allowed by the rational root theorem (Theorem 7.25 below), namely p∣2p \mid 2 and q∣1q \mid 1 so x∈{±1,±2}x \in \{\pm 1, \pm 2\}:

(±1)2−2=−1,(±2)2−2=2,(±1)2+2=3,(±2)2+2=6,\begin{align*} (\pm1)^2 - 2 &= -1, & (\pm 2)^2 - 2 &= 2, \\ (\pm1)^2 + 2 &= 3, & (\pm 2)^2 + 2 &= 6, \end{align*}

none of which is 00. Therefore, in Q[x]\mathbb{Q}[x],

x4−4=(x2−2)(x2+2).x^4 - 4 = (x^2 - 2)(x^2 + 2).

(b) In R[x]\mathbb{R}[x] the number 2\sqrt{2} is now available, so x2−2x^2 - 2 splits; but x2+2≥2>0x^2 + 2 \geq 2 > 0 for every real xx, so it has no real roots and (being quadratic) stays irreducible. Therefore

x4−4=(x−2)(x+2)(x2+2).x^4 - 4 = (x - \sqrt{2})(x + \sqrt{2})(x^2 + 2).

(c) In C[x]\mathbb{C}[x] Theorem 7.19 tells us in advance that the answer must be a product of four linear factors, and x2+2=x2−(i2)2x^2 + 2 = x^2 - (i\sqrt{2})^2 finishes the job. Therefore

x4−4=(x−2)(x+2)(x−i2)(x+i2).x^4 - 4 = (x - \sqrt{2})(x + \sqrt{2})(x - i\sqrt{2})(x + i\sqrt{2}).

Notice how each step is the previous factorisation with one more irreducible cracked open; enlarging the ring can only ever break factors further apart, never glue them back together.

Example. Show that x2+1x^2 + 1 is irreducible in Z3[x]\mathbb{Z}_3[x].
The degree is 22, so the only possible nontrivial factorisation is into two linear factors, and by the Factor Theorem that happens if and only if f(x)=x2+1f(x) = x^2+1 has a root in Z3\mathbb{Z}_3. Since Z3={0,1,2}\mathbb{Z}_3 = \{0,1,2\} is finite we just check all three:

f(0)=0+1=1,f(1)=1+1=2,f(2)=4+1=5=2 in Z3.\begin{align*} f(0) &= 0 + 1 = 1, \\ f(1) &= 1 + 1 = 2, \\ f(2) &= 4 + 1 = 5 = 2 \text{ in } \mathbb{Z}_3. \end{align*}

None of these is 00, so x2+1x^2 + 1 has no roots in Z3\mathbb{Z}_3 and hence no linear factors. Therefore x2+1x^2+1 is irreducible in Z3[x]\mathbb{Z}_3[x]. (Contrast this with Z5[x]\mathbb{Z}_5[x], where 22+1=5=02^2 + 1 = 5 = 0, so x2+1=(x−2)(x+2)=(x+3)(x+2)x^2 + 1 = (x-2)(x+2) = (x+3)(x+2) splits; same polynomial, different ring, opposite answer.)

"No roots" only proves irreducibility for degrees 22 and 33. For those degrees any nontrivial factorisation is forced to include a linear factor, which is the same as a root; but from degree 44 upwards a polynomial can factor into two quadratics without ever taking the value 00. The cleanest counterexample is the square of the polynomial we just did, over the same ring:

(x2+1)2=x4+2x2+1,\begin{align*} (x^2+1)^2 &= x^4 + 2x^2 + 1, \end{align*}

whose values at x=0,1,2x = 0, 1, 2 in Z3\mathbb{Z}_3 are

0+0+1=1,1+2+1=4=1,16+8+1=25=1 in Z3,\begin{align*} 0 + 0 + 1 &= 1, \\ 1 + 2 + 1 &= 4 = 1, \\ 16 + 8 + 1 &= 25 = 1 \text{ in } \mathbb{Z}_3, \end{align*}

so x4+2x2+1x^4 + 2x^2 + 1 has no roots in Z3\mathbb{Z}_3 at all, and yet it is visibly reducible. Never conclude "no roots, therefore irreducible" without first checking that the degree is 22 or 33.

Example. Write x4−4x^4 - 4 as a product of irreducible polynomials in Z3[x]\mathbb{Z}_3[x].
First reduce the coefficients: −4=−4+6=2-4 = -4 + 6 = 2 in Z3\mathbb{Z}_3, so we are factoring x4+2x^4 + 2. The difference-of-squares split from before still works, and we may as well reuse it:

x4−4=(x2−2)(x2+2)=(x2+1)(x2−1)(since −2=1 and 2=−1 in Z3)=(x2+1)(x−1)(x+1)=(x+1)(x+2)(x2+1)(since −1=2 in Z3).\begin{align*} x^4 - 4 &= (x^2-2)(x^2+2) \\ &= (x^2+1)(x^2-1) \quad (\text{since } -2 = 1 \text{ and } 2 = -1 \text{ in } \mathbb{Z}_3) \\ &= (x^2+1)(x-1)(x+1) \\ &= (x+1)(x+2)(x^2+1) \quad (\text{since } -1 = 2 \text{ in } \mathbb{Z}_3). \end{align*}

The two linear factors are irreducible automatically, and we showed just above that x2+1x^2+1 is irreducible in Z3[x]\mathbb{Z}_3[x]. Therefore

x4−4=(x+1)(x+2)(x2+1) in Z3[x].x^4 - 4 = (x+1)(x+2)(x^2+1) \text{ in } \mathbb{Z}_3[x].

As a check, expanding gives x4+3x3+3x2+3x+2x^4 + 3x^3 + 3x^2 + 3x + 2, and reducing mod 33 leaves x4+2=x4−4x^4 + 2 = x^4 - 4 as required. Notice how the factorisation over Q\mathbb{Q} survived the reduction: x2−2x^2 - 2 became the irreducible x2+1x^2+1, while x2+2x^2+2 (irreducible over Q\mathbb{Q}) cracked into (x−1)(x+1)(x-1)(x+1). Reducing mod pp can break factors that were solid over Q\mathbb{Q}, which is a hint of both the power and the danger of the mod pp tests later on.

Irreducibles over Q and Z#

Deciding irreducibility over Q\mathbb{Q} looks nastier than over Zp\mathbb{Z}_p, because Q\mathbb{Q} is infinite and you cannot just try everything. The saving grace is that fractions never help you factor.

Note

Theorem 7.21
A polynomial f(x)f(x) with integer coefficients that altogether have a GCD of 11 is irreducible in Q[x]\mathbb{Q}[x] if and only if it is irreducible in Z[x]\mathbb{Z}[x].

Proof (sketch). One direction is easy: a factorisation in Z[x]\mathbb{Z}[x] into two non-constant pieces is also a factorisation in Q[x]\mathbb{Q}[x]. The content is the other direction, and it is due to a result called Gauss's lemma, which states that any f(x)∈Z[x]f(x) \in \mathbb{Z}[x] whose coefficients have a GCD of 11 can only be written as a product of polynomials which themselves have coefficients with a GCD of 11. Given a factorisation over Q\mathbb{Q}, clear all the denominators to get a factorisation over Z\mathbb{Z} scaled by some integer; Gauss's lemma says the scaling factor has nowhere to hide and must be ±1\pm 1, so the Z\mathbb{Z}-factorisation was there all along. ■\blacksquare

A polynomial in Z[x]\mathbb{Z}[x] whose coefficients have GCD 11 is called primitive, and the assumption matters. If we allow a common factor then Z\mathbb{Z}-irreducibility and Q\mathbb{Q}-irreducibility genuinely disagree: 2x2+2=2(x2+1)2x^2 + 2 = 2(x^2+1) is reducible in Z[x]\mathbb{Z}[x] (because 22 is not a unit of Z\mathbb{Z}) while it is irreducible in Q[x]\mathbb{Q}[x] (because 22 is a unit of Q\mathbb{Q}). From here to the end of the note, every f(x)∈Z[x]f(x) \in \mathbb{Z}[x] is assumed primitive; if yours is not, divide out the GCD of the coefficients first and test what is left.

Note

Corollary 7.22
A polynomial f(x)∈Q[x]f(x) \in \mathbb{Q}[x] is irreducible if and only if mf(x)mf(x) is irreducible in Z[x]\mathbb{Z}[x], where mm is the lowest common multiple of the denominators of the coefficients of f(x)f(x).

Basically, this is the polynomial version of clearing denominators in an equation. Multiplying by the constant mm changes nothing about which factorisations exist over Q\mathbb{Q} (constants are units there), but it drags the whole problem into Z[x]\mathbb{Z}[x] where integer-flavoured tools like divisibility and reduction mod pp become available. So the working method for any Q[x]\mathbb{Q}[x] question is always:

  • multiply through by the LCM mm of the denominators;
  • divide out the GCD of the resulting integer coefficients, so that the polynomial is primitive;
  • test the resulting integer polynomial with the tests below;
  • report the answer back in Q[x]\mathbb{Q}[x], unchanged.

Example. Show that f(x)=12x3+25x2−x+34f(x) = \dfrac{1}{2}x^3 + \dfrac{2}{5}x^2 - x + \dfrac{3}{4} is irreducible in Q[x]\mathbb{Q}[x].
The denominators are 2,5,12, 5, 1 and 44, whose lowest common multiple is m=20m = 20. By Corollary 7.22 it suffices to test

20f(x)=20⋅12x3+20⋅25x2−20x+20⋅34=10x3+8x2−20x+15,\begin{align*} 20f(x) &= 20 \cdot \tfrac{1}{2}x^3 + 20\cdot\tfrac{2}{5}x^2 - 20x + 20\cdot\tfrac{3}{4} \\ &= 10x^3 + 8x^2 - 20x + 15, \end{align*}

and since gcd⁡(10,8,20,15)=1\gcd(10, 8, 20, 15) = 1 this is primitive, so by Theorem 7.21 irreducibility in Z[x]\mathbb{Z}[x] and in Q[x]\mathbb{Q}[x] are the same question. The degree is 33, so any nontrivial factorisation must contain a linear factor ax+bax + b, which contributes the rational root −b/a-b/a; so it is enough to show there are no rational roots.

By the rational root theorem (Theorem 7.25 below), every rational root is pq\frac{p}{q} in simplest form with p∣15p \mid 15 and q∣10q \mid 10; that is

p∈{±1,±3,±5,±15},q∈{1,2,5,10},p \in \{\pm1, \pm3, \pm5, \pm15\}, \qquad q \in \{1, 2, 5, 10\},

which after discarding pairs with gcd⁡(p,q)≠1\gcd(p,q) \neq 1 leaves 2424 candidates. Grinding through all 2424 is possible but miserable, so we filter them first. Multiplying f(p/q)=0f(p/q) = 0 through by q3q^3 turns it into a Diophantine equation:

10p3+8p2q−20pq2+15q3=0.10p^3 + 8p^2q - 20pq^2 + 15q^3 = 0.

Reducing that equation mod 22 kills the first three terms and leaves

15q3≡0(mod2),q3≡0(mod2),\begin{align*} 15q^3 &\equiv 0 \pmod 2, \\ q^3 &\equiv 0 \pmod 2, \end{align*}

so qq must be even, i.e. q∈{2,10}q \in \{2, 10\}. Reducing the same equation mod 55 kills the first, third and fourth terms and leaves

8p2q≡0(mod5),3p2q≡0(mod5),\begin{align*} 8p^2q &\equiv 0 \pmod 5, \\ 3p^2q &\equiv 0 \pmod 5, \end{align*}

so 5∣p2q5 \mid p^2q, and since 55 is prime this means 5∣p5 \mid p or 5∣q5 \mid q. Combining: if q=2q = 2 then 5∤q5 \nmid q, so we need 5∣p5 \mid p, giving p∈{±5,±15}p \in \{\pm5, \pm15\}; if q=10q = 10 then 5∣q5 \mid q already, but gcd⁡(p,10)=1\gcd(p, 10) = 1 forces p∈{±1,±3}p \in \{\pm1, \pm3\}. Only eight candidates survive, and we test them in the integer form N(p,q)=10p3+8p2q−20pq2+15q3N(p,q) = 10p^3 + 8p^2q - 20pq^2 + 15q^3:

p/qp/q N(p,q)N(p,q) p/qp/q N(p,q)N(p,q)
110\tfrac{1}{10} 1309013090 −110-\tfrac{1}{10} 1707017070
310\tfrac{3}{10} 99909990 −310-\tfrac{3}{10} 2145021450
52\tfrac{5}{2} 13701370 −52-\tfrac{5}{2} −330-330
152\tfrac{15}{2} 3627036270 −152-\tfrac{15}{2} −28830-28830

For instance the p=−5p = -5, q=2q = 2 entry unpacks as

N(−5,2)=10(−125)+8(25)(2)−20(−5)(4)+15(8)=−1250+400+400+120=−330≠0.\begin{align*} N(-5,2) &= 10(-125) + 8(25)(2) - 20(-5)(4) + 15(8) \\ &= -1250 + 400 + 400 + 120 \\ &= -330 \neq 0. \end{align*}

Not one of the eight gives 00, so 10x3+8x2−20x+1510x^3 + 8x^2 - 20x + 15 has no rational roots, hence no linear factor, hence (being cubic) no nontrivial factorisation at all. Therefore f(x)f(x) is irreducible in Q[x]\mathbb{Q}[x]. Notice how two one-line congruences threw away two thirds of the candidate list before we did any real arithmetic; when the rational root theorem hands you a long candidate list, reduce the Diophantine relation modulo the small primes dividing a0a_0 and ana_n first.

Testing by the Degrees of the Factors#

When we test an integer nn for primality we only trial-divide up to n\sqrt{n}, because in any factorisation n=abn = ab the smaller factor is at most n\sqrt{n}. Degrees add where integer sizes multiply, so the polynomial version replaces n\sqrt{\phantom{n}} with "half".

Note

Theorem 7.23
If f(x)∈R[x]f(x) \in R[x] is not irreducible, then f(x)f(x) has a factor g(x)∈R[x]g(x) \in R[x] with 1≤deg⁡(g(x))≤12deg⁡(f(x))1 \leq \deg(g(x)) \leq \tfrac{1}{2}\deg(f(x)).

Proof. Let deg⁡(f(x))=n>0\deg(f(x)) = n > 0 and suppose f(x)f(x) is not irreducible, so we can write f(x)=g(x)h(x)f(x) = g(x)h(x) where neither g(x)g(x) nor h(x)h(x) is a unit. Over a field the units are exactly the nonzero constants, so deg⁡(g(x))≥1\deg(g(x)) \geq 1 and deg⁡(h(x))≥1\deg(h(x)) \geq 1; and since degrees add,

deg⁡(g(x))+deg⁡(h(x))=n.\deg(g(x)) + \deg(h(x)) = n.

Relabel if necessary so that deg⁡(g(x))≤deg⁡(h(x))\deg(g(x)) \leq \deg(h(x)). Then

2deg⁡(g(x))≤deg⁡(g(x))+deg⁡(h(x))=n,deg⁡(g(x))≤12n,\begin{align*} 2\deg(g(x)) &\leq \deg(g(x)) + \deg(h(x)) \\ &= n, \\ \deg(g(x)) &\leq \tfrac{1}{2}n, \end{align*}

and deg⁡(g(x))≥1\deg(g(x)) \geq 1 as noted. ■\blacksquare

Note

Corollary 7.24
To test if f(x)∈R[x]f(x) \in R[x] is irreducible where deg⁡(f(x))=n>1\deg(f(x)) = n > 1, we only have to confirm that g(x)∤f(x)g(x) \nmid f(x) for all irreducible monic g(x)∈R[x]g(x) \in R[x] with 1≤deg⁡(g(x))≤n21 \leq \deg(g(x)) \leq \tfrac{n}{2}.

We can restrict to irreducible g(x)g(x) because any factor in that degree range itself has an irreducible factor of no larger degree (by unique factorisation, Theorem 7.6), and that irreducible one divides f(x)f(x) too; and we can restrict to monic g(x)g(x) because multiplying a factor by a unit does not change what it divides. When RR is finite — for example R=ZnR = \mathbb{Z}_n — there are only finitely many monic polynomials of each degree, so this is a genuinely finite test that a computer (or a patient student) can just run.

This corollary is also where the degree 22 and 33 rule finally gets its proper justification: if n∈{2,3}n \in \{2,3\} then n2<2\tfrac{n}{2} < 2, so the only candidate divisors are the monic linear ones x−ax - a, and (x−a)∣f(x)(x-a) \mid f(x) exactly when aa is a root. Hence

for deg⁡(f(x))∈{2,3} over a field: f(x) is irreducible  ⟺  f(x) has no roots.\boxed{\text{for } \deg(f(x)) \in \{2,3\} \text{ over a field: } f(x) \text{ is irreducible} \iff f(x) \text{ has no roots.}}

For n=4n = 4 or 55 you additionally have to try every monic irreducible quadratic, for n=6n = 6 or 77 every monic irreducible cubic as well, and so on.

Example. Show that f(x)=x3+x2+x+2f(x) = x^3 + x^2 + x + 2 is irreducible in Z3[x]\mathbb{Z}_3[x].
Here n=3n = 3, so n2=1.5\tfrac{n}{2} = 1.5 and the finite test only asks about monic linear divisors x−ax - a with a∈Z3a \in \mathbb{Z}_3; equivalently, about roots. Substituting each of the three elements of Z3\mathbb{Z}_3:

f(0)=0+0+0+2=2,f(1)=1+1+1+2=5=2,f(2)=8+4+2+2=16=1 in Z3.\begin{align*} f(0) &= 0 + 0 + 0 + 2 = 2, \\ f(1) &= 1 + 1 + 1 + 2 = 5 = 2, \\ f(2) &= 8 + 4 + 2 + 2 = 16 = 1 \text{ in } \mathbb{Z}_3. \end{align*}

None of the values is 00, so f(x)f(x) has no roots in Z3\mathbb{Z}_3 and therefore no linear factor. Therefore x3+x2+x+2x^3 + x^2 + x + 2 is irreducible in Z3[x]\mathbb{Z}_3[x]. Note that we were entitled to stop after checking roots only because the degree is 33; had the degree been 44 we would also have had to divide by each of the monic irreducible quadratics x2+1x^2+1, x2+x+2x^2+x+2 and x2+2x+2x^2+2x+2.

The Rational Root Theorem#

Over Zp\mathbb{Z}_p we can hunt for roots by brute force. Over Q\mathbb{Q} there are infinitely many candidates, so we need a theorem that cuts the search down to a finite list — and it is the same divisibility argument you would use on any Diophantine equation.

Note

Theorem 7.25 (Rational root theorem)
Suppose that f(x)=∑i=0naixi∈Z[x]f(x) = \sum_{i=0}^{n} a_ix^i \in \mathbb{Z}[x] is a polynomial with an≠0a_n \neq 0 and a0≠0a_0 \neq 0. Then in Q[x]\mathbb{Q}[x], each rational root of f(x)f(x) can be written as a fraction pq\frac{p}{q} in simplest form (that is, with p∈Zp \in \mathbb{Z}, q∈Z+q \in \mathbb{Z}^+ and gcd⁡(p,q)=1\gcd(p,q) = 1) where p∣a0p \mid a_0 and q∣anq \mid a_n.

Proof. Let pq\frac{p}{q} be a rational root in simplest form, so f ⁣(pq)=0f\!\left(\frac{p}{q}\right) = 0 and gcd⁡(p,q)=1\gcd(p,q) = 1. Multiplying through by qnq^n clears every denominator:

∑i=0naipiqi=0,∑i=0naipiq n−i=0,anpn+an−1pn−1q+⋯+a1pq n−1+a0qn=0,\begin{align*} \sum_{i=0}^{n} a_i \frac{p^i}{q^i} &= 0, \\ \sum_{i=0}^{n} a_i p^i q^{\,n-i} &= 0, \\ a_np^n + a_{n-1}p^{n-1}q + \cdots + a_1pq^{\,n-1} + a_0q^n &= 0, \end{align*}

which is now an equation between integers. Isolating the last term,

a0qn=−p(anpn−1+an−1pn−2q+⋯+a1q n−1),\begin{align*} a_0q^n &= -p\left(a_np^{n-1} + a_{n-1}p^{n-2}q + \cdots + a_1q^{\,n-1}\right), \end{align*}

so p∣a0qnp \mid a_0q^n. Since gcd⁡(p,q)=1\gcd(p,q) = 1 we also have gcd⁡(p,qn)=1\gcd(p, q^n) = 1, so pp shares no factor with qnq^n and therefore p∣a0p \mid a_0. Symmetrically, isolating the first term,

anpn=−q(an−1pn−1+an−2pn−2q+⋯+a0q n−1),\begin{align*} a_np^n &= -q\left(a_{n-1}p^{n-1} + a_{n-2}p^{n-2}q + \cdots + a_0q^{\,n-1}\right), \end{align*}

so q∣anpnq \mid a_np^n, and gcd⁡(q,pn)=1\gcd(q, p^n) = 1 forces q∣anq \mid a_n. ■\blacksquare

Basically, the denominator of a rational root can only be built out of the leading coefficient and the numerator only out of the constant term; everything in the middle is irrelevant. The hypothesis a0≠0a_0 \neq 0 matters — if the constant term is 00 then xx is a factor and x=0x = 0 is a root, which the theorem would otherwise miss (every integer divides 00, so the candidate list would be infinite). Factor out the largest power of xx first. A very common special case worth remembering separately:

if f(x) is monic, then q∣1, so every rational root is an integer dividing a0.\boxed{\text{if } f(x) \text{ is monic, then } q \mid 1, \text{ so every rational root is an integer dividing } a_0.}

Example. Show that f(x)=x3+x2+x+2f(x) = x^3 + x^2 + x + 2 is irreducible in Q[x]\mathbb{Q}[x].
The coefficients are integers with gcd⁡(1,1,1,2)=1\gcd(1,1,1,2) = 1, so f(x)f(x) is primitive and by Theorem 7.21 we may work in Z[x]\mathbb{Z}[x]. The degree is 33, so f(x)f(x) is reducible if and only if it has a rational root. By the rational root theorem with a0=2a_0 = 2 and an=1a_n = 1 we need p∣2p \mid 2 and q∣1q \mid 1, so q=1q = 1 and the only candidates are the integers ±1,±2\pm1, \pm2:

f(1)=1+1+1+2=5,f(−1)=−1+1−1+2=1,f(2)=8+4+2+2=16,f(−2)=−8+4−2+2=−4.\begin{align*} f(1) &= 1 + 1 + 1 + 2 = 5, \\ f(-1) &= -1 + 1 - 1 + 2 = 1, \\ f(2) &= 8 + 4 + 2 + 2 = 16, \\ f(-2) &= -8 + 4 - 2 + 2 = -4. \end{align*}

None of these is 00, so f(x)f(x) has no rational roots and hence no linear factor. Therefore x3+x2+x+2x^3 + x^2 + x + 2 is irreducible in Q[x]\mathbb{Q}[x] (and, being primitive, in Z[x]\mathbb{Z}[x]). Notice that we have now proved this same polynomial irreducible over both Z3\mathbb{Z}_3 and Q\mathbb{Q}; the next section explains why the first of those facts was already enough on its own.

Reducing Modulo a Prime#

Checking four candidate roots was fine, but for larger coefficients the candidate list explodes. The fix is the same one we used all through Polynomial Congruences: push the problem into Zn\mathbb{Z}_n, where there are only finitely many things to try.

Note

Theorem 7.26
If a polynomial f(x)∈Z[x]f(x) \in \mathbb{Z}[x] has no roots in Zn\mathbb{Z}_n for some positive integer nn, then it has no roots in Z\mathbb{Z}.

Proof. We prove the contrapositive. Suppose f(x)=∑i=0naixif(x) = \sum_{i=0}^{n} a_ix^i has an integer root bb, so f(b)=0f(b) = 0. Reduction mod nn respects both addition and multiplication (this is exactly the point of Modular Arithmetic), so writing cˉ\bar{c} for the class of cc in Zn\mathbb{Z}_n,

fˉ(bˉ)=∑i=0nai‾ bˉ i=∑i=0naibi‾=f(b)‾=0ˉ.\begin{align*} \bar{f}(\bar{b}) &= \sum_{i=0}^{n}\overline{a_i}\,\bar{b}^{\,i} \\ &= \overline{\sum_{i=0}^{n}a_ib^i} \\ &= \overline{f(b)} \\ &= \bar{0}. \end{align*}

So bˉ\bar{b} is a root of the reduced polynomial in Zn\mathbb{Z}_n. Hence if there is no root in Zn\mathbb{Z}_n, there can be no root in Z\mathbb{Z}. ■\blacksquare

Basically, a root survives reduction; so if the shadow has no roots, neither does the original. The same idea upgrades from roots to whole factorisations, provided the leading coefficient survives.

Note

Theorem 7.27
Suppose f(x)∈Z[x]f(x) \in \mathbb{Z}[x], and that pp is any prime number such that pp does not divide the leading coefficient of f(x)f(x). If f(x)f(x) is irreducible in Zp[x]\mathbb{Z}_p[x], then f(x)f(x) is also irreducible in Z[x]\mathbb{Z}[x].

Proof. Again we prove the contrapositive: if f(x)f(x) is reducible in Z[x]\mathbb{Z}[x] then it is reducible in Zp[x]\mathbb{Z}_p[x]. Suppose f(x)=g(x)h(x)f(x) = g(x)h(x) with g(x),h(x)∈Z[x]g(x), h(x) \in \mathbb{Z}[x], neither a unit of Z[x]\mathbb{Z}[x]. Since f(x)f(x) is primitive, neither factor can be a constant (a constant factor cc would divide every coefficient of f(x)f(x), forcing c=±1c = \pm1), so deg⁡(g(x))≥1\deg(g(x)) \geq 1 and deg⁡(h(x))≥1\deg(h(x)) \geq 1.

Let ana_n be the leading coefficient of f(x)f(x), and b,cb, c the leading coefficients of g(x),h(x)g(x), h(x); then an=bca_n = bc. Since p∤anp \nmid a_n and pp is prime, p∤bp \nmid b and p∤cp \nmid c, so neither leading coefficient dies when we reduce mod pp:

deg⁡(gˉ(x))=deg⁡(g(x))≥1,deg⁡(hˉ(x))=deg⁡(h(x))≥1.\deg(\bar{g}(x)) = \deg(g(x)) \geq 1, \qquad \deg(\bar{h}(x)) = \deg(h(x)) \geq 1.

Reduction respects multiplication, so fˉ(x)=gˉ(x)hˉ(x)\bar{f}(x) = \bar{g}(x)\bar{h}(x); and since the units of Zp[x]\mathbb{Z}_p[x] are just the nonzero constants, neither gˉ(x)\bar{g}(x) nor hˉ(x)\bar{h}(x) is a unit. Hence fˉ(x)\bar{f}(x) is reducible in Zp[x]\mathbb{Z}_p[x]. ■\blacksquare

The condition p∤anp \nmid a_n is not decoration. If pp kills the leading coefficient then the degree collapses on reduction and the argument breaks: for example 3x2+x3x^2 + x reduces mod 33 to the linear polynomial xx, which is irreducible in Z3[x]\mathbb{Z}_3[x], yet 3x2+x=x(3x+1)3x^2 + x = x(3x+1) is obviously reducible in Z[x]\mathbb{Z}[x].

The converse of Theorem 7.27 is false, and this is the trap. A polynomial can be perfectly irreducible over Z\mathbb{Z} and still factor modulo some prime; we saw exactly this above, where x2+1x^2 + 1 is irreducible in Z[x]\mathbb{Z}[x] but x2+1=(x+2)(x+3)x^2 + 1 = (x+2)(x+3) in Z5[x]\mathbb{Z}_5[x]. So a reduction that factors proves absolutely nothing — you have learned only that this particular prime was a bad choice, and you must go and try another one. A reduction that is irreducible is the only outcome that settles the question.

Example. Show that f(x)=3x3+4x2+6x−5f(x) = 3x^3 + 4x^2 + 6x - 5 is irreducible in Z[x]\mathbb{Z}[x].
The coefficients have GCD 11, so f(x)f(x) is primitive, and the leading coefficient is a3=3a_3 = 3. Straight away p=3p = 3 is off the table, since 3∣a33 \mid a_3. We work through the remaining small primes.

Try p=2p = 2. Reducing coefficients mod 22 gives 3≡13 \equiv 1, 4≡04 \equiv 0, 6≡06 \equiv 0, −5≡1-5 \equiv 1, so

fˉ(x)=x3+1 in Z2[x].\bar{f}(x) = x^3 + 1 \text{ in } \mathbb{Z}_2[x].

But fˉ(1)=1+1=0\bar{f}(1) = 1 + 1 = 0, so x+1x + 1 is a factor; in fact x3+1=(x+1)(x2+x+1)x^3 + 1 = (x+1)(x^2+x+1) in Z2[x]\mathbb{Z}_2[x]. The reduction is reducible, so this prime tells us nothing.

Try p=5p = 5. Here 3≡33 \equiv 3, 4≡44 \equiv 4, 6≡16 \equiv 1, −5≡0-5 \equiv 0, so

fˉ(x)=3x3+4x2+x=x(3x2+4x+1) in Z5[x].\bar{f}(x) = 3x^3 + 4x^2 + x = x(3x^2 + 4x + 1) \text{ in } \mathbb{Z}_5[x].

The leading coefficient did survive (5∤35 \nmid 3), but the constant term vanished and handed us the root x=0x = 0. Reducible again; still nothing learned.

Try p=7p = 7. Now 3≡33 \equiv 3, 4≡44 \equiv 4, 6≡66 \equiv 6 and −5≡2-5 \equiv 2, so

fˉ(x)=3x3+4x2+6x+2 in Z7[x],\bar{f}(x) = 3x^3 + 4x^2 + 6x + 2 \text{ in } \mathbb{Z}_7[x],

and 7∤37 \nmid 3 so the degree is still 33. Being cubic, it is irreducible exactly when it has no roots, and Z7\mathbb{Z}_7 is small enough to check exhaustively. Building the table from the powers of xx first keeps the numbers tiny:

aa 00 11 22 33 44 55 66
a2a^2 00 11 44 22 22 44 11
a3a^3 00 11 11 66 11 66 66
fˉ(a)=3a3+4a2+6a+2\bar{f}(a) = 3a^3 + 4a^2 + 6a + 2 22 11 55 44 22 33 44

For instance the a=3a = 3 column is 3(6)+4(2)+6(3)+2=18+8+18+2=46=43(6) + 4(2) + 6(3) + 2 = 18 + 8 + 18 + 2 = 46 = 4 in Z7\mathbb{Z}_7. No entry in the bottom row is 00, so fˉ(x)\bar{f}(x) has no roots in Z7\mathbb{Z}_7 and is therefore irreducible in Z7[x]\mathbb{Z}_7[x]. Since 7∤37 \nmid 3, Theorem 7.27 applies. Therefore 3x3+4x2+6x−53x^3 + 4x^2 + 6x - 5 is irreducible in Z[x]\mathbb{Z}[x], and by Theorem 7.21 also in Q[x]\mathbb{Q}[x].

It is worth dwelling on the fact that we needed three attempts. There is no way to know in advance which prime will work, so treat "reducible mod pp" as no information at all and just move on to the next prime; only "irreducible mod pp" ever concludes the argument. As a rule of thumb, take the primes in increasing order, skipping any that divide the leading coefficient, and stop the moment one of them gives an irreducible reduction. (For this particular f(x)f(x) the rational root theorem would also have worked — the candidates are ±1,±5,±13,±53\pm1, \pm5, \pm\tfrac{1}{3}, \pm\tfrac{5}{3} and none is a root — but that is eight evaluations with awkward fractions against seven tiny ones mod 77.)

Eisenstein's Criterion#

Sometimes you can read irreducibility straight off the coefficients without testing anything. The pattern to look for is "one prime divides everything except the leading coefficient, and only just divides the constant term".

Note

Theorem 7.28 (Eisenstein's criterion)
Suppose that f(x)=∑i=0naixi∈Z[x]f(x) = \sum_{i=0}^{n}a_ix^i \in \mathbb{Z}[x] and that for some prime number pp,

  • p∣aip \mid a_i for all 0≤i≤n−10 \leq i \leq n-1,
  • p∤anp \nmid a_n, and
  • p2∤a0p^2 \nmid a_0.

Then f(x)f(x) is irreducible in Z[x]\mathbb{Z}[x].

Proof. Suppose for contradiction that f(x)f(x) is reducible. As f(x)f(x) is primitive, no constant factor is possible, so we can write

f(x)=g(x)h(x),g(x)=∑i=0rbixi,h(x)=∑j=0scjxj,f(x) = g(x)h(x), \qquad g(x) = \sum_{i=0}^{r}b_ix^i, \quad h(x) = \sum_{j=0}^{s}c_jx^j,

with r,s≥1r, s \geq 1 and r+s=nr + s = n. Comparing constant terms gives a0=b0c0a_0 = b_0c_0. Now p∣a0p \mid a_0 but p2∤a0p^2 \nmid a_0, so pp divides exactly one of b0,c0b_0, c_0; relabelling if necessary, say

p∣b0andp∤c0.p \mid b_0 \quad \text{and} \quad p \nmid c_0.

Comparing leading coefficients gives an=brcsa_n = b_rc_s, and p∤anp \nmid a_n, so in particular p∤brp \nmid b_r. Therefore the list b0,b1,…,brb_0, b_1, \dots, b_r starts with a multiple of pp and ends with a non-multiple; let kk be the smallest index with p∤bkp \nmid b_k. Then 1≤k≤r1 \leq k \leq r, and since s≥1s \geq 1 we get k≤r=n−s≤n−1k \leq r = n - s \leq n-1.

Now compare the coefficients of xkx^k on both sides (using the convention bi=0b_i = 0 for i>ri > r and cj=0c_j = 0 for j>sj > s):

ak=bkc0+bk−1c1+bk−2c2+⋯+b0ck.\begin{align*} a_k &= b_kc_0 + b_{k-1}c_1 + b_{k-2}c_2 + \cdots + b_0c_k. \end{align*}

Since k≤n−1k \leq n-1, the hypothesis gives p∣akp \mid a_k. Every term after the first involves some bib_i with i<ki < k, and by minimality of kk every such bib_i is divisible by pp; so pp divides the entire tail. Subtracting, p∣bkc0p \mid b_kc_0. But pp is prime and p∤bkp \nmid b_k and p∤c0p \nmid c_0, so p∤bkc0p \nmid b_kc_0 — a contradiction. Therefore no such factorisation exists and f(x)f(x) is irreducible. ■\blacksquare

Basically, Eisenstein works by watching where the single prime pp can go. It has to divide the constant term of one factor but not the other, and then it runs out of room as you climb the coefficients. All three conditions are needed: drop p2∤a0p^2 \nmid a_0 and the criterion collapses, since x2+4x+4=(x+2)2x^2 + 4x + 4 = (x+2)^2 passes the first two conditions with p=2p = 2.

Example. Show that f(x)=x3+2x2+6x+10f(x) = x^3 + 2x^2 + 6x + 10 is irreducible in Z[x]\mathbb{Z}[x].
Try p=2p = 2 and check the three conditions against a0=10a_0 = 10, a1=6a_1 = 6, a2=2a_2 = 2, a3=1a_3 = 1:

2∣10,2∣6,2∣2(so p∣ai for 0≤i≤2),2∤1(so p∤a3),4∤10(since 10=4(2)+2).\begin{align*} 2 \mid 10, \quad 2 \mid 6, \quad 2 \mid 2 &\quad (\text{so } p \mid a_i \text{ for } 0 \leq i \leq 2), \\ 2 \nmid 1 &\quad (\text{so } p \nmid a_3), \\ 4 \nmid 10 &\quad (\text{since } 10 = 4(2) + 2). \end{align*}

All three hold, so by Eisenstein's criterion f(x)f(x) is irreducible in Z[x]\mathbb{Z}[x], and hence also in Q[x]\mathbb{Q}[x]. Notice how little work that was compared with the mod pp hunt of the last section; whenever you meet a polynomial whose non-leading coefficients share a prime factor, try Eisenstein before anything else.

Shifting the Variable#

Eisenstein is fast but fragile; a polynomial can fail it outright and still be irreducible. The rescue is that irreducibility does not notice a horizontal shift, so if f(x)f(x) is not in Eisenstein shape you may be able to move it into shape.

Note

Theorem 7.29
For any a∈Za \in \mathbb{Z}, the polynomial f(x)∈Z[x]f(x) \in \mathbb{Z}[x] is irreducible if and only if the polynomial f(x+a)f(x+a) is irreducible.

Proof. Substituting x↦x+ax \mapsto x + a is a map Z[x]→Z[x]\mathbb{Z}[x] \to \mathbb{Z}[x] that respects sums and products, since evaluating a sum or product at x+ax + a is the same as summing or multiplying the evaluations:

(gh)(x+a)=g(x+a) h(x+a).(gh)(x+a) = g(x+a)\,h(x+a).

It also preserves degree (the leading term anxna_nx^n becomes an(x+a)na_n(x+a)^n, whose only xnx^n term is anxna_nx^n), and it is undone by the substitution x↦x−ax \mapsto x - a.

(⇒\Rightarrow, contrapositive) Suppose f(x+a)f(x+a) is reducible, say f(x+a)=g(x)h(x)f(x+a) = g(x)h(x) with deg⁡(g(x)),deg⁡(h(x))≥1\deg(g(x)), \deg(h(x)) \geq 1. Substituting x↦x−ax \mapsto x - a into both sides gives

f(x)=g(x−a) h(x−a),f(x) = g(x-a)\,h(x-a),

and both factors still have degree at least 11, so f(x)f(x) is reducible.
(⇐\Leftarrow) Identical, running the substitution the other way: if f(x)=g(x)h(x)f(x) = g(x)h(x) nontrivially then f(x+a)=g(x+a)h(x+a)f(x+a) = g(x+a)h(x+a) nontrivially. ■\blacksquare

Basically, sliding the graph left or right cannot create or destroy a factorisation; it just relabels one. But the shift does change the coefficients completely, and that is the whole point — Eisenstein looks at coefficients, so a shift can turn an untestable polynomial into a testable one. The usual trick is to try a=±1a = \pm1 first, then a=±2a = \pm2.

Example. Show that f(x)=x3−x2+5x+5f(x) = x^3 - x^2 + 5x + 5 is irreducible in Z[x]\mathbb{Z}[x].
Eisenstein fails as written: the only prime dividing a0=5a_0 = 5 is p=5p = 5, but 5∤a1=55 \nmid a_1 = 5 is false — no wait, 5∣55 \mid 5 is fine — the failure is at a2=−1a_2 = -1, since 5∤−15 \nmid -1. So no prime works directly. Instead substitute x↦x+1x \mapsto x+1 and expand:

f(x+1)=(x+1)3−(x+1)2+5(x+1)+5=(x3+3x2+3x+1)−(x2+2x+1)+5x+5+5=x3+(3−1)x2+(3−2+5)x+(1−1+10)=x3+2x2+6x+10.\begin{align*} f(x+1) &= (x+1)^3 - (x+1)^2 + 5(x+1) + 5 \\ &= (x^3 + 3x^2 + 3x + 1) - (x^2 + 2x + 1) + 5x + 5 + 5 \\ &= x^3 + (3-1)x^2 + (3 - 2 + 5)x + (1 - 1 + 10) \\ &= x^3 + 2x^2 + 6x + 10. \end{align*}

That is exactly the polynomial from the previous section, which Eisenstein at p=2p = 2 showed to be irreducible. Therefore by Theorem 7.29, f(x)=x3−x2+5x+5f(x) = x^3 - x^2 + 5x + 5 is irreducible in Z[x]\mathbb{Z}[x] as well, and hence in Q[x]\mathbb{Q}[x].

As a sanity check on the expansion, compare constant terms: f(0+1)=f(1)=1−1+5+5=10f(0+1) = f(1) = 1 - 1 + 5 + 5 = 10, which matches the constant term of x3+2x2+6x+10x^3 + 2x^2 + 6x + 10. Checking f(a)f(a) against the constant term of f(x+a)f(x+a) catches almost every algebra slip in these expansions, and they are easy slips to make.

Which Test Do I Reach For#

There are now six or seven tools in the box and they are not interchangeable, so here is the order to run down when a polynomial f(x)f(x) is put in front of you. As always, the first question is which ring you are in.

  • Is it over Q[x]\mathbb{Q}[x]? Multiply by the LCM mm of the denominators and divide out the GCD of the resulting coefficients (Corollary 7.22); you are now over Z[x]\mathbb{Z}[x] with a primitive polynomial, and Theorem 7.21 says the answer is the same.
  • Is the degree 00 or 11? Degree 00 is a unit or zero, so never irreducible; degree 11 over a field is always irreducible. Done.
  • Is the degree 22 or 33? Then irreducible   ⟺  \iff no roots. Over Zn\mathbb{Z}_n substitute all nn elements; over Z\mathbb{Z} or Q\mathbb{Q} use the rational root theorem to get a finite candidate list, shrinking it first with congruences mod the small primes if the list is long.
  • Is the degree ≥4\geq 4? No roots is no longer enough. Either run the finite test against every monic irreducible of degree up to 12deg⁡(f(x))\tfrac{1}{2}\deg(f(x)) (realistic only over a small Zp\mathbb{Z}_p), or find a smarter argument below.
  • Do the non-leading coefficients share a prime factor pp, with p∤anp \nmid a_n and p2∤a0p^2 \nmid a_0? Use Eisenstein; it is instant and works in any degree.
  • Almost Eisenstein but not quite? Substitute x↦x+ax \mapsto x + a for small aa and look again (Theorem 7.29). Try a=±1a = \pm1 first.
  • Nothing else working, over Z[x]\mathbb{Z}[x]? Reduce mod a prime pp not dividing the leading coefficient and test there (Theorem 7.27). Small primes first; if the reduction factors, you have learned nothing, so try the next prime.
  • Over C[x]\mathbb{C}[x] or R[x]\mathbb{R}[x]? Don't test anything: the answer is already known. In C[x]\mathbb{C}[x] the irreducibles are exactly the linear polynomials (Theorem 7.19), and in R[x]\mathbb{R}[x] exactly the linear polynomials together with the quadratics of negative discriminant (Theorem 7.20).

And the two things most likely to cost you marks, one more time: irreducibility always depends on the ring, so name the ring in every answer; and "no roots" only settles the question in degrees 22 and 33.