TITLE: Is there a pattern of the factorization of a polynomial modulo $p$ as $p$ varies
QUESTION [10 upvotes]: Take $P\in\mathbb{Z}[X]$ and factorize it modulo $p$, where $p$ is a prime.
Modulo different $p$'s the factorization varies. Is there a pattern in this variation? I mean,  for example, if $P$ is quartic, it can factorize as "linear*cubic", "quadratic*quadratic", "quadratic*linear*linear" and so on. Does it tend to factorize more in one way than in the other ways?
I came up with this question, because I am calculating these factorizations of a few polynomials, and they tend to "prefer" certain ways of factorization. This is looking curious, though of course, it could just be the odds.

REPLY [8 votes]: Good question! This is in fact a fairly deep question in number theory. Statistical patterns are given by Chebotarev's density theorem, which predicts for example that for an irreducible quadratic polynomial you get two linear factors about half the time and a quadratic factor about half the time. In general, Chebotarev tells you that the frequency of each kind of factorization is controlled by the Galois group of the polynomial. 
Describing the exact primes at which various factorizations occur is hard. If $P$ has abelian Galois group, then the answer is given by class field theory and can be given in terms of congruence conditions on the primes. This is easiest to see for the cyclotomic polynomials. Already the application to quadratic polynomials is essentially quadratic reciprocity, which is nontrivial. 
If $P$ is nonabelian, then the answer is more complicated. Even for simple nonabelian cases the exact description can involve more sophisticated mathematics like modular forms; for example, $P(x) = x^3 - x - 1$ is controlled by the modular form
$$q \prod_{n=1}^{\infty} (1 - q^n)(1 - q^{23n})$$
as described here. In some sense answering this question is the goal of (part of?) the Langlands program.