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;
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 "content" 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 ZZ/(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 "content" if it is not 1.
[[x^2 - 2, 1], [2, 1]]
---------------------------------
|