Let $$A=\begin{bmatrix}2&-1\\-1&1\end{bmatrix} \quad\text{and}\quad B=\begin{bmatrix}-1&-1\\-1&1\end{bmatrix}.$$ Is there an orthogonal matrix $Q$ that satisfies $Q^tAQ, Q^tBQ\\$ are both diagonal?
I know since $A$ is a complete positive matrix then both $A$ and $B$ are simultaneously diagonalisable, but how I can define whether it's possible to diagnolize them with an orthogonal matrix?
Thanks in advance.
If there were a matrix $S$ such that $D=S^{-1}AS$ and $E=S^{-1}BS$ were both diagonal, then since diagonal matrices commute we would have $$ AB=(SDS^{-1})(SES^{-1})=SDES^{-1}=SEDS^{-1}=(SES^{-1})(SDS^{-1})=BA $$ But in this case $AB\neq BA$, so $A$ and $B$ aren't simultaneously diagonalizable, even without the restriction that $S$ be orthogonal.