Is a symmetric real matrix similar to a diagonal matrix through an orthogonal matrix? 
Definition
Two matrices $A$ and $B$ are said similar if there exist an inverible matrix $P$ such that
$$
B=PAP^{-1}
$$
Definition
A square matrix $A$ is said orthogonal if it is invertible and its inverse $A^{-1}$ is equals to its transpose $A^{tr}$ , that is
$$
AA^{tr}=I
$$
Theorem
Any real symmetric (square) matrix is diagonalizzable and in particular its eingevectors form an orthonormal base.

So by the last theorem we know that any real symmetric matrix is ​​similar to a diagonal matrix and in particular the base of the latter is orthonormal but unfortunately I do not able to argue if the matrix $P$ above defined is in this case orthogonal. So could someone help me, please?
 A: So basically the problem is, if $\lbrace e_1, ..., e_n \rbrace$ forms an orthonormal basis, then $P := (e_1~ ...~ e_n)$ is an orthogonal matrix. We just go by the matrix multiplication formula. Let $B := A^{tr}A$. Then for $i, j \in \lbrace 1, ..., n \rbrace$ we have:
$$
(B)_{ij} = \sum_{k = 1}^n (A^{tr})_{ik}(A)_{kj} = \sum_{k = 1}^n (A)_{ki}A_{kj} = \sum_{k = 1}^n (e_i)_k (e_j)_k = \langle e_i, e_j \rangle
$$
$\langle \cdot, \cdot \rangle$ denotes the standard scalar product in $\mathbb{R}^n$. Because of the orthonormal base property, we have $(B)_{ij} = 1$ if $i = j$ and $(B)_{ij} = 0$ if $i \neq j$.m So $B = I$. Therefore:
$$
(AA^{tr}) = B^{tr} = I^{tr} = I 
$$
A: If $M$ is a real symmetric matrix, then by the first part of the theorem, it is diagonalizable, that is
$$M = P D P^{-1}$$
where $D$ is a diagonal matrix with entries equal to the eigenvalues of $M$, and where the columns in $P$ are the corresponding eigenvectors. What we need to show is that the matrix $P$ can in fact be chosen to be orthogonal. To see this, we need the other part of the theorem, namely that $M$ has an orthonormal basis of eigenvectors. By choosing an orthonormal basis of eigenvectors, the corresponding $P$ becomes orthogonal.
