Q:

Orthonormal vectors for matrix solution

$\begin{bmatrix}
-\lambda  & 0 & 0 \\ 
0 & 2-\lambda & 2 \\ 
0 & 2 & 2-\lambda 
\end{bmatrix}$
I have this matrix, i know that the values to $\lambda$ for determinant be $\neq$  0 its all values, $\lambda$ $\neq$ 2 and  $\lambda$ $\neq$ 0.
To find subset of orthonormal vectors at the solution, for this matrix, what can i do?

A:

Ok, to begin, the eigenvalues are $\lambda = 0$ (repeated twice) and $4$. Check that 
$$
\det\begin{bmatrix}
-\lambda  & 0 & 0 \\ 
0 & 2-\lambda & 2 \\ 
0 & 2 & 2-\lambda 
\end{bmatrix} = -\lambda ((2-\lambda)^2 - 4) = -\lambda(\lambda^2 - 4\lambda + 4 - 4)\\
= -\lambda(\lambda^2 - 4\lambda) = -\lambda^2 (\lambda - 4)
$$
Because this matrix is symmetric, you can find an orthonormal basis of eigenvectors. If all the eigenvalues are distinct, then it happens pretty much automatically. 
More generally, if an eigenvalue is repeated (like $\lambda = 0$ in this case), you have to work a little harder, but it will still always be possible.
So, for $\lambda = 4$, find $\xi_1$ so that
$$\begin{bmatrix}
-4  & 0 & 0 \\ 
0 & -2 & 2 \\ 
0 & 2 & -2 
\end{bmatrix}\xi = 0$$
It's pretty clear that $\xi_1 = (0,1,1)^T$ is basically the only choice (up to scaling).
Now, for $\lambda = 0$, you have to find $\xi_2$ and $\xi_3$ so that
$$\begin{bmatrix}
0 & 0 & 0 \\ 
0 & 2 & 2 \\ 
0 & 2 & 2
\end{bmatrix}\xi = 0$$
Now, there are two ways to accomplish this: if the first component is non-zero, and the second and third components are zero, this works. 
Alternatively, if the second component is the opposite of the third component, that works two. 
So you'll have enough freedom to choose two linearly independent eigenvectors, and if you're clever enough, you can choose them orthogonal.
In particular $\xi_2 = (1,0,0)$ and $\xi_3 = (0,1,-1)$ work. You can also check that both of these are orthogonal to $\xi_1$. The last step is just to normalize these so that they have length $1$.

