# How to find a matrix to multiply in order to get the eigenvalues?

I have a symmetric $k$ by $k$ matrix B with eigenvalues $\lambda_1,\dots \lambda_k$. I found a result in an old linear models book that says "there exists an orthogonal matrix Q such that Q'BQ= D" where D = diag($\lambda_1,\dots \lambda_k$).

My question is whether or not there is a more efficient way to determine Q than to solve the entire set of equations?

UPDATE

In the simplest case, *B*$=-\frac{\theta^2}{4+2\theta^2}\cdot$ \begin{pmatrix} 5+5\theta^2+\theta^4 & \sqrt{1+\theta^2} \\ \sqrt{1+\theta^2} & 1\end{pmatrix}

-
You don't need to open old books to find this result. – Wok Oct 30 '12 at 17:48
Do you want to solve the system by hand? What is k? Give us B. – Wok Oct 30 '12 at 17:49
@wok, I was following a different result in the old book, but thanks for the reference. I'd prefer not to solve the system by hand if possible. I have added the simplest case of B above – Gschneider Oct 30 '12 at 17:51

Yes. Find the eigenspaces, and arbitrarily take an orthonormal basis in each. These will form the columns of $Q$.
Basically you are looking at the spectral decomposition of $B=QDQ^{'}$. So what yo have to do is find the eigen vectors of the matrix $B$. Their exist many efficient numerical algorithms to do that. The two popular ones are