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 =
\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.
