up previous next
factor

factor a polynomial

Syntax
factor(F:POLY):RECORD
    

Description
This function factors a polynomial in its ring of definition. Multivariate factorization is not yet supported over finite fields. (For information about the algorithm, consult Pointers to the Literature.) To factorize an integer use SmoothFactor .

The function returns a list of the form [[F_1, N_1],...,[F_r, N_r]] where F_1^N_1 ... F_r^N_r = F and the F_i are irreducible in the polynomial ring of F.

Example
/**/  Use R ::= QQ[x,y];
/**/  F := *** x^12 - 37x^11 + 608x^10 - 5852x^9 + 36642x^8 - 156786x^7
               + 468752x^6 - 984128x^5 + 1437157x^4 - 1422337x^3
	       + 905880x^2 - 333900x + 54000***;
/**/  Fs := factor(F);
/**/  indent(Fs);
Record[
  Exponents := [1, 1, 1, 2, 3, 4],
  Factors := [x -2, x -4, x -6, x -3, x -5, x -1],
  RemainingFactor := 1
]
/**/  G := Product([Fs.Factors[i]^Fs.Exponents[i] | i In 1..len(Fs.Factors)]);
/**/  F = G * Fs.RemainingFactor;
true

/**/  factor((8*x^2+16*x+8)/27);
  -- the "content" appears as RemainingFactor;
  -- it is not factorized into prime factors.
Record[Exponents := [2], Factors := [x +1], RemainingFactor := 8/27]

/**/  F := (x+y)^2*(x^2*y+y^2*x+3);    -- multivariate factorization
/**/  F;
x^4*y + 3*x^3*y^2 + 3*x^2*y^3 + x*y^4 + 3*x^2 + 6*x*y + 3*y^2
/**/  indent(factor(F));
Record[
  Exponents := [1, 2],
  Factors := [x^2*y +x*y^2 +3, x +y],
  RemainingFactor := 1
]

  Use ZZ/(37)[x];
  Factor(x^6-1); -- ***Not yet implemented ???***
[[x - 1, 1], [x + 1, 1], [x + 10, 1], [x + 11, 1], [x - 11, 1], [x - 10, 1]]
---------------------------------
  Factor(2x^2-4); -- over a finite field the factors are made monic;
                  -- leading coeff appears as "content" if it is not 1.
[[x^2 - 2, 1], [2, 1]]
---------------------------------

See Also