Let \(A = \begin{bmatrix} 3 & -6 & 0\\ -6 & 0 & 6 \\ 0 & 6 & -3\end{bmatrix}\). We show that \(A\) is orthogonally diagonalizable by finding an orthogonal matrix \(U\) and a diagonal matrix \(D\) such that \(A = UDU^\mathsf{T}\).
The characteristic polynomial of \(A\) is \begin{eqnarray*} p_A & = & \left| \begin{array}{ccc} 3-\lambda & -6 & 0 \\ -6 & -\lambda & 6 \\ 0 & 6 & -3 -\lambda \end{array}\right| \\ & = & (3-\lambda)\left| \begin{array}{cc} -\lambda & 6\\6 & -3-\lambda\end{array}\right |- (-6)\left| \begin{array}{cc} -6 & 6\\0 & -3-\lambda\end{array}\right | \\ & =& (3-\lambda)(\lambda^2 + 3\lambda - 36) + 6(6\lambda + 18) \\ & =& -\lambda^3 + 81\lambda \\ & =& -\lambda(\lambda - 9)(\lambda + 9) \end{eqnarray*} Hence, the eigenvalues are \(0\),\(9\), and \(-9\).
The RREF of \(A\) is \(\begin{bmatrix} 1 & 0 & -1\\ 0 & 1 & -\frac{1}{2} \\ 0 & 0 & 0\end{bmatrix}\). Hence, a basis for \(N(A)\) is given by the single vector \(v_1 = \begin{bmatrix} 1 \\ \frac{1}{2} \\ 1\end{bmatrix}\). But \(v_1\cdot v_1 = \frac{9}{4}\). So we take \(u_1 = \frac{1}{\|v_1\|}v_1 = \frac{2}{3} v_1 =\begin{bmatrix} \frac{2}{3} \\ \frac{1}{3} \\ \frac{2}{3}\end{bmatrix}\).
The RREF of \(A-9 I\) is \(\begin{bmatrix} 1 & 0 & 2\\ 0 & 1 & -2 \\ 0 & 0 & 0\end{bmatrix}\). Hence, a basis for \(N(A-9 I)\) is given by the single vector \(v_2 = \begin{bmatrix} -2 \\ 2 \\ 1\end{bmatrix}\). But \(v_2\cdot v_2 = 9\). So we take \(u_2 = \frac{1}{\|v_2\|}v_2 = \frac{1}{3} v_2 =\begin{bmatrix} -\frac{2}{3} \\ \frac{2}{3} \\ \frac{1}{3}\end{bmatrix}\).
The RREF of \(A-(-9) I\) is \(\begin{bmatrix} 1 & 0 & \frac{1}{2}\\ 0 & 1 & 1 \\ 0 & 0 & 0\end{bmatrix}\). Hence, a basis for \(N(A-(-9) I)\) is given by the single vector \(v_3 = \begin{bmatrix} -\frac{1}{2} \\ -1 \\ 1\end{bmatrix}\). But \(v_3\cdot v_3 = \frac{9}{4}\). So we take \(u_3 = \frac{1}{\|v_3\|}v_3 = \frac{2}{3} v_3 =\begin{bmatrix} -\frac{1}{3} \\ -\frac{2}{3} \\ \frac{2}{3}\end{bmatrix}\).
Hence, setting \(U = \frac{1}{3} \begin{bmatrix} 2 & -2 & -1 \\ 1 & 2 & -2 \\ 2 & 1 & 2 \end{bmatrix}\) and \(D = \begin{bmatrix} 0 & 0 & 0\\0 & 9 & 0\\ 0& 0& -9 \end{bmatrix}\), we get \(A = UDU^\mathsf{T}\).