# Symmetric matrices with the eigenvalues comparable

Let $A,B$ be $n\times n$ real symmetric matrices, with eigenvalues $\lambda_i$ and $\mu_i$ respectively, $i=1,\cdots,n$. Suppose that $$\lambda_i\leq\mu_i,\forall\ i.$$ Show that there exists an orthogonal matrix $O$ such that $$O^TBO-A$$ is non-negative definite.

I do want to show that for some orthogonal matrix $P$ such that $P^tAP$ commutes with $B$, but this idea could not be forwarded...

Let $P,Q$ be orthogonal with $P^tAP$ the diagonal matrix with diagonal $\lambda_1,\dots,\lambda_n$ and $Q^tBQ$ the diagonal matrix with diagonal $\mu_1,\dots,\mu_n$. Then $Q^tBQ-P^tAP$ is non-negative definite, so $PQ^tBQP^t-A$ is. Let $O=QP^t$.