Matrix Exponential and Logarithm Consider the following matrix $A$:
$A = \begin{bmatrix}
    \cos^2(1) & -\sin(2) & \sin^2(1) \\
    \cos(1)\sin(1) & \cos(2) & -\cos(1)\sin(1) \\
    \sin^2(1) & \sin(2) & \cos^2(1)\\
\end{bmatrix}$
I want to find a matrix $B$ such that $\exp(B)=A$ (or essentially finding $\log(A))$. Is there a systematic way to approach these kinds of problems? I was thinking of using some properties involving diagonalization to get to the answer, which should be (obtained using Mathematica): 
$B = \begin{bmatrix}
    0 & -2 & 0 \\
    1 & 0 & -1 \\
    0 & 2 & 0\\
\end{bmatrix}$
However, I'm not sure how to get to this result. Thank you for your help. 
 A: First check that one can diagonalize $A$, which should give something like
$$\left(
\begin{array}{ccc}
 1 & 0 & 0 \\
 0 & \frac{\cos ^2(1)-2 i \sin (1) \cos (1)-\sin ^2(1)}{\cos ^2(1)+\sin ^2(1)} & 0 \\
 0 & 0 & \frac{\cos ^2(1)+2 i \sin (1) \cos (1)-\sin ^2(1)}{\cos ^2(1)+\sin ^2(1)} \\
\end{array}
\right)$$
Calculate the matrix of eigenvectors of $A$
$$V = \left(
\begin{array}{ccc}
 -1 & i & 1 \\
 -1 & -i & 1 \\
 1 & 0 & 1 \\
\end{array}
\right)$$
Calculate the inverse
$$V^{-1} = \left(
\begin{array}{ccc}
 -\frac{1}{4} & -\frac{1}{4} & \frac{1}{2} \\
 -\frac{i}{2} & \frac{i}{2} & 0 \\
 \frac{1}{4} & \frac{1}{4} & \frac{1}{2} \\
\end{array}
\right)$$
Calculate
$$A' = (V^T)^{-1} A V^T = \left(
\begin{array}{ccc}
 -\frac{1}{4} & -\frac{1}{4} & \frac{1}{2} \\
 -\frac{i}{2} & \frac{i}{2} & 0 \\
 \frac{1}{4} & \frac{1}{4} & \frac{1}{2} \\
\end{array}
\right)^{\mathsf{T}}.\left(
\begin{array}{ccc}
 \cos ^2(1) & -\sin (2) & \sin ^2(1) \\
 \sin (1) \cos (1) & \cos (2) & \sin (1) (-\cos (1)) \\
 \sin ^2(1) & \sin (2) & \cos ^2(1) \\
\end{array}
\right).\left(
\begin{array}{ccc}
 -1 & i & 1 \\
 -1 & -i & 1 \\
 1 & 0 & 1 \\
\end{array}
\right)^{\mathsf{T}} = \left(
\begin{array}{ccc}
 (\cos (1)+i \sin (1))^2 & 0 & 0 \\
 0 & (\cos (1)-i \sin (1))^2 & 0 \\
 0 & 0 & 1 \\
\end{array}
\right)$$
then
$$\ln(A) = V^T \ln(A') (V^T)^{-1} = \left(
\begin{array}{ccc}
 -1 & i & 1 \\
 -1 & -i & 1 \\
 1 & 0 & 1 \\
\end{array}
\right)^{\mathsf{T}}.\left(
\begin{array}{ccc}
 2 i & 0 & 0 \\
 0 & -2 i & 0 \\
 0 & 0 & 0 \\
\end{array}
\right).\left(
\begin{array}{ccc}
 -\frac{1}{4} & -\frac{1}{4} & \frac{1}{2} \\
 -\frac{i}{2} & \frac{i}{2} & 0 \\
 \frac{1}{4} & \frac{1}{4} & \frac{1}{2} \\
\end{array}
\right)^{\mathsf{T}} = \left(
\begin{array}{ccc}
 0 & -2 & 0 \\
 1 & 0 & -1 \\
 0 & 2 & 0 \\
\end{array}
\right)$$
Here $\ln(A')$ means taking the natural logarithm for each diagonal entry.
A: As you correctly notice, it is enough to diagonalize $A$, and to do that you need $A$ to have three linearly independent eigenvectors. Let's see what eigenvectors $A$ has. They are quite easy to guess due to the special structure of the first and the last columns. The first one is very easy:
$$
A\left[\matrix{1\\0\\1}\right]=\left[\matrix{1\\0\\1}\right].
$$
Another two a bit harder, but not much. Let's try to change the sign for one identity and set an extra variable $x$ to get some freedom 
$$
A\left[\matrix{1\\x\\-1}\right]=\left[\matrix{\cos 2-x\sin 2\\x\cos 2+\sin 2\\-\cos 2+x\sin 2}\right]=
\left[\matrix{(\cos 2-x\sin 2)\cdot 1\\(\cos 2+x^{-1}\sin 2)\cdot x\\(\cos 2-x\sin 2)\cdot(-1)}\right]=\lambda\left[\matrix{1\\x\\-1}\right]
$$ 
which has a solution $x=\pm i$ with $\lambda=\cos 2\mp i\sin 2=e^{\mp 2i}$. The rest is simple.
A: Let $\mathcal{A}=\{\begin{pmatrix}a&-2b&c\\b&a-c&-b\\c&2b&a\end{pmatrix}|a,b,c\in\mathbb{R}\}$. We can easily show that $\mathcal{A}$ is a commutative $\mathbb{R}$-algebra of dimension $3$ and that $A\in\mathcal{A}$. Clearly $A$ has no negative eigenvalues. Then $A$ is the exponential of a real matrix and its principal logarithm $\log(A)$ exists. According to the theory of matrix functions, $B=\log(A)$ is a real polynomial in $A$ and, consequently, $B\in\mathcal{A}$.
Let $U=aI_3+bQ+cR\in \mathcal{A}$ where $Q=\begin{pmatrix}0&-2&0\\1&0&-1\\0&2&0\end{pmatrix},R=\begin{pmatrix}0&0&1\\0&-1&0\\1&0&0\end{pmatrix}$. Then $e^U=e^ae^{bQ}e^{cR}$.
We obtain $e^{bQ} = \begin{pmatrix}1/2+(1/2)\cos(2b)& -\sin(2b)&  -(1/2)\cos(2b)+1/2\\ (1/2)\sin(2b)& \cos(2b)& -(1/2)\sin(2b)\\ -(1/2)\cos(2b)+1/2& \sin(2b)& 1/2+(1/2)\cos(2b)\end{pmatrix}$ and
$e^{cR}=\begin{pmatrix}\cosh(c)&0&\sinh(c)\\0&e^{-c}&0\\\sinh(c)&0&\cosh(c)\end{pmatrix}$.
Obviously, for $B=U$,  $a=0,b=1,c=0$.
