### 5.50.8 Minimal polynomial : pmin

pmin takes one (resp. two) argument(s): a square matrix A of size n and optionally the name of a symbolic variable.
pmin returns the minimal polynomial of A written as a list of its coefficients if no variable was provided, or written in symbolic form with respect to the variable name given as second argument. The minimal polynomial of A is the polynomial P having minimal degree such that P(A)=0.
Input :

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

Output :

[1,-1]

Input :

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

Output :

x-1

Hence the minimal polynomial of [[1,0],[0,1]] is x-1.
Input :

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

Output :

[1,-4,4]

Input :

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

Output :

x`^`2-4*x+4

Hence, the minimal polynomial of [[2,1,0],[0,2,0],[0,0,2]] is x2−4x+4.