= Solution
Suppose $AB=BA$ and $Av_j=a_jv_j$. Then
$$
A(Bv_j)=B(Av_j)=a_jBv_j.
$$
Because the <eigenvalues> of $A$ are distinct, the <eigenspace> for $a_j$ is one-dimensional. It follows that $Bv_j=b_jv_j$, including the possibility $b_j=0$. Thus an orthonormal <eigenbasis> of $A$ is also an <eigenbasis> of $B$. The simplicity of both spectra means their <eigenvectors> coincide as directions, up to ordering, phases and nonzero scalar multiples.
Conversely, if they share a complete <eigenbasis>, choose the <unitary matrix> $U$ whose columns are these common normalized <eigenvectors>. Then $U^\dagger AU=D_A$ and $U^\dagger BU=D_B$ are diagonal, so $D_AD_B=D_BD_A$ and $AB=BA$. Hence
$$
\boxed{AB=BA\quad\Longleftrightarrow\quad A,B\text{ have a common orthonormal eigenbasis}.}
$$
This is <simultaneous diagonalization> of the two <Hermitian matrices>.
Back to article page