<s>[INST] Given matrix $A$, find matrix $X$ such that $e^X = A$ Given the following matrix
$$A = \begin{bmatrix} -2 & 2 & 1\\ 2 & -3 & -2\\ -5 & 6 & 4\end{bmatrix}$$
how can we show that there exists a complex matrix $X$ such that $e^X = A$.
I have struggled to find the information about workaround the problem. However, the determinant of matrix $A$ is non-zero and its eigenvalues are $-1$ and $1$.
 [/INST] The Jordan form of $A$ is given by $$J = \begin{bmatrix} -1 & 1 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & 1\end{bmatrix}$$
with $A = PJP^{-1}$ where $P = \begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & -1 \\ 1 & 0 & 2\end{bmatrix}$.
First we can try to find $\log J$ blockwise. Searching for the logarithm of $\begin{bmatrix} -1 & 1 \\ 0 & -1\end{bmatrix}$ again as some Jordan block, if we set $f(x) = e^{-x}$ then
$$\exp\left(\begin{bmatrix} i\pi & -1 \\ 0 & i\pi\end{bmatrix}\right) = f\left(\begin{bmatrix} -i\pi & 1 \\ 0 & -i\pi\end{bmatrix}\right) = \begin{bmatrix} f(-i\pi) & f'(-i\pi) \\ 0 & f(-i\pi)\end{bmatrix} = \begin{bmatrix} -1 & 1 \\ 0 & -1\end{bmatrix}$$
so we can set (clearly it's not unique)
$$\log J = \begin{bmatrix} i\pi & -1 & 0 \\ 0 & i\pi & 0 \\ 0 & 0 & 0\end{bmatrix}$$
and finally we get
$$\log A = P(\log J) P^{-1} = \begin{bmatrix} 1 & -2 & -1 \\ 0 & 0 & 0 \\ 1 & -2 & -1\end{bmatrix}+i\pi \begin{bmatrix} 1 & 0 & 0 \\ -1 & 2 & 1 \\ 2 & -2 & -1\end{bmatrix}.$$
</s>