References: Shankar, R. (1994), Principles of Quantum Mechanics, Plenum Press. Exercise 1.8.10.
The spectral theorem guarantees that any normal operator can be unitarily diagonalized. For commuting hermitian operators we can go one step further and show that a set of such operators can be simultaneously diagonalized with a single unitary transformation. The proof is a bit lengthy and is spelled out in full both in Zwiebach’s notes (chapter 6) and in Shankar’s book (chapter 1, theorem 13) so I won’t reproduce it in full here. To summarize the main points:
We can start by considering two operators and and assume that at least one of them, say , is nondegenerate, that is, for each eigenvalue there is only one eigenvector (up to multiplication by a scalar). Then for one eigenvalue of we have
We also have
so that is also an eigenvector of for eigenvalue . However, since is nondegenerate, must be a multiple of so that
so that is an eigenvector of for eigenvalue . Therefore a unitary transformation that diagonalizes will also diagonalize . Note that in this case, we didn’t need to use the condition that and commute, and we also didn’t need to assume that is nondegenerate.
If both and are degenerate, things are a bit more complicated, but the basic idea is this. Suppose we find a basis that diagonalizes and arrange the basis vectors within the unitary matrix in an order that groups all equal eigenvalues together, so that all the eigenvectors corresponding to eigenvalue occur first, followed by all the eigenvectors corresponding to eigenvalue and so on, up to eigenvalue where is the number of distinct eigenvalues (which is less than the dimension of the matrix because is degenerate).
Each subset of eigenvectors corresponding to a single eigenvalue forms a subspace, and we can show that the other matrix , operating on a vector from that subspace transforms the vector to another vector that also lies within the same subspace. Now, any linearly independent selection of basis vectors within the subspace will still diagonalize for that eigenvalue, so we can select such a set of basis vectors within that subspace that also diagonalizes within that subspace. The process can be repeated for each eigenvalue of resulting in a set of basis vectors that diagonalizes both matrices.
Obviously, I’ve left out the technical details of just how this is done, but you can refer to either Zwiebach’s notes or Shankar’s book for the details.
As an example, consider the two matrices
We can verify that they commute:
We can find the eigenvalues and eigenvectors of and in the usual way. For we have
Solving the eigenvector equation, we get, for
Thus 2 orthonormal eigenvectors are
For , we can go through the same procedure to find
We could calculate the eigenvectors from scratch, but from the simultaneous diagonalization theorem, we know that the eigenvector from must be an eigenvector of , and we find by direct calculation that
so is the eigenvector for .
For the other two eigenvalues of , we know the eigenvectors must be linear combinations of and from . Such a combination must have form
so we must have
for . For , we have
By matrix multiplication, we can verify that this transformation diagonalizes both and :