Orthogonally diagonalize matrix?

72 Views Asked by At

Find matrix P that orthogonally diagonalizes C. $$ C= \begin{pmatrix} 1&2&0\\2&1&0\\ 0&0&5\\ \end{pmatrix} $$

I have worked through this problem by taking the eigenvectors and then normalizing the answer. The answer I get is

$$ P= \begin{pmatrix} -1/\sqrt2&1/\sqrt2&0\\1/\sqrt2&1/\sqrt2&0\\ 0&0&1\\ \end{pmatrix} $$

My book though gives the following answer of

$$ P= \begin{pmatrix} 1/\sqrt2&1/\sqrt2&0\\1/\sqrt2&-1/\sqrt2&0\\ 0&0&1\\ \end{pmatrix} $$

The eigenvalues I got were $5,3,$and $-1$. The eigenvectors and normalization I got were $(0,0,1)=(0,0,1)$ $(1,1,0)=(1/\sqrt2,1/\sqrt2,0)$ and $(-1,1,0)=(-1/\sqrt2,1/\sqrt2,0)$.

Which one is correct?, if any.