Algebra.js
function(symbol, factors) {
                if(symbol.isConstant() || symbol.group === S) return symbol;
                var poly = new Polynomial(symbol);
                var sqfr = poly.squareFree();
                var p = sqfr[2];
                //if we found a square then the p entry in the array will be non-unit
                if(p !== 1) {
                    //make sure the remainder doesn't have factors
                    var t = sqfr[1].toSymbol();
                    t.power = t.power.multiply(new Frac(p));
                    //send the factor to be fatored to be sure it's completely factored
                    factors.add(__.Factor.factor(t));
                    return __.Factor.squareFree(sqfr[0].toSymbol(), factors);
                }
                return symbol;
            }
function(symbol, factors) {
                if(symbol.isConstant() || symbol.group === S) return symbol;
                var poly = new Polynomial(symbol);
                var sqfr = poly.squareFree();
                var p = sqfr[2];
                //if we found a square then the p entry in the array will be non-unit
                if(p !== 1) {
                    //make sure the remainder doesn't have factors
                    var t = sqfr[1].toSymbol();
                    t.power = t.power.multiply(new Frac(p));
                    //send the factor to be fatored to be sure it's completely factored
                    factors.add(__.Factor.factor(t));
                    return __.Factor.squareFree(sqfr[0].toSymbol(), factors);
                }
                return symbol;
            }
function ( symbol , factors ) { if ( symbol . isConstant ( ) || symbol . group === S ) return symbol ; var poly = new Polynomial ( symbol ) ; var sqfr = poly . squareFree ( ) ; var p = sqfr [ 2 ] ; //if we found a square then the p entry in the array will be non-unit
 if ( p !== 1 ) { //make sure the remainder doesn't have factors
 var t = sqfr [ 1 ] . toSymbol ( ) ; t . power = t . power . multiply ( new Frac ( p ) ) ; //send the factor to be fatored to be sure it's completely factored
 factors . add ( __ . Factor . factor ( t ) ) ; return __ . Factor . squareFree ( sqfr [ 0 ] . toSymbol ( ) , factors ) ; } return symbol ; }
Makes Symbol square free
@param {Symbol} symbol
@param {Factors} factors
@returns {[Symbol, Factor]}
Makes Symbol square free