### 15.2.9 Minimal polynomial

The minimal polynomial of a square matrix A is the polynomial P having minimal degree such that P(A)=0. The pmin command finds the minimal polynomial of a matrix.

- pmin takes one mandatory argument and one optional argument:
  - A, a square matrix.
  - Optionally, x, a variable name.
- pmin(A⟨,x⟩) returns the minimal polynomial A. It is written as the list of its coefficients if no variable name was provided or written as an expression with respect to x if there is a second argument.

#### Examples

pmin([[1,0],[0,1]])

| ⎡ ⎣ | 1,−1 | ⎤ ⎦

pmin([[1,0],[0,1]],x)

x−1 |  |  |  |  |  |  |  |  |  |

Hence the minimal polynomial of [

1 | 0
0 | 1

] is x−1.

pmin([[2,1,0],[0,2,0],[0,0,2]])

| ⎡ ⎣ | 1,−4,4 | ⎤ ⎦

pmin([[2,1,0],[0,2,0],[0,0,2]],x)

x2−4 x+4 |  |  |  |  |  |  |  |  |  |

Hence, the minimal polynomial of [

2 | 1 | 0
0 | 2 | 0
0 | 0 | 2

] is x2−4x+4.