1. Introduction

The matrix logarithm appears in many parts of mathematics, applied natural sciences, and engineering. It has many applications in the study of systems theory and has received much interest in control theory (see [1], [2], and references therein).

If a matrix \(A\) has no eigenvalues on the closed negative real axis \(\mathbb{R}^{-}\), then \(A\) has a unique logarithm with eigenvalues in the set \(\lbrace z\in \mathbb{C}/-\pi<\operatorname{Im}(z)<\pi\rbrace\). This unique logarithm is called the principal logarithm of \(A\). This logarithm is of great interest and is needed in many applications.

While there are various methods for the computation of the matrix exponential, relatively few ones exist for the matrix logarithm. The exact computation of the matrix logarithm encounters considerable difficulties. Most of the methods presented for computing the matrix logarithm are approximation methods [1], [2], [3], [4].

Our motivation comes from the fact that few papers have considered exhibiting concise formulas for the matrix logarithm. It is important to point out that other methods for computing the matrix logarithm require advanced theory such as matrix square roots, Schur decompositions, and Padé approximants (see [1], [2], [5], [6], and references therein). It should be noted that there are few algorithms for computing logarithms of matrices (see, e.g., [3], [7]). Recently, Miyajima [8] proposed algorithms for numerically computing interval matrices containing the principal matrix logarithm.

In a previous work, the first-named author of this paper presented a method that, given a \(\mathcal{P}\)-canonical form of an arbitrary nonsingular \(k\times k\) matrix \(A\) with eigenvalues \(\alpha_{1},\ldots,\alpha_{k}\), permits easily obtaining both the logarithm \(B\) of \(A\) whose eigenvalues can be arbitrarily chosen in advance as \(\log(\alpha_{1}),\ldots,\log(\alpha_{k})\) and one of its \(\mathcal{P}\)-canonical forms (see Mouçouf [9]). This result is a key for obtaining our matrix logarithm formulas.

We propose simple, direct, and concise formulas to compute the logarithms and the principal logarithm of matrices without any restrictions on the norm. We note that the Putzer matrix representation of the logarithm of complex matrices [1] or real matrices [5] requires the exact computations of some rational integrals.

We also note that in the recent paper [6] the authors were interested in developing an exact computation for the principal logarithm of matrices. More precisely, under some conditions on the norm, they exactly compute the principal matrix logarithm, but in this method it is necessary to solve a system of linear recursion equations, determine the Fibonacci–Hörner decomposition of the matrix, and study the properties of generalized Fibonacci sequences and the corresponding Binet formula. In addition, their approach requires laborious calculations of some functions.

Contrary to these papers and many other papers on this subject, our method does not require any cumbersome and laborious calculations. Additionally, our approach is general. The attractive feature of our method lies in the possibility of choosing the eigenvalues of logarithms of a matrix in advance and hence easily finding the principal logarithm of matrices.

Let \(\alpha_{1},\alpha_{2},\ldots,\alpha_{s}\) be distinct elements of \(\mathbb{C}\) and \(m_{1},m_{2},\ldots,m_{s}\) be nonnegative integers. For a nonconstant polynomial \(P(x)=(x-\alpha_{1})^{m_{1}}(x-\alpha_{2})^{m_{2}}\cdots(x-\alpha_{s})^{m_{s}}\) of degree \(n\), by \(L_{jk_{j}}(x)[P]\) we denote the polynomial

$$L_{jk_{j}}(x)[P]=P_{j}(x)(x-\alpha_{j})^{k_{j}}\sum_{i=0}^{m_{j}-1-k_{j}}\frac{1}{i!}g^{(i )}_{j}(\alpha_{j})(x-\alpha_{j})^{i},$$

where \(1\leq j \leq s\), \(0\leq k_{j} \leq m_{j}-1\),

$$P_{j}(x)=\prod_{i=1,i\neq j}^{s}(x-\alpha_{i})^{m_{i}}=\frac{P(x)}{(x-\alpha_{j})^{m_{j}}}, \qquad 1\leq j \leq s,$$

and

$$g_{j}(x)=(P_{j}(x))^{-1}.$$

