I'm trying to understand a proof about this theorem and I find myself stuck in a step.
Let's consider two quadratic forms $\langle q, Aq \rangle$ and $\langle q, Bq \rangle$, where the first one is positive definite. We can write $A$ as $UDU^{-1}$ ($U$ is orthogonal and $D$ is diagonal). If we define $\alpha=U\sqrt{D}U^{-1}$, where $\sqrt{D}$ is the diagonal matrix whose elements are $\sqrt{D_{ii}}$. It's then easy to show that $\alpha^2=A$. Then the proof goes on showing that:
$$\alpha^T=\left(U\sqrt{D}U^{-1}\right)^T=U\sqrt{D}U^{-1}=\alpha$$
and justifies this by saying that $U$ is orthogonal. I don't get how this works. If I compute this explicitly I get:
$$\alpha^T=\left(U\sqrt{D}U^{-1}\right)^T=U^T\sqrt{D}^T\left(U^T\right)^T=U^{-1}\sqrt{D}U.$$
Now, how is it possible that in the first case $U$ and $U^{-1}$ are inverted?