If $A$ and $B$ are square symmetric matrices and, additionally, one of them, say $B$, is positively defined, then there exists an invertible matrix $S$ such that
$$S^{\top}\!AS=D \quad\text{and}\quad S^{\top}\!BS=I,$$
where $D$ is diagonal and $I$ is the identity matrix.
Question: Why it is important to be able to do such reduction simultaneously (by a single matrix $S$)? Where this can be applied?
P.S.: I heard about some applications for differential equations, but only in general phrases.