If two real symmetric square matrices commute then does they have a common eigenvector ? Let $A,B$ be real symmetric $n \times n$ matrices such that $AB=BA$ , then is it true that $A,B$ have a common eigenvector in $\mathbb R^n$ ? 
 A: First we prove that if $AB=BA$ then $\ker A$ is invariant by $B$. In fact if $x\in \ker A$ then
$$ABx=BAx=B0=0\implies Bx\in\ker A$$
Now since $A$ is symmetric real matrix then it's diagonalizable matrix so let $\lambda$ an eigenvalue of $A$ and by the result mentioned above $E_\lambda(A)=\ker (A-\lambda I_n)$ is invariant by $B$ and since $B$ is also diagonalizable so its restriction on $E_\lambda (A)$ is diagonalizable so if $\mu$ an eigenvalue of the restriction then there's $0\ne x\in E_\lambda(A)$ eigenvector of $B$ associated to $\mu$ and it's also eigenvector of $A$ associéted to $\lambda$.
A: Yes. $A$, being real symmetric, can be diagonalized with an orthogonal transformation $T$, i.e. $T^T = T^{-1}$. $B$, commuting with $A$ preserves the eigenspaces of $A$, in other words, if $v$ is an eigenvector of $A$ for the eigenvalue $\lambda$, then so is $Bv$ - check that. Now, $T^TAT$ is diagonal, i.e. the basis is composed of the eingevectors of $A$, and $T^TBT$, commuting with $T^TAT$ and preserving eigenspaces of $T^TAT$ must be block diagonal, where the blocks correspond to the eigenspaces of $A$. Moreover, $T^TBT$ is still real symmetric, since $T$ is orthogonal. So, every diagonal block of $T^TBT$ can be diagonalized with an orthogonal transformation. Since the subspace corresponding to such a diagonal block is an eigenspace of $T^TAT$, $T^TAT$ acts by scalar multipliciation on that subspace. This is unchanged by the diagonalization of $T^TBT$ on that subspace. All in all, we get a simultaneous diagonalization of $A$ and $B$ with an orthogonal transformation. So, we even have a basis of common eigenvectors of $A$ and $B$.
