Let $A$ be a $2\times 2$ matrix with eigenvalues $1,2$. What is $\det(A^3-3A^2+A+5I)$ Let $A$ be a $2\times 2$ matrix with eigenvalues $1,2$. What is $\det(A^3-3A^2+A+5I)$
I know that $\det(A)=$ product of eingenvalues = $2$.
I also know that since $A$ has 2 distinct eiginvalues, it is diagonalizable.
$A=UDU^T$, where $U$ is the orthogonal matrix such that $UU^T=I$, and $D$ is the diagonal matrix consists of columns of the eigeinvalues.
$$D=\begin{bmatrix}1&0\\0&2\end{bmatrix} $$
I don't know what $U$ is? If we have no information about what $A$ looks like, how can we calculate $U$, which contains the eigenvectors? 

Suppose I have $U$. Then I know that:
$A^2=UD^2U^T$, but again I have no information about what $A$ is?
 A: Since $A$ has distinct eigenvalues, $A$ is diagonalisable in a basis of eigenvectors, so
$$P^{-1}AP=\begin{bmatrix}1&0\\0&2\end{bmatrix}.$$
Denote $D$ this diagonal matrix. We have then
\begin{align}
A^3&-3A^2+A+5I=P^{-1}D^3P-3P^{-1}A^2P+P^{-1}AP+5P^{-1}IP\\
\\&=P^{-1}(D^3-3D^2+D+5I)P=P^{-1}\begin{bmatrix}1-3+1+5&0\\&8-12+2+5&0\end{bmatrix}\\
&=P^{-1}\begin{bmatrix}4&0\\0& 3\end{bmatrix}P.
\end{align}
Now use that similar matrices have equal determinants.
A: (Somewhat along the lines of @Bernard) Since $A$ is diagonalizable, it is similar to its diagonal form so write
$$
A=P\cdot D\cdot P^{-1}\, ,\qquad D=\left(\begin{array}{cc} 1&0 \\ 0&2\end{array}\right)
$$
Then clearly
$$
A^2= P\cdot D^2 \cdot P^{-1}\, ,\qquad A^n=P\cdot D^n\cdot P^{-1}
$$
and thus, for any polynomial in $A$, 
$$
\hbox{Det}(f(A))= \hbox{Det}\left(P\cdot f(D)\cdot P^{-1}\right)=
\hbox{Det}\left(f(D)\right)=f(\lambda_1)\times f(\lambda_2)
$$
by elementary properties of the determinant and $\lambda_1,\lambda_2$ the eigenvalues of $A$.  
A: By Cayley–Hamilton, $A^2-3A+2I=0$ and so $$A^3-3A^2+A+5I=A(A^2-3A+2I)-A+5I=-A+5I$$ The eigenvalues of $-A+5I$ are $-1+5=4$ and $-2+5=3$ and so $$\det(A^3-3A^2+A+5I) = \det(-A+5I) = 4 \cdot 3 = 12$$
Or you could argue directly that the eigenvalues of $P(A)$ are $P(1)$ and $P(2)$ and so $\det P(A) = P(1)P(2)$.
