Squarefree polynomial factorization

The calculator extracts square factors from the input polynomial.

A univariate square-free polynomial p(x) has no square factors: q2(x), where q(x) - positive degree polynomial.
The calculator below factorizes an input polynomial into square factors if any. The input polynomial should be primitive (i.e. all the coefficients must be co-prime), otherwise the calculator produces a constant factor equals to polynomial content.
The coefficients can be integer, complex number, fraction or complex fraction.
It produces square free factors along with their exponent.
The calculator uses Yun's square-free factorization algorithm, which is described just below the calculator.

PLANETCALC, Squarefree polynomial factorization

Squarefree polynomial factorization

Polynomial coefficients, space separated.
The file is very large. Browser slowdown may occur during loading and creation.

Yun square-free factorization algorithm

The algorithm pseudo code: 1

//Input polynomial (must be primitive)
a(x);
 //Derivative calculation
b(x) ⟵ a'(x)            
//Greatest common divisor calculation     
c(x) ⟵ gcd( a(x), b(x) ) 
i=1
if  c(x)=0  {
    w(x) ⟵ a(x)
} else {
    w(x) ⟵ a(x)/c(x)
    y(x) ⟵ b(x)/c(x)
    z(x) ⟵ y(x) - w'(x)
    while( z(x)!=0 ) {
        g(x) ⟵ gcd(w(x),z(x))
        output ⟵ g(x)^i
        i⟵ i + 1
        w(x) ⟵ w(x) / g(x)
        y(x) ⟵ z(x) / g(x)
        z(x) ⟵ y(x) - w'(x)
    }
}
output ⟵ w(x)^i

  1. Keith O. Geddes, Stephen R. Czapor, George Labahn, Algorithms for Computer Algebra. Kluwer Academic Publishers, 1992, p. 342 

URL copied to clipboard
PLANETCALC, Squarefree polynomial factorization

Comments