Orthogonality of eigenvectors with multiplcity $>1$ of a symmetric matrix

I have a question about eigenvectors corresponding to eigenvalues with an algebraic multiplicity $$>1$$. I am relatively new to linear algebra and my resources as well as my mathematical background are quite limited as I am a biologist.

The question arose because of an exercise I stumbled across, for which I unfortunately do not have the solutions. The exercise is to find eigenvalues and eigenvectors of a symmetric matrix $$\boldsymbol{E}$$ and to show that the matrix in question is diagonalizable by proving that $$\boldsymbol{P^T}\boldsymbol{E}\boldsymbol{P} = \boldsymbol{\Lambda}$$, where $$\boldsymbol{P}$$ is an orthogonal matrix and $$\boldsymbol{\Lambda}$$ is a diagonal matrix of eigenvalues.

$$E = \begin{bmatrix} -1 & -2 & 1 \\ -2 & 2 & -2 \\ 1 & -2 & -1\end{bmatrix}$$

The eigenvalues are $$det(\boldsymbol{E}-\lambda \boldsymbol{I})=0$$, which gives us $$-(\lambda + 2)^2(\lambda-4)$$ and thus we get $$\lambda_1 = -2$$ with multiplicity $$m_1 = 2$$ and $$\lambda_2 = 4$$ with $$m_2 = 1$$.

$$\boldsymbol{E} - \lambda_1 \boldsymbol{I} = \begin{bmatrix}1 &-2 & 1 \\ -2 & 4 & -2 \\ 1 & -2 & -1\end{bmatrix}$$. Since $$rank(\boldsymbol{E} - \lambda_1 \boldsymbol{I}) = 1$$, there should be 2 linearly independent eigenvectors for $$\lambda_1$$. To find the eigenvectors, I solved $$(\boldsymbol{E}-(-2)\boldsymbol{I})\vec{u}=\vec{0}$$ using the reduced matrix :$$\begin{bmatrix}1 & -2 & 1 \\ 0&0&0\\0&0&0\end{bmatrix}\begin{bmatrix}u_1 \\ u_2 \\ u_3\end{bmatrix} = \begin{bmatrix}0 \\ 0\\ 0 \end{bmatrix}$$.

Since the matrix is of rank $$1$$, the values of $$2$$ of the $$3$$ elements of the eigenvector can be chosen freely. E.g. $$u_1,u_2=1$$ and thus $$u_3=1$$, yielding $$\vec{x_1}\begin{bmatrix}1\\1\\1\end{bmatrix}$$. Next, I chose a vector $$\vec{x_2}$$ such that $$\vec{x_2} \neq c\vec{x_1}$$. One such vector is $$\vec{x_2}=\begin{bmatrix}1 \\ -2 \\ -5\end{bmatrix}$$.

For $$\lambda_2$$, we have : $$\boldsymbol{E}- \lambda\boldsymbol{I}= \begin{bmatrix} -5 & -2 & 1 \\ -2&-2&-2\\1&-2&-5\end{bmatrix}$$ which can be reduced to $$\begin{bmatrix}1 & 0 & -1 \\ 0&1&2\\0&0&0\end{bmatrix}$$.

Thus, $$u_1 = u_3$$ and $$u_2=-2u_3$$ and the resulting vector should have the form $$\vec{x_3}=\begin{bmatrix}u_3\\-2u_3\\u_3\end{bmatrix}$$. For $$u_3=1$$ I get a vector $$\vec{x_3}$$ that is orthogonal to $$\vec{x_1}$$ and $$\vec{x_2}$$. However, $$\vec{x_1}$$ and $$\vec{x_2}$$ are not orthogonal.

So this is where I start to get stuck. How can I find three orthogonal eigenvectors such that I can demonstrate that $$\boldsymbol{P^T}\boldsymbol{E}\boldsymbol{P} = \boldsymbol{\Lambda}$$.

• "According to my linear algebra book, eigenvectors of symmetric matrices should be orthogonal, regardless of whether they correspond to different eigenvalues or to an eigenvalue with multiplicity $>1$": this statement is incorrect and is unlikely to be what your book said. The correct statement is that for a symmetric matrix, there exists an orthogonal basis of eigenvectors May 19, 2021 at 13:36
• The first step where you go wrong is in selecting $\vec x_2$. It is not sufficient to have $\vec x_1^T \vec x_2 = 0$, we must also have $(E - (-2)I) \vec x_2 = 0$. May 19, 2021 at 13:40
• Thank you for the hint, I missed that. The vector should have been $\vec{x_2}=\begin{bmatrix}1 &-2&-5\end{bmatrix}$, which is then not orthogonal to $\vec{x_1}$. Is there a particularly good way to find $\vec{x_1}$, $\vec{x_2}$, and $\vec{x_3}$ such that they are orthogonal? May 19, 2021 at 17:00
• The paragraph in my book I was referring to is as follows: "Symmetric matrices have eigenvectors that are orthogonal to one another. We establish this in two cases: (1) eigenvectors corresponding to different eigenvalues, and (2) eigenvectors corresponding to a multiple eigenvalue." But that does not imply what I wrote above, I will edit it. May 19, 2021 at 17:04
• One approach is to apply the Gram-Schmidt process to the set $\{\vec x_1,\vec x_2 \}$ in order to get an orthogonal basis of the eigenspace May 19, 2021 at 19:04

