1.17 Compute the Jordan canonical/normal form of a matrix A

Mathematica

Remove["Global`*"]; 
m={{3,-1,1,1,0,0}, 
   {1, 1,-1,-1,0,0}, 
  {0,0,2,0,1,1}, 
  {0,0,0,2,-1,-1}, 
  {0,0,0,0,1,1}, 
  {0,0,0,0,1,1}}; 
MatrixForm[m]
 

\[ \left ( {\begin {array}{cccccc} 3 & -1 & 1 & 1 & 0 & 0 \\ 1 & 1 & -1 & -1 & 0 & 0 \\ 0 & 0 & 2 & 0 & 1 & 1 \\ 0 & 0 & 0 & 2 & -1 & -1 \\ 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 & 1 & 1 \\ \end {array}} \right ) \]

{a,b}=JordanDecomposition[m]; 
b
 

\[ \left ( {\begin {array}{cccccc} 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 2 & 1 & 0 & 0 & 0 \\ 0 & 0 & 2 & 0 & 0 & 0 \\ 0 & 0 & 0 & 2 & 1 & 0 \\ 0 & 0 & 0 & 0 & 2 & 1 \\ 0 & 0 & 0 & 0 & 0 & 2 \\ \end {array}} \right ) \]

 

Matlab

clear all; 
A=[3 -1  1  1  0  0; 
   1  1 -1 -1  0  0; 
   0  0  2  0  1  1; 
   0  0  0  2 -1 -1; 
   0  0  0  0  1  1; 
   0  0  0  0  1  1;] 
 
jordan(A)
 

ans = 
 0     0     0     0     0     0 
 0     2     1     0     0     0 
 0     0     2     1     0     0 
 0     0     0     2     0     0 
 0     0     0     0     2     1 
 0     0     0     0     0     2
 

 

Maple

restart; 
A:=Matrix([[3,-1,1,1,0,0], 
   [1, 1,-1,-1,0,0], 
   [0,0,2,0,1,1], 
   [0,0,0,2,-1,-1], 
   [0,0,0,0,1,1], 
   [0,0,0,0,1,1]]); 
LinearAlgebra:-JordanForm(A);
 

\[ \left [\begin {array}{cccccc} 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 2 & 1 & 0 & 0 & 0 \\ 0 & 0 & 2 & 1 & 0 & 0 \\ 0 & 0 & 0 & 2 & 0 & 0 \\ 0 & 0 & 0 & 0 & 2 & 1 \\ 0 & 0 & 0 & 0 & 0 & 2 \end {array}\right ] \]