Diagonalize a matrix We have a matrix $A =
\left(
  \begin{array}{ccc}
    0 & 1 & 1 \\
    1 & 0 & 1 \\
    1 & 1 & 0 \\
  \end{array}
\right)$.
How do you find a diagonal matrix $D$ and an orthogonal matrix $P$ so that:
$D=P^tAP$?
 A: $A$ is symmetric, then you can find an orthonormal basis of ${\bf R}^3$ with eigenvectors.
Solve $\det(A-tI)=0$, find the proper values, and for each one the eigenspace.
If one of the spaces has dimension 2 you have to apply Gram-Schmidt to get an orthonormal basis, and the other basis will have one vector that you can normalize.
Then the union of the two bases is an orthonormal basis (eigenvectors of a symmetric matrix corresponding to different eigenvalues are orthogonal).
Put this basis as columns of $P$..
A: $A =
\left(
  \begin{array}{ccc}
    0 & 1 & 1 \\
    1 & 0 & 1 \\
    1 & 1 & 0 \\
  \end{array}
\right)$.
You know 
 $D =
\left(
  \begin{array}{ccc}
    2 & 0 & 0 \\
    0 & -1 & 0 \\
    0 & 0 & -1 \\
  \end{array}
\right)$.
Now,
$Ax = \lambda x$
x = 2 (Case 1)
$$Ax = 2x$$
$$Ax - 2x = 0$$
$$(A - 2I)x = 0$$
$$A -2I=
\left(
  \begin{array}{ccc}
    -2 & 1 & 1 \\
    1 & -2 & 1 \\
    1 & 1 & -2 \\
  \end{array}
\right)$$
$$\left(
  \begin{array}{ccc}
    -2 & 1 & 1 \\
    1 & -2 & 1 \\
    1 & 1 & -2 \\
  \end{array}
\right)x=0$$
Take it to echelon form you get
$$\left(
  \begin{array}{ccc}
    1 & 0 & -1 \\
    0 & 1 & -1 \\
    0 & 0 & 0 \\
  \end{array}
\right)x=0$$
Thus, if x = (a b c)'
a = b = c
Similarly, do for the rest.
