Calculate $A^5 - 27A^3 + 65A^2$, where $A$ is the matrix defined below. If $A=\begin{bmatrix} 0 & 0 & 1 \\
3 & 1 & 0 \\ 
-2&1&4\end{bmatrix}$, find $A^5 - 27A^3 + 65A^2$
$$A=\begin{bmatrix} 0 & 0 & 1 \\
3 & 1 & 0 \\ 
-2&1&4\end{bmatrix}$$
Let $\lambda$ be its eigenvalue, then 
$$(A-\lambda I) = \begin{bmatrix} 0-\lambda & 0 & 1 \\
3 & 1-\lambda & 0 \\ 
-2&1&4-\lambda\end{bmatrix}$$
$$|A-\lambda I| = -(\lambda)^3 + 5(\lambda)^2 - 6(\lambda) +5$$
Using Cayley-Hamilton theorem
$$A^3-5^2+6A-5=0$$
How do I use this find $A^5 - 27A^3 + 65A^2$?

Let
$p(x) =x^5 -27x^3 + 65x^2; \tag 1$
one can always compute $p(A)$ directly, but perhaps the following requires less arithmetical work:
Let
$\chi(x) = x^3 - 5x^2 +6x - 5 \tag 2$
be the characteristic polynomial of $A$.
By the division algorithm for polynomials, there exist unique
$q(x), r(x) \in \Bbb Q[x] \tag 3$
such that
$p(x) = q(x)\chi(x) + r(x), \tag 4$
with either $r(x) = 0$ or $\deg r(x) < 3 = \deg \chi(x)$; thus, since
$\chi(A) = 0, \tag 5$
we have from (4)
$r(A) = p(A) - \chi(A)q(A) = p(A) - 0 \cdot q(A) = p(A); \tag 6$
thus, we compute $r(x)$ by synthetic (long) division of polynomials; it's not too much work; we find
$q(x) = x^2 + 5x - 8, \tag 7$
and
$r(x) = 73x - 40; \tag 8$
the reader may easily check that
$p(x) = x^5 - 27x^3 + 65x^2$
$= (x^2 + 5x - 8)(x^3 - 5x^2 +6x - 5) + 73 x - 40 = q(x)\chi(x) + r(x); \tag 9$
thus
$p(A) = r(A) = 73A - 40I = 73 \begin{bmatrix} 0 & 0 & 1 \\ 3 & 1 & 0 \\ -2 & 1 & 4 \end{bmatrix} - 40I = \begin{bmatrix} -40 & 0 & 73 \\ 219 & 33 & 0 \\ -146 & 73 & 252 \end{bmatrix}. \tag{10}$
