Factoring in ℤ/pℤ[x]: Factor

### 5.35.4 Factoring in ℤ/pℤ[x]: Factor

In Xcas mode, Factor is simply the inert form of factor; namely, it factors a polynomial without evaluation. (See Section 5.12.10.) In Maple mode, the Factor command can additionally be used in conjunction with mod to factor a polynomials with coefficients in ℤ/pℤ, where p must be prime.

- (In Maple mode.)
  Factor takes one argument:
  P, a polynomial with coefficients in ℤ/pℤ for prime p.
- Factor(P) returns the factored form of P.

#### Example

Input (in Xcas mode):

Factor((-3*x^3+5*x^2-5*x+4)%13)

Output:

factor | ⎛ ⎝ | ⎛ ⎝ | ⎛ ⎝ | −3 | ⎞ ⎠ | %13 | ⎞ ⎠ | x3+ | ⎛ ⎝ | 5%13 | ⎞ ⎠ | x2+ | ⎛ ⎝ | ⎛ ⎝ | −5 | ⎞ ⎠ | %13 | ⎞ ⎠ | x+4%13 | ⎞ ⎠

To get the actual factorization:
Input:

eval(ans())

Output:

⎛ ⎝ | ⎛ ⎝ | −3 | ⎞ ⎠ | %13 | ⎞ ⎠ | ⎛ ⎝ | ⎛ ⎝ | 1%13 | ⎞ ⎠ | x+ | ⎛ ⎝ | −6 | ⎞ ⎠ | %13 | ⎞ ⎠ | ⎛ ⎝ | ⎛ ⎝ | 1%13 | ⎞ ⎠ | x2+6%13 | ⎞ ⎠

Input (in Maple mode):

Factor(-3*x^3+5*x^2-5*x+4) mod 13

Output:

−3 | ⎛ ⎝ | x−6 | ⎞ ⎠ | ⎛ ⎝ | x2+6 | ⎞ ⎠