Thanks to Ben Grossmann I found the solution. The set of vectors $$\vec{x_1}=\begin{bmatrix}1 \\ 1 \\ 1 \end{bmatrix},\vec{x_2}\begin{bmatrix}1 \\ -2 \\ -5 \end{bmatrix}$$, and $$\vec{x_3}\begin{bmatrix} 1 \\ -2 \\ 1 \end{bmatrix}$$ form a basis of the eigenspace. An orthonormal basis can be found by applying the Gram-Schmidt process.
First, let's start in a 1-dimensional subspace $$V_1$$, which is spanned by $$\vec{x_1}$$. The vector $$\vec{x_1}$$ can be normalized, $$\frac{\vec{x_1}}{||\vec{x_1}||} = \frac{1}{\sqrt{3}}\vec{x_1}$$. Hence, $$V_1=span(\vec{n_1})$$ as $$\vec{n_1}$$ is a linear combination of $$\vec{x_1}$$.
By adding the next vector, we get subspace $$V_2=span(\vec{n_1}, \vec{x_2})$$. The vector $$\vec{x_2}$$ can be created as a linear combination of a multiple of $$\vec{n_1}$$ ($$c \vec{n_1}=\vec{v_2}$$) and another vector ($$\vec{w_2}$$) that is orthogonal to it. The vector $$\vec{v_2}$$ is the projection of $$\vec{x_2}$$ onto $$V_1$$ ($$\text{proj}_{V_1}(\vec{x_2})$$). The projection can be described as follows: $$\text{proj}_{V_1}(\vec{x_2})=(\vec{x_2}\cdot\vec{n_1})\vec{n_1}$$.
Hence, $$\vec{w_2} = \vec{x_2}-(\vec{x_2}\cdot\vec{n_1})\vec{n_1} = \begin{bmatrix}1 \\ -2 \\ -5\end{bmatrix}-\left(\begin{bmatrix}1 \\ -2 \\ -5\end{bmatrix}\cdot \frac{1}{\sqrt{3}}\begin{bmatrix}1 \\ 1 \\ 1\end{bmatrix}\right)\frac{1}{\sqrt{3}}\begin{bmatrix}1 \\ 1 \\ 1\end{bmatrix} = \begin{bmatrix}3 \\ 0 \\ -3\end{bmatrix}$$. Normalize the new vector, $$\vec{n_2}= \frac{\vec{w_2}}{||\vec{w_2}||}=\frac{1}{\sqrt{18}}\vec{w_2}$$.
The last step is now to find the last orthogonal basis vector in the subspace $$V_3$$. $$\vec{w_3} = \vec{x_3}-(\vec{x_3}\cdot\vec{n_1})\vec{n_1}--(\vec{x_3}\cdot\vec{n_2})\vec{n_2} = \begin{bmatrix}1 \\ -2 \\ 1\end{bmatrix}-\left(0\right)\frac{1}{\sqrt{3}}\begin{bmatrix}1 \\ 1 \\ 1\end{bmatrix} - \left(0\right)\frac{1}{\sqrt{18}}\begin{bmatrix}3 \\ 0 \\ -3\end{bmatrix}= \begin{bmatrix}1 \\ -2 \\ 1\end{bmatrix}$$. And normalize, $$\vec{n_3}=\frac{1}{\sqrt{6}}\vec{w_3}$$. The orthogonal basis of the eigenspace is $$\Bigg\{\frac{1}{\sqrt{3}}\begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix},\frac{1}{\sqrt{18}}\begin{bmatrix} 3 \\ 0 \\ -3 \end{bmatrix},\frac{1}{\sqrt{6}}\begin{bmatrix} 1 \\ -2 \\ 1 \end{bmatrix}\Bigg\}$$. By constructing $$\boldsymbol{P}$$ as $$\begin{bmatrix}\vec{n_1},\vec{n_2},\vec{n_3}\end{bmatrix}$$, we get $$\boldsymbol{P^T}\boldsymbol{E}\boldsymbol{P}=\begin{bmatrix}-2 & 0 & 0\\ 0 & -2 & 0 \\ 0& 0 &4\end{bmatrix}$$.