TITLE: Determine a matrix knowing its eigenvalues and eigenvectors
QUESTION [23 upvotes]: I read through similar questions, but I couldn't find an answer to this:
How do you determine the symmetric matrix A if you know:
$\lambda_1 = 1, \  eigenvector_1 = \pmatrix{1& 0&-1}^T;$
$\lambda_2 = -2, \ eigenvector_2 = \pmatrix{1& 1& 1}^T;$
$\lambda_3 = 2,  \ eigenvector_3 = \pmatrix{-1& 2& -1}^T;$
I tried to solve it as an equation system for each line, but it didn't work somehow.
I tried to find the inverse of the eigenvectors, but it brought a wrong matrix.
Do you know how to solve it?
Thanks!

REPLY [38 votes]: 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).
$$

REPLY [11 votes]: 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}$$