How can I find an orthogonal matrix that can diagonalize the next matrix: $$M = \begin{pmatrix} \ a & b \\\ b & a \end{pmatrix}, b\ne 0.$$
Another question is how can I find the eigenvalues of this matrix $M$? I think I know the answer for this question. I need to find the characteristic polynomial and so on. Am I right?
Thanks
The eigenvectors are clearly $(1,1)$ and $(-1,1)$ because both vectors are mapped to their multiples by $M$. So, the matrix of orthonormal eigenvectors is $$ P=\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -1\\ 1 & 1 \end{pmatrix} $$ and you can easilly check that $P^{-1} M P$ is diagonal with eigenvalues $a+b$ and $a-b$ on the diagonal.