Consider two Hermitian matrices A1 and A2 that commute (in mathematica syntax, every set is a row {}): A1={{1,0,1},{0,0,0},{1,0,1}} and A2={{2,1,1},{1,0,-1},{1,-1,2}}. The matrix A1 had eigenvalues and orthonormal eigenvectors: lambda1=2, lambda2=0=lambda3 corresponding to v1=1/sqrt(2){{1},{0},{1}}, v2=1/sqrt(2){{-1},{0},{1}}, v3=1/sqrt(2){{0},{1},{0}}. In the basis of these eigenvectors find A2 and then your result to find the eigenvalues of A2.

I did the first part by creating let's call it matrix V, a matrix of the eigenvectors as the columns and then doing the following: P^-1A2P. That gives me the matrix, let's call it B2={{3,0,0},{0,1,-sqrt(2)},{0,-sqrt(2),0}}

But how do I do the second part?