<s>[INST] 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!
 [/INST] 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).
$$
</s>