Integer polynomials with roots in every $\mathbb{Z}_p$ but no rational roots.

I'd like to find small degree polynomials in $\mathbb{Z}[x]$ having no rational roots but admitting roots in all $\mathbb{Z}_p$ for every prime $p$.

Low degree examples:

  • $(x^2-q)(x^2-r)(x^2-qr)$ where $r,q$ are prime numbers such that $\left(\frac{q}{r}\right)=\left(\frac{r}{q}\right)=1$ and one of $q,r,qr$ is $1$ mod $8$ (eg 13 and 17). Indeed, this works for if $p\ne 2,q,r$ is prime, one of $q,r,qr$ must be a square mod $p$ by multplicativity of legendre symbol, all of these are nonzero so we can lift with Hensel.
    If $p=q$ or $p=r$, there is a nonzero root mod $p$ by the way we chose $q,r$. Lift this root with Hensel. If $p=2$, there is a root mod $8$ not divisible by $2$ and use Hensel again.

  • this question claims that the polynomial $(x^2+31)(x^3+x+1)$ works. (proof here)

There certainly do not exist such polynomials of degree 2, because if $ax^2+bx+c=0$ has a solution mod $p$ for all primes $p$, then $b-4ac$ is a square mod every prime and hence an integral square, so a rational solution exists.

I do not expect there to be such polynomials of degree 3 or 4, how can I show this?


If $f$ is an irreducible polynomial, then there are primes where $f$ is inert, and thus does not have a root in the corresponding finite field.

This lets us rule out the case of quadratic or cubic polynomials.

If $f$ is a reducible squarefree quartic without root, then it is the product of two irreducible quadratics. Its Galois group is either $\mathbb{Z}/2\mathbb{Z}$, or $(\mathbb{Z} / 2 \mathbb{Z})^2$. Either way, there exist Galois elements that have no fixed points among the roots, and thus there is some prime where $f$ does not have a root.

This argument breaks down in degree 5, which is why we see examples. Consider an irreducible cubic with Galois group $S_3$. This has a cubic and quadratic subfield, and let $f$ be the product of the two defining polynomials.

Letting $c$ denote roots of the cubic and $q$ roots of the quadratic, the only possible cycle structure that permutes the roots without fixed points is $(ccc)(qq)$; however this permutation has order six and cannot be an element of $S_3$. Consequently, $f$ has a root in every finite field.