So I've been given two diagonal matrices with non matching eigenvectors, A:$$ \begin{matrix} 2 & 0 & 0 \\ 0 & 2 & 0 \\ -1 & 0 & 1 \\ \end{matrix} $$ and B: $$ \begin{matrix} 1 & 1 & 0 \\ 1 & 1 & 0 \\ -1 & -1 & 0 \\ \end{matrix} $$
Eigenvectors for A: (0, 0, 1), (-1, 0, 1), (0,1,0) Eigenvectors for B: (-1,1,0), (0,0,1), (-1,-1,1) AB=BA (I have proven this), but how do I go about making a joint basis for the two matrices so that I can have a matrix which diagonalizes both A and B?
Edit 1: So, I've figured out two of the three vectors which would make up the matrix I am looking for (that would simultaneously diagonalize A and B). (0,0,1) and (-1,1,1) both belong to the vector space spanned by A and B. Now I just need the third and I should be good. I'd be grateful for any input