Let $A$ be an $n \times n$ real symmetric matrix. Then what I know is that there exists an orthogonal matrix $P$ such that $P^{-1} A P$ is a diagonal matrix or in other words $A$ is orthogonally diagonalizable. Can we say that $P \in \text {SO}_{n} (\Bbb R)\ $ i.e. $\ P \in \text {O}_{n} (\Bbb R)$ with $\det (P) = 1\ $?
Any help in this regard will be highly appreciated. Thanks in advance.
Hint: If $\det(P) = -1$, let $p_1$ be the first column of $P$, and replace $p_1$ by $-p_1$.