While solving a problem I came across a specific question:
Given $A,B$ as $2$ real, symmetric, matrices with $B$ positive definite, does there exist a matrix (invertible) $P$ such that both $P^TAP$ and $P^TBP$ are diagonal matrices?
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It only takes a minute to sign up.
Sign up to join this communityWhile solving a problem I came across a specific question:
Given $A,B$ as $2$ real, symmetric, matrices with $B$ positive definite, does there exist a matrix (invertible) $P$ such that both $P^TAP$ and $P^TBP$ are diagonal matrices?
This is in the first edition of Horn and Johnson, Matrix Analysis paperback 1990. There are two conditions that are needed to be sure this can be accomplished. Given symmetric $A,B$ symmetric, first we require $A$ invertible. Second, defining $C = A^{-1} B,$ we require that $C$ be diagonalizable with some $R$ invertible and $R^{-1} C R = \Lambda$ diagonal. It is allowed to have $\Lambda$ complex, this may happen as $C$ need not be symmetric.
Example
$$ A = \left( \begin{array}{rr} 165 & -117 \\ -117 & 83 \end{array} \right) $$ and $$ B = \left( \begin{array}{rr} 1047 & -747 \\ -747 & 533 \end{array} \right) $$
Next $$ C = A^{-1} B = \left( \begin{array}{rr} -83 & 60 \\ -126 & 91 \end{array} \right) $$ has eigenvalues $1,7.$ As these are distinct, we can diagonalize.
$$ R = \left( \begin{array}{rr} 5 & 2 \\ 7 & 3 \end{array} \right) $$ has determinant $1,$ and $$ \Lambda = R^{-1} C R = \left( \begin{array}{rr} 1 & 0 \\ 0 & 7 \end{array} \right). $$
The construction arranges that $$ R^T B R = R^T A R \Lambda, $$ which finishes the problem when $\Lambda$ has a diagonal elements distinct. Indeed, $$ R^T AR = \left( \begin{array}{rr} 2 & 0 \\ 0 & 3 \end{array} \right) $$ and $$ R^T BR = \left( \begin{array}{rr} 2 & 0 \\ 0 & 21 \end{array} \right) $$
An example where $C$ has a repeat eigenvalue, but can be diagonalized, is at