<s>[INST] What is the minimal polynomial of A? 
Let $f$ be an endomorphism of $\mathbb{R}^3$ with its matrix $A$ in the canonical basis $\mathcal{B}$ as
  $$ A = \begin{pmatrix} 3 & 1 & 1 \\ -1 & 1 & - 1 \\ 0 & 0 & 1 \end{pmatrix}.$$
  What is the minimal polynomial of $f$?

The characteristic polynomial of $f$ is: 
$$P_{f}(X) = (1 - X)(X - 2)^2.$$
The minimal polynomial $m_{f}$ is the polynomial with the least degree that  divides $P_{f}$, has the eigenvalues of $f$ as roots and $m_{f}(A) = 0$. 
In this case, we have $m_{f}(X)= (1 - X)(2 - X)$ but $m_f(f) \neq 0 $.
How can I find the minimal polynomial of $A$ and what is the fastest method to determine it?
 [/INST] The minimal polynomial and characteristic polynomial agree, which is equivalent to each eigenvalue occurring in exactly one Jordan block.
$$
R =
\left(
\begin{array}{rrr}
1 & 1  & 0 \\
-1 & -1 & 1 \\
-1 & 0 & 0
\end{array}
\right)
$$
$$
R^{-1} =
\left(
\begin{array}{rrr}
0 & 0  & -1 \\
1 & 0 & 1 \\
1 & 1 & 0
\end{array}
\right)
$$
and
$$  R^{-1} A R = J. $$
$$
J =
\left(
\begin{array}{ccc}
1 & 0  & 0 \\
0 & 2 & 1 \\
0 & 0 & 2
\end{array}
\right)
$$
The direction that is actually useful is $R J R^{-1} = A.$ Useful for finding $e^A$ or $A^{100}$ or any $f(A)$ with $f$ single-variable analytic.
$$
\left(
\begin{array}{ccc}
1 & 1  & 0 \\
-1 & -1 & 1 \\
-1 & 0 & 0
\end{array}
\right)
\left(
\begin{array}{ccc}
1 & 0  & 0 \\
0 & 2 & 1 \\
0 & 0 & 2
\end{array}
\right)
\left(
\begin{array}{rrr}
0 & 0  & -1 \\
1 & 0 & 1 \\
1 & 1 & 0
\end{array}
\right) =
\left(
\begin{array}{rrr}
3 & 1  & 1 \\
-1 & 1 & -1 \\
0 & 0 & 1
\end{array}
\right)
$$
</s>