I want to find the orthogonal matrix $\begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}$ which diagonalises the matrix $\begin{pmatrix} 0 & m\\ m & M \end{pmatrix}$.
The eigenvalues are easily found to be $\lambda = \frac{M}{2} \pm \frac{1}{2}\sqrt{M^{2}+4m^{2}}.$
However, I am having trouble finding the eigenvectors. I have the eigenvector equation
$$\begin{pmatrix} 0 & m\\ m & M \end{pmatrix} \begin{pmatrix} a \\ b \end{pmatrix} = \lambda \begin{pmatrix} a \\ b \end{pmatrix},$$
which gives me $mb = \left( \frac{M}{2} \pm \frac{1}{2}\sqrt{M^{2}+4m^{2}} \right)a$ and $ma+Mb = \left( \frac{M}{2} \pm \frac{1}{2}\sqrt{M^{2}+4m^{2}} \right)b.$
Could you help me out here?
The answer's supposed to be $\cos \theta = \frac{1}{2} \arctan \frac{2m}{M}$.