How this calculation works
Changing the coefficient field changes both polynomial factorization and root existence. This calculator factors a bounded polynomial completely over a small prime field, verifies the exact product and lists every root in that field with its multiplicity. The nonzero leading coefficient is retained as a field unit, while all returned factors are monic. A polynomial with no roots can still have higher-degree factors.
f(x)=u∏g_i(x)^e_i in GF(p)[x]; linear factors x−r give roots r with multiplicity e_i.A worked example
Over GF(5), x²+1=(x+2)(x+3), so its roots are 3 and 2 respectively. Both roots have multiplicity one. Over GF(3), the same polynomial has no roots and is irreducible of degree two. The input coefficients are ordinary integers until reduction; negative values and coefficients divisible by p are interpreted by their field residues.
Good to know
Prime fields p=2,3,5,7,11,13; nonzero reduced polynomials of degree at most eight. Input coefficients descend by power, while factor tables list coefficients ascending by power. The zero polynomial is rejected because every field element is a root and ordinary irreducible factorization is not unique in that case. Extension-field roots, arbitrary composite moduli and large-prime probabilistic factorization are unsupported.
Reference: SymPy — polynomial factorization over finite fields (opens in a new tab) ↗
The same written polynomial can behave differently in another field
Over the real numbers x²+1 has no roots; over the complex numbers it splits; over GF(5) it splits with roots two and three. These are different algebraic questions, not conflicting numerical approximations. The field selector is therefore part of the mathematical input and must accompany any saved factorization.
The leading coefficient may disappear when reduced modulo p, lowering the degree. The engine first removes those leading zeros and factors the actual reduced polynomial. If every coefficient disappears, the result is the zero polynomial and the request is rejected explicitly. A nonzero constant instead has a unit factor and no roots.
The Multivariate polynomial factorization calculator over rationals factors over rational coefficients, while this page changes the coefficient field and verifies factors modulo a selected prime.
No roots does not always mean irreducible
For degree two or three over a field, the absence of a linear factor implies irreducibility. In higher degree that shortcut fails: a quartic can be a product of two irreducible quadratics and still have no field-valued root. The implementation tests monic factors of all required degrees, not only evaluations at individual residues.
Repeated factors matter as well. In characteristic p, derivatives can vanish identically even for a nonconstant polynomial. Trial division with exact field arithmetic still detects multiplicity. For example, x²+1 over GF(2) equals (x+1)²; its single root one has multiplicity two, rather than being two distinct roots.
Monic factors and the field unit reconstruct the input
Factoring out the leading unit normalizes the polynomial before the search. Each discovered monic factor is divided out repeatedly to determine its full multiplicity. Once every possible factor through half the remaining degree has been exhausted, the nonconstant remainder is irreducible under the bounded complete search.
The factors are multiplied back together and compared coefficient by coefficient modulo p. The reported unit restores the original leading coefficient. Independent tests compare this factorization with SymPy over each supported prime field and also evaluate the original polynomial at every residue to check the root list directly.
A few questions, answered
Are the factor coefficients in the same order as the input?
No. The input descends by power; each factor row explicitly uses ascending coefficients, constant term first. This convention is stated in the result note.
Why are composite moduli rejected?
GF(p) requires p prime. Rings modulo composite integers have zero divisors and need different factorization and root rules.