TITLE: Finding the logarithm of a matrix?
QUESTION [7 upvotes]: Find $B$ if $A=e^B$ and 
$A=\begin{bmatrix}
2&1&0\\
0&2&0\\
0&0&4\\
\end{bmatrix}$.
Besides, I would be very happy if give some general remark(Best approach). I have seen the wiki article on log of a matrix but it was too complicated(for me).

REPLY [8 votes]: You can make use of the block structure of $A$:
$$
A =
\begin{pmatrix}
C & 0 \\
0 & 4
\end{pmatrix}
= e^B
= \sum_{k=0}^\infty \frac{1}{k} B^k
\Rightarrow
B = 
\begin{bmatrix}
D & 0 \\
0 & x
\end{bmatrix}
$$
so we can assume $4 = e^x \Rightarrow x = \ln(4)$.
For the block matrices we get
$$
C =
\begin{pmatrix}
2 & 1 \\
0 & 2
\end{pmatrix}
=
e^D = \sum_{k=0}^\infty \frac{1}{k!} D^k
$$
and try an upper triangular matrix
$$
D = 
\begin{pmatrix}
y & z \\
0 & y
\end{pmatrix}
$$
and get the powers
$$
D^2 = 
\begin{pmatrix}
y & z \\
0 & y
\end{pmatrix}
\begin{pmatrix}
y & z \\
0 & y
\end{pmatrix}
=
\begin{pmatrix}
y^2 & 2 y z \\
0 & y^2
\end{pmatrix}
\\
D^3 = 
\begin{pmatrix}
y^2 & 2 y z \\
0 & y^2
\end{pmatrix}
\begin{pmatrix}
y & z \\
0 & y
\end{pmatrix}
=
\begin{pmatrix}
y^3 & 3 y^2 z \\
0 & y^3
\end{pmatrix}
\\
\vdots
\\
D^k =
\begin{pmatrix}
y^k & k y^{k-1} z \\
0 & y^k
\end{pmatrix}
\quad (k \ge 1)
$$
which suggest
$$
C =
\begin{pmatrix}
2 & 1 \\
0 & 2
\end{pmatrix}
=
e^D 
=
\begin{pmatrix}
e^y & e^y z \\
0 & e^y
\end{pmatrix}
$$
so $y = \ln(2)$ and $z = 1/e^y = 1/2$.
This gives
$$
B =
\begin{pmatrix}
\ln(2) & 1/2 & 0 \\
0 & \ln(2) & 0 \\
0 & 0 & \ln(4)
\end{pmatrix}
$$