<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] $ A = \begin{bmatrix} 6 && 1 && 0 \\ 0 && 6 && 1 \\ 0 && 0 && 6 \end{bmatrix} $
We can express $A^n$ as follows:
$A^n = \alpha_0 I + \alpha_1 A + \alpha_2 A^2 $
The above equation is satisfied by $\lambda = 6$, i.e.
$\lambda^n = \alpha_0 + \alpha_1 \lambda + \alpha_2 \lambda^2 $
And since it is a repeated eigenvalue, we use derivatives of this last equation to obtain independent equations in the three unknowns $\alpha_0, \alpha_1, \alpha_2$, so we have
$ n \lambda^{n-1} = \alpha_1 + 2 \alpha_2 \lambda $
and
$ n(n-1) \lambda^{n-2} = 2 \alpha_2 $
Solving the above three equations for $\alpha_0, \alpha_1, \alpha_2$, we can evaluate the matrix $A^n$.
We have,
$\alpha_2 = (19)(9) (6)^{17} $
$\alpha_1 = 19 (6)^{18} - (19)(18) 6^{18} = - 323 (6)^{18}$
$\alpha_0 = (6)^{19} + (323) 6^{19} - (19)(9) 6^{19} = 153 (6)^{19}$
and we have
$A^2 = \begin{bmatrix} 6^2 && 12 && 2 \\ 0 && 6^2 && 12 \\ 0 && 0 && 6^2 \end{bmatrix} $
Putting it all together we can find the entries of $A^{19}$
$A^{19} = 153 (6)^{19} \begin{bmatrix} 1 && 0 && 0 \\ 0 && 1 && 0 \\ 0 && 0 && 1 \end{bmatrix} - 323 (6)^{18} \begin{bmatrix} 6 && 1 && 0 \\ 0 && 6 && 1 \\ 0 && 0 && 6 \end{bmatrix} + 171 (6)^{17} \begin{bmatrix} 6^2 && 12 && 2 \\ 0 && 6^2 && 12 \\ 0 && 0 && 6^2 \end{bmatrix} $
Which reduces to,
$A^{19} = \begin{bmatrix} 6^{19} && 19(6)^{18} && 57(6)^{18} \\ 0 && 6^{19} && 19 (6)^{18} \\ 0 && 0 && 6^{19} \end{bmatrix} $
</s>