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 :


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

Mathematica will find the eigenvalues and the eigenvectors.


  Eigensystem[a]

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


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

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


  
  MatrixForm[Inverse[s]]

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


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

Up to Jordan Canonical Form