Factoring a polynomial with coefficients in a Galois field

### 10.9.19 Factoring a polynomial with coefficients in a Galois field

The factor command can factor univariate polynomials with coefficients in a Galois field.

- factor takes one mandatory argument and one optional argument:
  - expr, an expression or a list of expressions.
  - Optionally, α, to specify an extension field.
- factor(expr) returns expr factored over the field of its coefficients, with the addition of i in complex mode (see Section 2.5.5). If sqrt is enabled in the CAS configuration (see Section 2.5.7), polynomials of order 2 are factorized in complex mode or in real mode if the discriminant is positive.

  factor(expr,α) returns expr factored over F[α], where F is the field of coefficients of expr.

- cfactor factors like factor, except the field includes i whether in real or complex mode.

#### Example

The command factor can factorize a univariate polynomial with coefficients in a Galois field. For example, to have G=F4, input:

G:=GF(2,2,['w','G'])

GF | ⎛ ⎝ | 2,w2+w+1, | ⎡ ⎣ | w,G | ⎤ ⎦ | ,undef | ⎞ ⎠

Now input, for example:

a:=G(w):; factor(a^2*x^2+1)

G | ⎛ ⎝ | w | ⎞ ⎠ | 2 x2+1