# Know eigenvalues, get $Q$ of $A=QLQ'$

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

I have calculated that the eigenvalues $\lambda=2,2,-7$.

When $\lambda=2$, the eigenvector is $X=\begin{bmatrix}-2b+2c\\ b\\ c\end{bmatrix}=k_1\begin{bmatrix}-2\\ 1\\ 0\end{bmatrix} +k_2\begin{bmatrix}2\\ 0\\ 1\end{bmatrix}$ ($k_1,k_2$ can not be both 0).

When $\lambda=-7$, the eigenvector is $X=\begin{bmatrix}-\frac{1}{2}c\\ -c\\ c\end{bmatrix}=k\begin{bmatrix}1\\ 2\\ -2\end{bmatrix}$ (k is not 0).

These are what I have.

When doing eigendecomposition, we know A=QLQ', where Q is a matrix containing eigenvectors, and

$L= \begin{bmatrix}2 & 0 & 0\\0 & 2 & 0\\0&0&-7\end{bmatrix}$.

How do I calculate Q based on the known eigenvalues and eigenvectors?

Update Matlab gives me Q

 [q,l]=eig(a)

q =

0.3333    0.9339   -0.1293
0.6667   -0.3304   -0.6681
-0.6667    0.1365   -0.7327


Write your eigenvectors into a matrix $V$: $$Q = \pmatrix{-2 & 2 & 1\\ 1 & 0 & 2 \\ 0 & 1 & -2}.$$ Then it holds $$AQ = QL$$ by definition of the eigenvectors. Hence $A = QLQ^{-1}$.
In essence: the columns of $Q$ form a basis of the vector space $\mathbb R^3$ of eigenvectors of $A$. In order to obtain such a basis, you have to find bases of all eigenspaces of $A$, which you already did.
Update: In order to obtain $A=QLQ^T$, the columns of the matrix above have be chosen to be orthonormal. First observe that the third column is already orthogonal to the first two, so the third only needs to be normalized.
Then we apply Gram-Schmidt to the vectors $$\pmatrix{-2 \\ 1 \\ 0}, \pmatrix{2 \\ 0 \\ 1},$$ leading to $$\frac1{\sqrt5}\pmatrix{-2 \\ 1 \\ 0}, \frac1{3\sqrt5}\pmatrix{2 \\ 4 \\ 5},$$ hence $$Q = \pmatrix{ \frac{-2}{\sqrt5} & \frac2{3\sqrt5} & \frac13\\ \frac1{\sqrt5} & \frac4{3\sqrt5} & \frac23\\ 0 & \frac5{3\sqrt5} & -\frac23}$$ does the trick. Note that $Q$ is not uniquely determined.
• My material says $A=QLQ'=QLQ^{-1}$. 'means transpose. It shouldn't be wrong. Probably in what situation Q inverse equals Q transpose? Also see my update, matlab gives a different q, which qlq' (I use transpose) equals A. – Gqqnbig Oct 22 '14 at 7:13
• If $A$ is symmetric (as it is in your example), then $Q$ can be taken to be orthogonal (which is the same as $Q^{-1}=Q^t$). To get such $Q$, you have to get orthonormal eigenvectors. One way to do that is to apply the Gram-Schmidt process to the eigenvectors you found. – Gerry Myerson Oct 22 '14 at 8:11
• The vector $(1/7)(2,4,5)$ does not have norm 1. – Gerry Myerson Oct 23 '14 at 0:39