Example 1
A={{1,1,-1},{0,0,2},{0,-1,3}};
MatrixForm[A]
Out[30]=
1 1 -1 0 0 2 0 -1 3
The following finds the characteristic polynomial of A.
In[31]:=
Det[A-x IdentityMatrix[3]]
Out[31]=
2 3
2 - 5 x + 4 x - x
As you know, the zeroes of the characteristic polynomial are the eigenvalues of A. The minimal polynomial also has a zero at each eigenvalue (though possibly with a smaller multiplicity). Let's factor the characteristic polynomial to help us find the minimal polynomial.
In[32]:=
Factor[Det[A-x IdentityMatrix[3]]]
Out[32]=
2
(2 - x) (-1 + x)
We will use a very unsophisticated method to find m(x), namely we will test all
polynomials with the same zeroes (watch the multiplicity!) of degree smaller
than the characteristic polynomial.
For matrices, A.A.A=A^3. In Mathematica you calculate this using A.A.A
or MatrixPower[A,3]. Let's check (2-x)(-1+x)=-x^2+3x-2, actually as a monic
polynomial this is x^2-3x+2.
In[33]:=
MatrixForm[A.A-3A+2IdentityMatrix[3]]
Out[33]=
0 -1 1 0 0 0 0 0 0
As you can see, (2-x)(-1+x) is not the minimal polynomial. By default (and the
Cayley-Hamilton Theorem), the minimal polynomial is the characteristic
polynomial (suitably written to be monic).
Recall the Jordan form of A.
In[34]:=
MatrixForm[JA]
Out[34]=
1 1 0 0 1 0 0 0 2
Compare the size of the Jordan block for each eigenvalue with the multiplicity of that eigenvalue in the MINIMAL polynomial.