## Compute the matrix exponential of a given matrix

Compute the exponential of the following matrices.

1. $A = \begin{bmatrix} 2 & -2 & 14 \\ 0 & 3 & -7 \\ 0 & 0 & 2 \end{bmatrix}$
2. $B = \begin{bmatrix} 9 & 4 & 5 \\ -4 & 0 & -3 \\ -6 & -4 & -2 \end{bmatrix}$
3. $C = \begin{bmatrix} 1 & 1 & 1 & 1 \\ 0 & 1 & 0 & -1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 1 \end{bmatrix}$

Let $P = \begin{bmatrix} -7 & -1 & -2 \\ 7 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix}$. Evidently, $P^{-1}AP = \begin{bmatrix} 2 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix}$ is in Jordan canonical form. now $P^{-1}\mathsf{exp}(A)P = \begin{bmatrix} e^2 & 0 & 0 \\ 0 & e^2 & 0 \\ 0 & 0 & e^3 \end{bmatrix}$ using this previous exercise. So $\mathsf{exp}(A) = \begin{bmatrix} e^2 & 2e^2-2e^3 & 14e^3-14e^2 \\ 0 & e^3 & 7e^2 - 7e^3 \\ 0 & 0 & e^2 \end{bmatrix}$. (WolframAlpha agrees.)

Now consider $B$; we found in this previous exercise an invertible matrix $Q$ such that $Q^{-1}BQ = \begin{bmatrix} 2 & 1 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix}$ is in Jordan canonical form. Again by this previous exercise we have $Q^{-1}\mathsf{exp}(B)Q = \begin{bmatrix} e^2 & e^2 & 0 \\ 0 & e^2 & 0 \\ 0 & 0 & e^3 \end{bmatrix}$, so that $\mathsf{exp}(B) = \begin{bmatrix} 2e^2 + 3e^3 & 4e^2 & 3e^3-e^2 \\ -2e^3 & -e^2 & e^2-2e^3 \\ -2e^2-2e^3 & -4e^2 & e^2-2e^3 \end{bmatrix}$. (WolframAlpha agrees.)

Finally, consider $C$. In this previous exercise, we exhibited an invertible matrix $R$ such that $R^{-1}CR = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \oplus \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix}$ is in Jordan canonical form. Now $R^{-1}\mathsf{exp}(C)R = \begin{bmatrix} e & e & 0 & 0 \\ 0 & e & 0 & 0 \\ 0 & 0 & e & e \\ 0 & 0 & 0 & e \end{bmatrix}$, and so $\mathsf{exp}(C) = eC$. (WolframAlpha agrees.)