In this part, $A$ and $B$ denote two matrices of $\mathcal{M}_n(\mathbb{R})$. We assume that there exists a matrix $P \in \mathrm{GL}_n(\mathbb{R})$ such that $A = PBP^{-1}$ and ${}^t A = P {}^t B P^{-1}$. We write $P$ in the form $P = OS$, with $O \in \mathrm{O}(n)$ and $S \in \mathcal{S}_n^{++}(\mathbb{R})$.
a) Show that $BS^2 = S^2 B$, then that $BS = SB$.
b) Deduce that there exists $O \in \mathrm{O}(n)$ such that $A = OB {}^t O$.