I am having some trouble finding a basis of eigenvectors that diagonalizes two matrices simultaneously.
I have found two bases of eigenvectors for two 3x3 matrices.
I can't seem to find an algorithm or any discussions on MSE on how to do this.
So, my idea is to arrange all 6 vectors into rows, place them in a matrix, and row-reduce (which is then equivalent to performing column operations on the 6 column vectors) until I find 3 linearly independent rows. These 3, new, row vectors form a new basis for $R^3$, but does not quite diagonalize my matrices anymore. So, they aren't eigenvectors anymore -- at least not all of them are.
But I feel this guess at an algorithm almost works -- using this new basis, my matrices A and B were almost diagonal. Off by one non-zero entry away from the main diagonal.
Do you know of an algorithm to find the explicit basis for simultaneously diagonalizability of matrices? I have only seen proofs on MSE of the existence of such a basis, which I already understand and have verified. But I want to compute this basis.
EDIT: the two matrices commute.