# Polynomial with a root modulo every prime but not in $\mathbb{Q}$. [duplicate]

I recently came across the following fact from this list of counterexamples:

There are no polynomials of degree $< 5$ that have a root modulo every prime but no root in $\mathbb{Q}$.

Furthermore, one such example is given: $(x^2+31)(x^3+x+1)$ but I have not been able to prove that this does has that property above. How can such polynomials be generated and can we identify a family of them?

## marked as duplicate by Grigory M, Davide Giraudo, Avitus, Ali Caglayan, Mark FantiniDec 31 '14 at 11:32

• Do you know Galois theory of finite fields? If $p$ is an odd prime and $f(x)$ is a monic irreducible of degree $3$ in $\mathbf F_p[x]$ then the splitting field of $f(x)$ over $\mathbf F_p$ has degree $3$, so the Galois group must be $A_3$ and thus the discriminant of $f(x)$ is a square in $\mathbf F_p$. This implies if $F(x)$ is a monic irreducible cubic in $\mathbf Z[x]$ with discriminant $D$ that is not a square in $\mathbf Z$ then $F(x)(x^2-D)$ has a root mod $p$ for every prime number $p$. For example, $x^3+x+1$ has discriminant $-31$, which is your example. – KCd Dec 30 '14 at 23:18
• – Grigory M Dec 31 '14 at 10:32
• I have added an answer at math.stackexchange.com/questions/608919/… that explains why your example has a root modulo every prime. – Hurkyl Jun 14 '16 at 10:31

If you just want an easy example of polynomial that has root modulo every prime but not in $\mathbb Q$ — just take e.g. $$(x^2-2)(x^2-3)(x^2-6)$$ (it has this property since the product of two non-squares mod p is a square mod p).
One more interesting example is $x^8-16$ (standard proof uses quadratic reciprocity).
• Thanks. Also why can't we find another polynomial of degree $< 5$? KCd gave some sort of an answer in the comments but it did not quite answer the question. – Sandeep Silwal Dec 31 '14 at 1:24