The first matrix A has eigenvectors
(0,1,0), (2,0,1), (1,0,1)
The second matrix B has eigenvectors
(4,1,2), (1,1,0), (1,0,1).
Both sets form a basis for $R^3$.
Now, how do I pick out a basis of eigenvectors that simultaneously diagonalizes A and B?
I've searched on MSE but have only found proof-y discussions of this topic, but I want to find an explicit basis.
Thanks,
EDIT: I tried putting all six vectors in a matrix, each in a row, and row reduced until I got 3 linearly independent vectors. I used this as S, computed the inverse, but then $S^{-1}AS$ is not diagonal anymore...almost diagonal, though - off by one non-zero entry, with all of A's eigenvalues still on the diagonal. So, I'm pretty close, I think.
EDIT 2:
The matrices are:
$$ A= \begin{bmatrix} 0 & 0 & 2 \\ 0 & 1 & 0 \\ -1 & 0 & 3 \\ \end{bmatrix} $$
and
$$ B= \begin{bmatrix} 0 & 4 & 4 \\ -1 & 5 & 1 \\ -2 & 2 & 6 \\ \end{bmatrix} $$
Eigenvalues for A are 1,2 -- with 1 having geometric multiplicity = 2.
Eigenvalues for B are 3, 4 -- with 4 having geometric multiplicity = 2.