Determine a matrix knowing its eigenvalues and eigenvectors

Writing the matrix down in the basis defined by the eigenvalues is trivial. It's just $$ M=\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & -2 & 0 \\ 0 & 0 & 2 \end{array} \right). $$ Now, all we need is the change of basis matrix to change to the standard coordinate basis, namely: $$ S = \left( \begin{array}{ccc} 1 & 1 & -1 \\ 0 & 1 & 2 \\ -1 & 1 & -1 \\ \end{array} \right). $$ This is just the matrix whose columns are the eigenvectors. We can change to the standard coordinate bases by computing $SMS^{-1}$. We get $$ SMS^{-1} = \frac{1}{6}\left( \begin{array}{ccc} 1 & -8 & -5 \\ -8 & 4 & -8 \\ -5 & -8 & 1 \\ \end{array} \right). $$ You can check that this matrix has the desired eigensystem. For example, $$ \frac{1}{6}\left( \begin{array}{ccc} 1 & -8 & -5 \\ -8 & 4 & -8 \\ -5 & -8 & 1 \\ \end{array} \right) \left( \begin{array}{c} -1 \\ 2 \\ -1 \end{array} \right) = \left( \begin{array}{c} -2 \\ 4 \\ -2 \end{array} \right). $$


call the eigenvectors $u_1, u_2$ and $u_3$ the eigenvectors corresponding to the eigenvalues $1, -2, $ and $2.$ then $$A = 1\dfrac{u_1u_1^T}{u_1^Tu_1} - 2\dfrac{u_2u_2^T}{u_2^Tu_2} + 2\dfrac{u_3u_3^T}{u_3^Tu_3}$$

you can verify this by computing $Au_1, \cdots$. this expression for $A$ is called the spectral decomposition of a symmetric matrix.


An $n\times n$ matrix with $n$ independent eigenvectors can be expressed as $A=PDP^{-1}$, where $D$ is the diagonal matrix $\operatorname{diag}(\lambda_1\:\lambda_2\:\cdots\lambda_n)$ and $P$ is the matrix $(\vec{v}_1\:|\:\vec{v}_2\:|\cdots|\:\vec{v}_n)$ where $v_i$ is the corresponding eigenvector to $\lambda_i$.

$$D=\begin{pmatrix}1&0&0\\0&-2&0\\0&0&2\end{pmatrix}$$ $$P=\begin{pmatrix}1&0&-1\\1&1&1\\-1&2&-1\end{pmatrix}$$