up previous next
factor

factor a polynomial

Syntax
factor(F: RINGELEM): RECORD

Description
This function factorizes a polynomial into irreducibles in its ring of definition. Multivariate factorization is not yet supported over finite fields (but you can use SqFreeFactor and then ContentFreeFactor to obtain a partial factorization). To factorize an integer use SmoothFactor . (For information about the algorithm, consult John Abbott's papers, for univariate polynomials with coefficients in an algebraic extension, from version 5.2.3, consult E.Palezzato's PhD thesis)

NOTE: in older versions of CoCoA-5 the field names were Factors and Exponents .

Example
/**/  use R ::= QQ[x,y];
/**/  F := 4*x^8 + 4*x^6 + x^4 + 4*x^2 + 4;
/**/  FacInfo := factor(F);
/**/  indent(FacInfo);
record[
  RemainingFactor := 1,
  factors := [2*x^4-4*x^3+5*x^2-4*x+2, 2*x^4+4*x^3+5*x^2+4*x+2],
  multiplicities := [1, 1]
]
/**/  G := product([FacInfo.factors[i]^FacInfo.multiplicities[i]
/**/                        | i in 1..len(FacInfo.factors)]);
/**/  F = G * FacInfo.RemainingFactor;
true

/**/  factor((8*x^2 +16*x +8)/27);
record[factors := [x +1], multiplicities := [2], RemainingFactor := 8/27]

/**/  factor(2*x^2-4); -- over a finite field the factors are monic
record[factors := [x^2 -2], multiplicities := [1], RemainingFactor := 2]
---------------------------------

/**/ use QQab ::= QQ[a,b];
/**/ L := QQab/ideal(a^2-2, b^2-3);
/**/ use L[x,y];
/**/ indent(factor(x^2-2));
record[
  RemainingFactor := (1),
  factors := [x +(a), x +(-a)],
  multiplicities := [1, 1]
]

/**/ indent(factor(x^2-6));
record[
  RemainingFactor := (1),
  factors := [x +(-a*b), x +(a*b)],
  multiplicities := [1, 1]
]

See Also