CoCoA:Factor

From ApCoCoAWiki

Factor

factor a polynomial

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]].)

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 ::= Q[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;
  Factor(F);
[[x - 2, 1], [x - 4, 1], [x - 6, 1], [x - 3, 2], [x - 5, 3], [x - 1, 4]]
---------------------------------
  G := Product([W[1]^W[2] | W In It]);  -- check solution
  F = G;
TRUE
---------------------------------
  Factor((8x^2+16x+8)/27);
  -- the <quotes>content</quotes> appears as a factor of degree 0;
  -- it is not factorized into prime factors.
[[x + 1, 2], [8/27, 1]]
---------------------------------
  F := (x+y)^2*(x^2y+y^2x+3);
  F;
x^4y + 3x^3y^2 + 3x^2y^3 + xy^4 + 3x^2 + 6xy + 3y^2
-------------------------------
  Factor(F);  -- multivariate factorization
[[x^2y + xy^2 + 3, 1], [x + y, 2]]
-------------------------------
  Use Z/(37)[x];
  Factor(x^6-1);
[[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 <quotes>content</quotes> if it is not 1.
[[x^2 - 2, 1], [2, 1]]
---------------------------------

Syntax

Factor(F:POLY):LIST
   <type>polynomial</type>