<s>[INST] Exponent of Matrix A when A is not diagonalizable I want to compute the Matrix  $A^{19}$ where
$$A = \begin{pmatrix}
6&1&0\\0&6&1\\0&0&6\end{pmatrix}$$
Since the only eigenvalue of the matrix is 6, it's not diagonalizable. How do you proceed to calculate the exponent matrix of A then?
 [/INST] Let$$B=\begin{bmatrix}0&1&0\\0&0&1\\0&0&0\end{bmatrix}.$$Then $A=6\operatorname{Id}_3+B$. Besides, $6\operatorname{Id}_3$ and $B$ commute, and therefore\begin{align}A^{19}&=(6\operatorname{Id}_3+B)^{19}\\&=6^{19}\operatorname{Id}_3+19\times6^{18}B+\binom{19}26^{17}B^2\\&=\begin{bmatrix}6^{19}&19\times 6^{18}&\binom{19}26^{17}\\0&6^{19}&19\times6^{18}\\0&0&6^{19}\end{bmatrix},\end{align}since $B^n=0$ when $n>2$.
</s>