Determine a matrix knowing its eigenvalues and eigenvectors 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!
 A: 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).
$$
A: 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.
A: 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}$$
