Quadratic polynomials (algebraic) refresher¶
A quadratic polynomial over a field \(F\) is a degree-2 polynomial
Over \(F=\mathbb{R}\) or \(\mathbb{C}\) this is the familiar object from school algebra, but many experiments treat \(f\) over other fields (like \(\mathbb{Q}\) or finite fields \(\mathbb{F}_p\)). [Dummit and Foote, 2004, Wikipedia contributors, 2026]
Completing the square¶
A standard normal form is obtained by completing the square:
This shows that (over a field of characteristic \(\ne 2\)) every quadratic is a shifted/scaled square plus a constant term.
Discriminant and factorization¶
The discriminant is
Over a field where square roots make sense, the roots are
Algebraically, this means:
\(f\) factors over \(F\) iff \(\Delta\) is a square in \(F\) (when \(\mathrm{char}(F)\ne 2\)).
If \(\Delta\) is not a square, the polynomial is irreducible over \(F\).
Finite field case (\(\mathbb{F}_p\), odd prime \(p\))¶
Over \(\mathbb{F}_p\), “\(\Delta\) is a square” means \(\Delta\) is a quadratic residue mod \(p\). This is the bridge between algebra and number theory: quadratic residues, Legendre symbols, and Gauss sums.
Why quadratics show up in prime experiments¶
Quadratics are the simplest non-linear polynomials, so they are a natural testbed for “prime values of polynomials”:
Example: \(n^2+1\) (Landau’s 4th problem).
Example: \(n^2+n+41\) (Euler’s famous prime-producing streak).
Even when a polynomial produces many primes early on, modular obstructions (e.g., always divisible by some prime for some residue class) inevitably appear.
Practical numerical caveats¶
Stable quadratic formula: over floating point numbers, use a stable variant when \(b^2\gg 4ac\) to avoid catastrophic cancellation.
Exact arithmetic: for modular experiments, keep everything as integers mod \(p\); don’t mix floats.
Normalization: many plots look cleaner after shifting/scaling to the monic form \(x^2+Bx+C\) (when working over a field with \(a^{-1}\)).
References¶
See References.