The following calculator finds all square factors of a polynomial in the finite field. The square-free factorization is the first step in the polynomial factor decomposition process. You can find more details just below the calculator.
We already have similar calculator for square free decomposition in the field of rational numbers, but for some edge cases it will not work for a polynomial with coefficients in finite field. A square-free polynomial decomposition algorithm is based on calculation of the greatest common divisor (GCD) of the polynomial and its derivative : gcd(A,A').
The derivative of a non-zero degree polynomial is always not zero in the ring of integers or rational field. But it can become zero in finite field. E.g. the polynomial x6+x3+2 has zero derivative in F3 field, since (6 mod 3)x5+(3 mod 3)x2 = 0x5+0x2 = 0. A polynomial term with a degree that's a multiple of a field order becomes zero in the derivative.
Square-free decomposition algorithm in finite field
The square-free factorization algorithm for finite field addresses the zero derivative issue, discussed above. The calculator uses the algorithm, described in wikipedia1 ( without recursion ):
// a(x) - Input polynomial (must be monic) // p - field order m⟵1 do //Greatest common divisor calculation c(x) ⟵ gcd( a(x), a'(x) ) w(x) ⟵ a(x)/c(x) i ⟵1 loop while w(x) !=1 y(x) ⟵ gcd(w(x), c(x)); q(x) ⟵ w(x) / y(x) if q(x)!=1 output ⟵ q(x)^i*m w(x) = y(x) c(x) = c(x)/y(x) i=i+1 end loop if c(x)!=1 a(x) = c(x)^(1/p) m ⟵ p*m end if loop until c(x)!=1