Calculation Results
Matrix Logarithm: Definition, Formula, Examples, and Common Mistakes
The matrix logarithm \(\log(A)\) is a key matrix function frequently used in matrix equations, differential equations, control theory, quantum computing, and more. This guide explains its definition, examples, common pitfalls, and offers practice questions.
1. Definition of the Matrix Logarithm
For a square matrix \(A\), a matrix logarithm is any matrix \(X\) such that:
\[ e^X = A \]
If \(A\) has no eigenvalues on the non-positive real line, we may define the principal matrix logarithm using its infinite series:
\[ \log(A) = (A-I) - \frac{(A-I)^2}{2} + \frac{(A-I)^3}{3} - \cdots \]
For a matrix that can be diagonalized:
\[ A = P D P^{-1} \quad \Rightarrow \quad \log(A) = P \log(D) P^{-1} \]
Where \(\log(D)\) is computed by taking the logarithm of the diagonal entries.
2. Worked Examples
Example 1 (with input hint)
Input this matrix into the calculator:
e 0
0 e
Let
\[ A = \begin{bmatrix} e & 0 \\ 0 & e \end{bmatrix} \]
Since this matrix is diagonal and each entry equals \(e\):
\[ \log(A) = \begin{bmatrix} \log(e) & 0 \\ 0 & \log(e) \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \]
Example 2 (with input hint)
Input this matrix into the calculator:
1 1
0 1
Let
\[ A = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \]
This matrix is not diagonal. Use the Taylor series:
\[ A - I = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} \]
Notice:
\[ (A - I)^2 = 0 \]
Thus the series becomes:
\[ \log(A) = A - I = \begin{bmatrix} 0 & 1 \\ 0 & 0 \end{bmatrix} \]
3. Common Mistakes to Avoid
- Mistake 1: Assuming every matrix has a real logarithm. A real-valued logarithm does not always exist.
- Mistake 2: Applying logarithm element-wise. \[ \log(A) \ne \begin{bmatrix} \log(a_{11}) & \log(a_{12}) \\ \cdots \end{bmatrix} \]
- Mistake 3: Forgetting that multiple matrix logarithms can exist. Only one is the principal logarithm.
- Mistake 4: Truncating the Taylor expansion too early.
- Mistake 5: Not checking eigenvalues. The principal logarithm does not exist if eigenvalues lie on the non-positive real axis.
4. Practice Problems
Try computing the matrix logarithm for the following matrices.
Exercise 1
\[ A = \begin{bmatrix} e^2 & 0 \\ 0 & e^3 \end{bmatrix} \]
Show Answer
This matrix is diagonal:
\[ \log(A) = \begin{bmatrix} 2 & 0 \\ 0 & 3 \end{bmatrix} \]
Exercise 2
\[ A = \begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix} \]
Show Answer
\[ A - I = \begin{bmatrix} 0 & 2 \\ 0 & 0 \end{bmatrix} \Rightarrow (A - I)^2 = 0 \]
\[ \log(A) = A - I = \begin{bmatrix} 0 & 2 \\ 0 & 0 \end{bmatrix} \]
Exercise 3
\[ A = \begin{bmatrix} 4 & 0 \\ 0 & 9 \end{bmatrix} \]
Show Answer
Diagonal matrix:
\[ \log(A) = \begin{bmatrix} \log(4) & 0 \\ 0 & \log(9) \end{bmatrix} \]
Exercise 4
\[ A = \begin{bmatrix} 2 & 1 \\ 0 & 2 \end{bmatrix} \]
Show Answer
\[ A - I = \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} \] \[ (A - I)^2 = \begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix} \]
\[ \log(A) \approx (A - I) - \frac{(A - I)^2}{2} \]
\[ \log(A) \approx \begin{bmatrix} 1 & 1 \\ 0 & 1 \end{bmatrix} - \frac{1}{2} \begin{bmatrix} 1 & 2 \\ 0 & 1 \end{bmatrix} = \begin{bmatrix} 0.5 & 0 \\ 0 & 0.5 \end{bmatrix} \]
Matrix logarithms are easier to study when paired with matrix rank, SVD, and row reduction.
Copyright Notice: This article is original content from the Matrix Calculator website. Please credit the source when sharing or reproducing it. For more matrix computation tools, visit matrixcalcu.com.