Diagonalizing a Matrix


To diagonalize a matrix A, we look for a non-singular matrix S such that Inv(S)AS=D, where D is a diagonal matrix. The matrix S is the matrix composed of the eigenvectors of D. We require that A have a full complement of independent eigenvectors, meaning n eigenvectors if A is nxn.

Let's define a matrix a.
For example :

In[1]:=

  a={{1,5},{4,2}};
  MatrixForm[a]

Out[1]=

  1   5
  
  4   2

Mathematica will find the eigenvalues and the eigenvectors.

In[2]:=

  Eigensystem[a]

Out[2]=

  {{-3, 6}, {{-5, 4}, {1, 1}}}

We now form the matrix with the eigenvectors of of a.

In[3]:=

  s=Transpose[Eigenvectors[a]];
  MatrixForm[s]

Out[3]=

  -5   1
  
  4    1

Mathematica can find the inverse of a matrix. Here we use a shortcut to find the inverse and put it into matrix form.

In[4]:=

  
  MatrixForm[Inverse[s]]

Out[4]=

    1    1
  -(-)   -
    9    9
  
  4      5
  -      -
  9      9

Well, does it work? Is Inv(S)AS=D (with the eigenvalues of A on the diagonal of D)?
Evaluate the following and see.

In[5]:=

  
  d=Inverse[s].a.s;
  MatrixForm[d]

Out[5]=

  -3   0
  
  0    6

Up to Jordan Canonical Form