TITLE: Determining a matrix from its characteristic polynomial
QUESTION [13 upvotes]: Let $A\in\mathcal{M}_{n}(K)$, where $K$ is a field. Then, we can obtain the characteristic polynomial of $A$ by simply taking $p(\lambda)=\det(A-\lambda I_n)$, which give us something like
$$p(\lambda) = (-1)^n\lambda^n + (-1)^{n-1}(\text{tr } A)\lambda^{n-1} +  \cdots + \det A$$
Now, how can we obtain the matrix $A$ knowing the characteristic polynomial?

REPLY [13 votes]: If $A$ and $S$ are $n\times n$ matrices, with $S$ invertible, then $A$ and $SAS^{-1}$ have the same characteristic polynomial. But even non similar matrices can have the same characteristic polynomial: consider
$$
\begin{bmatrix}
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix},\qquad
\begin{bmatrix}
1 & 1 & 0 \\
0 & 1 & 0 \\
0 & 0 & 1
\end{bmatrix},\qquad
\begin{bmatrix}
1 & 1 & 0 \\
0 & 1 & 1 \\
0 & 0 & 1
\end{bmatrix}
$$
So you cannot find the matrix having a given characteristic polynomial.