# Related to symmetric, diagonal and invertible matrices

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?

• See simultaneous diagonalization under en.wikipedia.org/wiki/Diagonalizable_matrix – user251257 Apr 17 '16 at 16:47
• @user251257 :Thanks.. – Qwerty Apr 17 '16 at 16:49
• @user251257 no, I'm afraid that selection discusses $P^{-1} A P.$ With quadratic forms, or symmetric matrices, the correct expression is in the question, $P^T A P.$ And, as is in Horn and Johnson, this can be done once one of the symmetric matrices is guaranteed positive definite. – Will Jagy Apr 17 '16 at 16:54
• see math.stackexchange.com/questions/1697846/… and the first edition of Horn and Johnson, table 4.5.15T on page 229, then detail for case II on pages 231-232. – Will Jagy Apr 17 '16 at 16:56
• Oh I oversaw that $P$ need not be orthogonal/unitary. Sorry – user251257 Apr 17 '16 at 17:00

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

Congruence and diagonalizations

• Beautiful reference and answer. – Qwerty Apr 17 '16 at 20:12