Here \(g^{(i)}_{j}(x)\) is the \(i\)th derivative of \(g_{j}(x)\).

These polynomials are of great importance; they were used in [10] for computing the inverse of the confluent Vandermonde matrix and in [11] for computing the matrix exponential, and they are used here to compute the logarithm of matrices.

2. Explicit Formulas for Logarithms of Matrices

In this section, we derive some explicit and elegant formulas for logarithms of matrices with the aid of Theorem 4.1 in [9].

Let us start by stating the following result needed in the sequel.

Theorem 1.

Let \(A\) be a \(k\times k\) matrix, and let \(\chi_{A}(x)=(x-\alpha_{1})^{m_{1}}(x-\alpha_{2})^{m_{2}}\cdots(x-\alpha_{s})^{m_{s}}\) , \(\alpha_{1}=0\) , be its characteristic polynomial (where one possibly has \(m_{1}=0\) ). Then

$$A^{n}=\sum_{j=0}^{m_{1}-1}\delta_{nj}B_{1j}+\sum_{j=0}^{m_{2}-1}\binom{n}{j}\alpha_{2}^{n- j}B_{2j}+\cdots+\sum_{j=0}^{m_{s}-1}\binom{n}{j}\alpha_{s}^{n-j}B_{sj}$$

for every \(n\in \mathbb{N}\) , where \(B_{jk_{j}}=L_{jk_{j}}(A)[\chi_{A}]\) and \(\delta_{nj}\) is the Kronecker symbol.

Proof.

Using Theorem \(2.9\) in [11], we can readily prove this result.

Theorem 2.

Let \(A\) be a \(k\times k\) nonsingular matrix, and let

$$\chi_{A}(x)=(x-\alpha_{1})^{m_{1}}(x-\alpha_{2})^{m_{2}}\cdots(x-\alpha_{s})^{m_{s}}$$

be its characteristic polynomial, where \(\alpha_{1}=e^{\beta_{1}},\ldots,\alpha_{s}=e^{\beta_{s}}\) . Then the matrix

$$ \sum_{p=1}^{s}\beta_{p}B_{p0}+\sum_{p=1}^{s}\sum_{j=1}^{m_{p}-1} \Big(\frac{(-1)^{j-1}}{j\alpha_{p}^{j}}\Big)B_{pj},$$
(1)

where \(B_{jk_{j}}=L_{jk_{j}}(A)[\chi_{A}]\) , is a logarithm of \(A\) .

Proof.

By Theorem 1,

$$A^{n}=\sum_{j=0}^{m_{1}-1}\binom{n}{j}e^{\beta_{1}(n-j)}B_{1j}+\cdots+\sum_{j=0}^{m_{s}-1} \binom{n}{j}e^{\beta_{s}(n-j)}B_{sj}$$

for all \(n\in \mathbb{N}\). If we insert \(t\) into this formula for \(n\), we obtain the smooth matrix function

$$A(t)=\sum_{j=0}^{m_{1}-1}\binom{t}{j}e^{\beta_{1}(t-j)}B_{1j}+\cdots+\sum_{j=0}^{m_{s}-1} \binom{t}{j}e^{\beta_{s}(t-j)}B_{sj}.$$

Since

$$\binom{t}{j}= \frac{t(t-1)\cdots(t-j+1)}{j!}$$

for all positive integer \(j\), it follows that the derivative at \(0\) of the function \(\binom{t}{j}\) is

$$\binom{t}{j}^\prime(0)=\dfrac{(-1)^{j-1}}{j}.$$

Consequently, using the convention that \(\binom{t}{0}=1\), we obtain

$$A'(0)=\sum_{p=1}^{s}\beta_{p}B_{p0}+\sum_{p=1}^{s}\sum_{j=1}^{m_{p}-1}\dfrac{(-1)^{j-1}}{j \alpha_{p}^{j}}B_{pj}.$$

Then the conclusion follows from Theorem 4.1 in [9].

As an illustration of Theorem 2, consider the following example.

Example 1.

Let

$$A=\begin{pmatrix} 3&0&0\\2&3&0\\1&4&2 \end{pmatrix}.$$

