Find an orthogonal matrix $M$ and diagonal matrix $D$ such that $ M^{T}AM=D$

linear algebra

Hello can you help me with that. I tried all my best but I don't know how to find $M$ orthogonal matrix
For the matrix $A=
\begin{bmatrix}
2 & 2 & -2 \\
2 & -1 & 4 \\
-2 & 4 & -1
\end{bmatrix}$

Find an orthogonal matrix $M$ and diagonal matrix $D$ such that $ M^{T}AM=D$

At first I tried to find Diagonal matrix using eigenvalues

$
\begin{bmatrix}
2 – \lambda & 2 & -2 \\
2 & -1- \lambda & 4 \\
-2 & 4 & -1- \lambda
\end{bmatrix}$

$-\lambda^3 +27\lambda -54 = -(\lambda-3)(\lambda+6)(\lambda-3)$

$\lambda_1 = 3$ $\lambda_2=3$ $\lambda_3 = 6$

$D=
\begin{bmatrix}
3 & 0 & 0 \\
0 & 3 & 0 \\
0 & 0 & -6
\end{bmatrix}$

Okay I found diagonal matrix and I also know that $A^{T} =
\begin{bmatrix}
2 & 2 & -2 \\
2 & -1 & 4 \\
-2 & 4 & -1
\end{bmatrix}$

$A^{-1}=
\begin{bmatrix}
\frac{5}{18} & \frac{1}{9} & -\frac{1}{9} \\
\frac{1}{9} & \frac{1}{9} & \frac{2}{9} \\
\frac{1}{9} & \frac{2}{9} & \frac{1}{9}
\end{bmatrix}$

Best Answer

Look for the eigenvectors corresponding to the eigenvalue $3$. You will have to solve the system$$\left\{\begin{array}{l}2x+2y-2z=3x\\2x-y+4z=3y\\-2x+4y-z=3z,\end{array}\right.$$which is equivalent to$$\left\{\begin{array}{l}-x+2y-2z=0\\2x-4y+4z=0\\-2x+4y-4z=0.\end{array}\right.$$Each of these equations is a multiple of the other two. So, you really have only one equation to deal with, say, $-x+2y-2z=0$. Take two unit vectors $(x,y,z)$ which satisfy this condition and which are orthogonal, such as $u=\left(\frac2{\sqrt5},\frac1{\sqrt5},0\right)$ and $v=\left(\frac2{3\sqrt5},-\frac4{3\sqrt5},-\frac5{3\sqrt5}\right)$. Now, take an eigenvector corresponding to the eigenvalue $-6$, which is also an unit vector; you can take, say, $w=\left(\frac13\,-\frac23,\frac23\right)$. Then you can take the matrix$$M=\begin{bmatrix}\frac2{\sqrt5}&\frac2{3\sqrt5}&\frac13\\\frac1{\sqrt5}&-\frac4{3\sqrt5}&-\frac23\\0&-\frac5{3\sqrt5}&\frac23\end{bmatrix},$$whose colmuns are the vectors $u$, $v$; and $w$.