<s>[INST] Finding the Exponential of a Matrix that is not Diagonalizable Consider the $3 \times 3$ matrix
$$A =
\begin{pmatrix} 
1 & 1 & 2 \\ 
0 & 1 & -4 \\ 
0 & 0 & 1  
\end{pmatrix}.$$
I am trying to find $e^{At}$.
The only tool I have to find the exponential of a matrix is to diagonalize it. $A$'s eigenvalue is 1. Therefore, $A$ is not diagonalizable.
How does one find the exponential of a non-diagonalizable matrix?
My attempt:
Write
$\begin{pmatrix} 
1 & 1 & 2 \\ 
0 & 1 & -4 \\ 
0 & 0 & 1  
\end{pmatrix} = M  + N$,
with $M = \begin{pmatrix} 
1 & 0 & 0 \\ 
0 & 1 & 0 \\ 
0 & 0 & 1  
\end{pmatrix}$ and $N = \begin{pmatrix} 
0 & 1 & 2 \\ 
0 & 0 & -4 \\ 
0 & 0 & 0  
\end{pmatrix}$.
We have $N^3 = 0$, and therefore $\forall x > 3$, $N^x = 0$.  Thus:
$$\begin{aligned}
e^{At}
&= e^{(M+N)t} = e^{Mt} e^{Nt} \\
&= \begin{pmatrix} 
e^t & 0 & 0 \\ 
0 & e^t & 0 \\ 
0 & 0 & e^t  
\end{pmatrix} \left(I + \begin{pmatrix} 
0 & t & 2t \\ 
0 & 0 & -4t \\ 
0 & 0 & 0  
\end{pmatrix}+\begin{pmatrix} 
0 & 0 & -2t^2 \\ 
0 & 0 & 0 \\ 
0 & 0 & 0  
\end{pmatrix}\right) \\
&= e^t \begin{pmatrix} 
1 & t & 2t \\ 
0 & 1 & -4t \\ 
0 & 0 & 1  
\end{pmatrix} \\
&= \begin{pmatrix} 
e^t & te^t & 2t(1-t)e^t \\ 
0 & e^t & -4te^t \\ 
0 & 0 & e^t  
\end{pmatrix}.
\end{aligned}$$
Is that the right answer?
 [/INST] It's actually possible (though somewhat tedious) to calculate $\exp(tA)$ using the series definition.  The definition states that,
$$\exp(tA) = \sum_{n=0}^\infty \frac{t^n}{n!}A^n.$$
Now, since $\exp(tA)$ is a matrix, it is enough to find the values of $\exp(tA)e_i$ for $i=1,2,3$, where the $e_i$ are the standard basis vectors.
For $e_1$, we have
$$\exp(tA)e_1 = \sum_{n=0}^\infty \frac{t^n}{n!}A^ne_1 = \sum_{n=0}^\infty \frac{t^n}{n!} e_1 = \exp(t)e_1$$
so the first column of $\exp(tA)$ is
$$\left[ \exp(t)\quad 0\quad 0\right]^T$$
For $e_2$, we have that $Ae_2 = e_1 + e_2$, so
$$A^n e_2 = A^{n-1}e_1 + a^{n-1}e_2 = e_1 + A^{n-1}e_n = \cdots = ne_1 + e_2$$
and consequently,
$$\exp(tA)e_2 = \sum_{n=0}^\infty \frac{t^n}{n!}A^ne_2 = \sum_{n=0}^\infty \frac{t^n}{n!} ne_1 + \sum_{n=0}^\infty \frac{t^n}{n!} ne_2 = t\sum_{n=1}^\infty \frac{t^n}{(n-1)!} e_1 + \exp(t)e_2 = t\exp(t)e_1 + \exp(t)e_2$$
and the second row of the matrix is
$$\left[t\exp(t)\quad \exp(t)\quad 0\right]^T$$
Finally,
$$A e_3 = 2e_1 + -4e_2 + e_3$$
so
$$A^n e_3 = 2A^{n-1}e_1 - 4A^{n-1}e_2 + A^{n-1}e_3 = 2e_1 - 4((n-1)e_1 + e_2) + A^{n-1} e_3=\cdots$$ $$ \cdots = 2n e_1 - 4\left(\frac{n(n-1)}{2}e_1 + ne_2\right) + e_3 = -(2n^2+4n) e_1 - 4ne_2 + e_3.$$
Thus,
$$\exp(tA)e_3 = \sum_{n=0}^\infty \frac{t^n}{n!}A^ne_1 = \sum_{n=0}^\infty \frac{t^n}{n!}\left(-(2n^2-4n) e_1 - 4ne_2 + e_3\right)$$
$$ = -2\sum_{n=0}^\infty \frac{t^n}{n!}n(n-2)e_1 - 4\sum_{n=0}^\infty \frac{t^n}{n!}ne_2 + \sum_{n=0}^\infty \frac{t^n}{n!} e_3$$
$$= -2t\sum_{n=1}^\infty \frac{t^n}{(n-1)!}(n-2)e_1 -4 t\exp(t)e_2 + \exp(t)e_3$$
$$= -2t\sum_{n=0}^\infty \frac{t^n}{n!}(n-1)e_1 -4 t\exp(t)e_2 + \exp(t)e_3 $$
$$ = -2t\sum_{n=0}^\infty \frac{t^n}{n!}ne_1 + 2t\sum_{n=0}^\infty \frac{t^n}{n!}e_3 -4 t\exp(t)e_2 + \exp(t)e_3$$
$$= -2t \sum_{n=1}^\infty \frac{t^n}{(n-1)!} e_1 + 2t\exp(t)e_1 - 4t\exp(t)e_2 + \exp(t)e_3$$
$$= -2t^2 \sum_{n=0}^\infty \frac{t^n}{n!} e_1 + 2t\exp(t)e_1 - 4t\exp(t)e_2 + \exp(t)e_3$$
$$= -2t(t-1)\exp(t)e_1 -4t\exp(t)e_2 + \exp(t)e_3$$
so the final column of $\exp(tA)$ is
$$\left[-2t(t-1) \exp(t) \quad -4t\exp(t) \quad \exp(t)\right]^T$$
Thus,
$$\exp(tA) = \exp(t)\begin{bmatrix}
  1 & t & -2t(t-1)\\
  0 & 1 & -4t\\
  0 & 0 & 1\\
\end{bmatrix}$$
</s>