The characteristic polynomial of \(A\) is \(\chi_{A}(x)=(x-3)^{2}(x-2)\).

Applying formula (1), we find that

$$C=\ln(3)B_{10}+\ln(2)B_{20}+\frac{1}{3}B_{11}$$

is the principal logarithm of \(A\), where

$$\left \{ \begin{array}{rcl} B_{1j}&=&(A-3I)^{j}(A-2I)\displaystyle\sum_{i=0}^{1-j}(-1)^{i}(A-3I)^{i},\quad j=0,1,\\ B_{20}&=&(A-3I)^{2}. \end{array} \right.$$

A simple calculation gives

$$\left \{ \begin{array}{rcl} B_{10}&=&-A^{2}+6A-8I,\\ B_{11}&=&A^{2}-5A+6I,\\ B_{20}&=&A^{2}-6A+9I. \end{array} \right.$$

Finally, we obtain

$$C=\begin{pmatrix} \ln(3)&0&0\\ \frac{2}{3}&\ln(3)&0\\7\ln(\frac{2}{3})+\frac{8}{3}&4\ln(\frac{3}{2})&\ln(2 ) \end{pmatrix}.$$

Corollary 1.

If \(A\) is a nonsingular matrix and \(\chi_{A}(x)=(x-\alpha_{1})(x-\alpha_{2})\cdots(x-\alpha_{k})\) is its characteristic polynomial with distinct roots \(\alpha_{1}=e^{\beta_{1}},\ldots, \alpha_{k}=e^{\beta_{k}}\) , then the matrix

$$\sum_{j=1}^{k}\beta_{j}B_{j},$$

where \(B_{j}=\prod\limits_{i=1,i\neq j}^{k}\dfrac{1}{\alpha_{j}-\alpha_{i}}(A-\alpha_{i}I)\) , is a logarithm of \(A\) .

Proof.

This is a straightforward consequence of Theorem 2 and the fact that

$$B_{j0}=\prod_{i=1,i\neq j}^{k}\dfrac{1}{\alpha_{j}-\alpha_{i}}(A-\alpha_{i}I)$$

under the assumptions of the corollary.

Example 2.

To illustrate the previous corollary, we consider the same matrix as in [6],

$$A= \begin{pmatrix} 0&\frac{5}{16}&\frac{-1}{32}\\ -1&1&0\\0&0&1 \end{pmatrix}.$$

The characteristic polynomial of \(A\) is

$$\chi_{A}(x)=(x-1)\left(x-\left(\frac{1}{2}+\frac{1}{4}i\right)\right) \left(x-\left(\frac{1}{2}-\frac{1}{4}i\right)\right).$$

Let

$$\alpha_{1}=1,\qquad \alpha_{2}=\frac{1}{2}+\frac{1}{4}i, \qquad \alpha_{3}=\frac{1}{2}-\frac{1}{4}i.$$

It is clear that the eigenvalues of \(A\) are all not in \(\mathbb{R}^{-}\), and hence the principal logarithm of \(A\) exists. To obtain this logarithm, we must take the principal logarithms of \(\alpha_{1}\), \(\alpha_{2}\), and \(\alpha_{3}\), which are \(0\), \(\ln\frac{\sqrt{5}}{4}+i\arctan\frac{1}{2}\), and \(\ln\frac{\sqrt{5}}{4}-i\arctan\frac{1}{2}\), respectively. Applying the previous result, we find that

$$ B=\beta_{2}B_{2}+\beta_{3}B_{3}$$
(2)

is the principal logarithm of \(A\), where

$$\left \{ \begin{array}{rcl} B_{2}&=&\dfrac{1}{(\alpha_{2}-\alpha_{1})(\alpha_{2}-\alpha_{3})} (A-\alpha_{1}I)(A-\alpha_{3}I),\\ B_{3}&=&\dfrac{1}{(\alpha_{3}-\alpha_{1})(\alpha_{3}-\alpha_{2})}(A-\alpha_{1}I)(A-\alpha_ {2}I),\\ \beta_{2}&=&\ln\frac{\sqrt{5}}{4}+i\arctan\frac{1}{2},\\ \beta_{3}&=&\ln\frac{\sqrt{5}}{4}-i\arctan\frac{1}{2}. \end{array} \right.$$

A simple calculation gives

$$\left \{ \begin{array}{rcl} B_{2}&=&\begin{pmatrix} \frac{1}{2}+i&\frac{-5}{8}i&\frac{i}{16}\\ 2i&\frac{1}{2}-i&\frac{-1}{20}+\frac{i}{10}\\0&0&0 \end{pmatrix},\\ B_{3}&=&\begin{pmatrix} \frac{1}{2}-i&\frac{5}{8}i&-\frac{i}{16}\\ -2i&\frac{1}{2}+i&\frac{-1}{20}+\frac{-i}{10}\\0&0&0. \end{pmatrix}. \end{array} \right.$$

Substituting \(B_{2}\), \(B_{3}\), \(\beta_{2}\) and \(\beta_{3}\) by their values in (2), we obtain

$$B=\ln\bigg(\frac{\sqrt{5}}{4}\bigg)\begin{pmatrix} 1&0&0\\0&1&\frac{-1}{10}\\0&0&0 \end{pmatrix}+\arctan\bigg(\frac{1}{2}\bigg)\begin{pmatrix} -2&\frac{5}{4}&\frac{-1}{8}\\ -4&2&\frac{-1}{5}\\0&0&0 \end{pmatrix}.$$

Remark 1.

Let \(A\) be a nonsingular matrix of order \(2\), and let and \(\alpha_{1}\) and \(\alpha_{2}\) be its eigenvalues.

  1. (1)

    If \(\alpha_{1}\neq \alpha_{2},\) then \(\log(A)=\dfrac{\log(\alpha_{1})-\log(\alpha_{2})}{\alpha_{1}-\alpha_{2}}A+ \dfrac{\alpha_{1} \log(\alpha_{2})- \alpha_{2}\log(\alpha_{1})}{\alpha_{1}-\alpha_{2}}I\).

  2. (2)

    If \(\alpha_{1}=\alpha_{2}=\alpha,\) then \(\log(A)=\dfrac{1}{\alpha}A+(\log(\alpha)-1)I\).

Corollary 2.

If \(A\) is a nonsingular matrix with characteristic polynomial \(\chi_{A}(x)=(x-\alpha)^{k}\) , \(\alpha=e^{\beta}\) , then the matrix

$$\beta B_{0}+\sum_{j=1}^{k-1}\frac{(-1)^{j-1}}{j\alpha^{j}}B_{j},$$

where \(B_{j}=(A-\alpha I)^{j}\) , is a logarithm of \(A\) .

Proof.

The proof readily follows from Theorem 2.

Example 3.

For any complex number \(a\), let us calculate the logarithm of the matrix

$$A(a)= \begin{pmatrix} 1 & 0 &\cdots & 0 \\ a & 1 & \cdots & 0 \\ a^{2} &2a & \cdots & 0 \\ a^{3} &3a^{2} & \cdots & 0 \\ \binom{4}{0}a^{4} &\binom{4}{1}a^{3} & \cdots & 0 \\ \vdots & \vdots & \cdots & \vdots \\ \binom{k-1}{0}a^{k-1} & \binom{k-1}{1}a^{k-2} & \cdots & 1 \end{pmatrix}.$$

The characteristic polynomial of \(A(a)\) is \(\chi_{A(a)}(x)=(x-1)^{k}\).

In this example, we have \(\alpha=e^{0}\). Applying the previous result, we find that

$$B(a)=\sum_{j=1}^{k-1}\frac{(-1)^{j-1}}{j}(A(a)-I)^{j}$$

is the principal logarithm of \(A(a)\). We have

$$(A(a)-I)^{j}=\sum_{i=0}^{j}\binom{j}{i}(-1)^{j-i}A(a)^{i}.$$

It is easily seen that

$$A(a)^{i}=A(ia).$$

Thus,

$$(A(a)-I)^{j}=\sum_{i=0}^{j}\binom{j}{i}(-1)^{j-i}A(ia).$$

The \((l,q)\)th entry of the matrix \(A(ia)\) is

$$(A(ia))_{lq}= \left\{ \begin{array}{ll} \binom{l-1}{q-1}(ia)^{l-q} & \mbox{if $l \geq q$},\\ 0 & \mbox{otherwise}.\end{array} \right.$$

Therefore,

$$(A(a)-I)^{j})_{lq}= \left\{ \begin{array}{ll} \binom{l-1}{q-1}a^{l-q}\sum_{i=0}^{j}\binom{j}{i}(-1)^{j-i}i^{l-q} & \mbox{if $l \geq q$},\\ 0 & \mbox{otherwise}.\end{array} \right.$$

According to Euler’s formula [12], we have

$$\sum_{i=0}^{j}\binom{j}{i}(-1)^{j-i}i^{l-q}= \left\{ \begin{array}{ll} j! , & l=q+j,\\ 0, & 0\leq l-q<j.\end{array} \right.$$

Thus, the principal logarithm of \(A(a)\) is

$$B(a)=\begin{pmatrix} 0 & 0 & 0 & 0 & \cdots & 0 \\ a & 0 & 0 & 0 & \cdots & 0 \\ 0 & 2a & 0 & 0 & \cdots & 0\\ 0 & 0 & 3a & 0 & \cdots & 0 \\ \vdots & \vdots & \ddots & \ddots & \ddots & \vdots \\ 0 & 0 & \cdots & 0& (k-1)a & 0 \\ \end{pmatrix}.$$

The following interesting corollaries are a consequence of Theorem 2.

Corollary 3.

If \(\chi_{A}(x)=(x-\alpha_{1})^{m_{1}}(x-\alpha_{2})^{m_{2}}\) , where \(\alpha_{1}=e^{\beta_{1}}\) and \(\alpha_{2}=e^{\beta_{2}}\) are two distinct nonzero complex numbers, then the matrix

$$\beta_{1}B_{10}+\beta_{2}B_{20}+\sum_{j=1}^{m_{1}-1}\frac{(-1)^{j-1}}{j\alpha_{1}^{j}}B_{1 j}+\sum_{j=1}^{m_{2}-1}\frac{(-1)^{j-1}}{j\alpha_{2}^{j}}B_{2j}$$

is a logarithm of \(A\) , where

$$\left \{ \begin{array}{rcl} B_{1j}&=&(A-\alpha_{1}I)^{j}(A-\alpha_{2}I)^{m_{2}}\displaystyle \sum_{i=0}^{m_{1}-j-1}\frac{(-1)^{i}\binom{m_{2}+i-1}{m_{2}-1}}{(\alpha_{1}-\alpha_{2})^{m _{2}+i}}(A-\alpha_{1}I)^{i},\\ B_{2j}&=&(A-\alpha_{1}I)^{m_{1}}(A-\alpha_{2}I)^{j}\displaystyle \sum_{i=0}^{m_{2}-j-1}\frac{(-1)^{i}\binom{m_{1}+i-1}{m_{1}-1}}{(\alpha_{2}-\alpha_{1})^{m _{1}+i}}(A-\alpha_{2}I)^{i}. \end{array} \right.$$

Corollary 4.

If \(\chi_{A}(x)=(x-\alpha_{1})^{m_{1}}(x-\alpha_{2})\) , where \(\alpha_{1}=e^{\beta_{1}}\) and \(\alpha_{2}=e^{\beta_{2}}\) are two distinct nonzero complex numbers, then the matrix

$$\beta_{1}B_{10}+\beta_{2}B_{20}+\sum_{j=1}^{m_{1}-1}\frac{(-1)^{j-1}}{j\alpha_{1}^{j}}B_{1 j}$$

is a logarithm of \(A\) , where

$$\left \{ \begin{array}{rcl} B_{1j}&=&(A-\alpha_{1}I)^{j}(A-\alpha_{2}I)\displaystyle\sum_{i=0}^{m_{1}-j-1} \frac{(-1)^{i}}{(\alpha_{1}-\alpha_{2})^{i+1}}(A-\alpha_{1}I)^{i},\\ B_{20}&=&\displaystyle\frac{1}{(\alpha_{2}-\alpha_{1})^{m_{1}}}(A-\alpha_{1}I)^{m_{1}}. \end{array} \right.$$

More generally, we have the following result.

Corollary 5.

If \(\chi_{A}(x)=(x-\alpha_{1})^{m_{1}}\prod\limits_{j=2}^{s}(x-\alpha_{j})\) , where \(\alpha_{1}=e^{\beta_{1}},\ldots, \alpha_{s}=e^{\beta_{s}}\) are distinct nonzero complex numbers, then the matrix

$$\beta_{1}B_{10}+\sum_{j=1}^{m_{1}-1}\frac{(-1)^{j-1}}{j\alpha_{1}^{j}}B_{1j}+\sum_{j=2}^{s }\frac{\beta_{j}}{P_{j}(\alpha_{j})}P_{j}(A)$$

is a logarithm of \(A\) , where \(P=\chi_{A},\)

$$B_{1j}=(A-\alpha_{1}I)^{j}\prod\limits_{l=2}^{s}(A-\alpha_{l}I)\sum_{i=0}^{m_{1}-j-1} \sum_{l=2}^{s}\frac{(-1)^{i} a_{l}}{(\alpha_{1}-\alpha_{l})^{i+1}}(A-\alpha_{1}I)^{i},$$

and

$$\begin{aligned} \, a_{l}=\displaystyle\begin{cases} \frac{1}{\prod\limits_{p=2,p\neq l}^{s}(\alpha_{l}-\alpha_{p})} &\textit{if}\quad s\geq3,\\ 1 &\textit{if}\quad s=2. \end{cases} \end{aligned}$$

Example 4.

We now illustrate this case by computing the principal logarithm of the matrix

$$A=\begin{pmatrix} 1&2&4&1&0\\0&1&2&0&0\\0&0&2&1&0\\0&0&0&2&1\\0&0&0&2&3 \end{pmatrix}.$$

The characteristic polynomial of \(A\) is \(\chi_{A}(x)=(x-1)^{3}(x-2)(x-4)\).

Using the result of the previous corollary, we find that the matrix

$$C=B_{11}-\frac{1}{2}B_{12}+\frac{\ln(2)}{P_{2}(2)}P_{2}(A)+\frac{\ln(4)}{P_{3}(4)}P_{3}(A)$$

is the principal logarithm of \(A\). On the other hand, one can easily verify that

$$\left \{ \begin{array}{rcl} B_{11}&=&(A-I)(A-2I)(A-4I)(\frac{4}{9}A-\frac{1}{9}I),\\ B_{12}&=&\frac{1}{3}(A-I)^{2}(A-2I)(A-4I),\\ P_{2}&=&(A-I)^{3}(A-4I),\\ P_{3}&=&(A-I)^{3}(A-2I). \end{array} \right.$$

Thus, the principal logarithm of \(A\) is

$$C=\begin{pmatrix} 0&2&8\ln(2)-4&\frac{130}{27}\ln(2)-\frac{26}{9}&\frac{19}{9}-\frac{86}{27}\ln(2)\\ 0&0&2\ln(2)&\frac{11}{9}\ln(2)-\frac{4}{3}&\frac{2}{3}-\frac{7}{9}\ln(2)\\ 0&0&\ln(2)&\frac{5}{6}\ln(2)&-\frac{1}{6}\ln(2)\\ 0&0&0&\frac{2}{3}\ln(2)&\frac{2}{3}\ln(2)\\ 0&0&0&\frac{4}{3}\ln(2)&\frac{4}{3}\ln(2) \end{pmatrix}.$$

3. Conclusions

We have presented a new and elegant method to facilitate the computation of the matrix logarithm. Moreover, by using our method we provide explicit and concise formulas for the computation of the logarithm of an arbitrary complex matrix \(A\). Also, we can readily obtain simpler explicit formulas for the principal matrix logarithm.

Conflict of Interest

No potential conflicts of interest are reported by the authors.