Matrix Exponential Calculator
Calculate the matrix exponential eA, defined through the infinite series I + A + A2/2! + A3/3! + ⋯. The matrix exponential plays an important role in solving systems of linear differential equations and analyzing continuous-time dynamical systems.
A
Learn About Matrix Exponential
For any square matrix $\mathbf{A} \in \mathbb{R}^{n \times n}$, the matrix exponential $e^{\mathbf{A}}$ (or $\exp(\mathbf{A})$) is defined by the convergent matrix power series:
This infinite series converges absolutely and uniformly for every real or complex square matrix, establishing $e^{\mathbf{A}}$ as an analytic matrix function.
The matrix exponential is fundamentally distinct from taking the exponential of individual elements. It is an algebraic operator product that plays a central role in continuous-time dynamical systems, quantum mechanics, control theory, and Lie group theory.
Methods of Calculation
- Diagonalizable Matrices:
If $\mathbf{A}$ possesses $n$ linearly independent eigenvectors, it can be factored as $\mathbf{A} = \mathbf{P}\mathbf{D}\mathbf{P}^{-1}$ with diagonal matrix $\mathbf{D} = \operatorname{diag}(\lambda_1, \lambda_2, \dots, \lambda_n)$. The matrix exponential simplifies directly to:
- Defective Matrices (Jordan Canonical Form):
If $\mathbf{A}$ lacks sufficient linearly independent eigenvectors, it is decomposed into Jordan canonical form $\mathbf{A} = \mathbf{P}\mathbf{J}\mathbf{P}^{-1}$. For each Jordan block $\mathbf{J}_i = \lambda \mathbf{I} + \mathbf{N}$, where $\mathbf{N}$ is strictly upper-triangular nilpotent ($\mathbf{N}^k = \mathbf{0}$ for $k \ge m$):
The nilpotency terminates the series after finitely many terms.
Key Algebraic Properties
- Jacobi's Trace Formula:
Because $e^x > 0$ for all real numbers, $\det(e^{\mathbf{A}})$ is strictly positive for real matrices. Consequently, $e^{\mathbf{A}}$ is always invertible, with inverse:
The identity $e^{\mathbf{A} + \mathbf{B}} = e^{\mathbf{A}} e^{\mathbf{B}}$ holds if and only if $\mathbf{A}$ and $\mathbf{B}$ commute ($\mathbf{A}\mathbf{B} = \mathbf{B}\mathbf{A}$). When matrices do not commute, the expansion follows the Baker-Campbell-Hausdorff formula.
- Commuting Addition Law:
- Differential Equation Solution:
The homogeneous first-order vector differential equation $\frac{d\mathbf{x}}{dt} = \mathbf{A}\mathbf{x}(t)$ with initial state $\mathbf{x}(0) = \mathbf{x}_0$ has the unique analytic solution:
Worked Numerical Example
Calculate $e^{\mathbf{A}}$ for the $2 \times 2$ upper-triangular matrix:
- Find Eigenvalues and Eigenvectors:
The eigenvalues of an upper-triangular matrix are its diagonal entries:
- For $\lambda_1 = 1$: $(\mathbf{A} - \mathbf{I})\mathbf{v} = \begin{bmatrix} 0 & 1 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \mathbf{0} \implies x_2 = 0 \implies \mathbf{v}_1 = \begin{bmatrix} 1 \\ 0 \end{bmatrix}$.
- For $\lambda_2 = 2$: $(\mathbf{A} - 2\mathbf{I})\mathbf{v} = \begin{bmatrix} -1 & 1 \\ 0 & 0 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \end{bmatrix} = \mathbf{0} \implies -x_1 + x_2 = 0 \implies \mathbf{v}_2 = \begin{bmatrix} 1 \\ 1 \end{bmatrix}$.
- Construct $\mathbf{P}$, $\mathbf{D}$, and $\mathbf{P}^{-1}$:
- Compute $e^{\mathbf{D}}$:
- Multiply $\mathbf{P} e^{\mathbf{D}} \mathbf{P}^{-1}$:
- Verify Jacobi's Formula:
Why is the matrix exponential not computed element-wise?
In linear algebra, function evaluation $f(\mathbf{A})$ on matrices is defined through algebraic power series and operator calculus. An element-wise exponential $\begin{bmatrix} e^{a_{ij}} \end{bmatrix}$ fails to satisfy fundamental matrix calculus properties, such as $\frac{d}{dt} e^{\mathbf{A}t} = \mathbf{A} e^{\mathbf{A}t}$ and $\det(e^{\mathbf{A}}) = e^{\operatorname{tr}(\mathbf{A})}$.
Can a matrix exponential ever have a determinant of zero?
No. By Jacobi's formula $\det(e^{\mathbf{A}}) = e^{\operatorname{tr}(\mathbf{A})}$, the determinant of a real matrix exponential is the scalar exponential of its trace, which is strictly positive. Every matrix exponential is non-singular and has a valid inverse $(e^{\mathbf{A}})^{-1} = e^{-\mathbf{A}}$.
Does e^(A+B) always equal e^A * e^B?
No. The product rule $e^{\mathbf{A}+\mathbf{B}} = e^{\mathbf{A}}e^{\mathbf{B}}$ holds only when $\mathbf{A}$ and $\mathbf{B}$ commute ($\mathbf{A}\mathbf{B} = \mathbf{B}\mathbf{A}$). When matrices do not commute, non-zero commutator terms $[\mathbf{A}, \mathbf{B}] = \mathbf{A}\mathbf{B} - \mathbf{B}\mathbf{A}$ introduce higher-order corrections.
How is the exponential computed for defective matrices?
When a matrix cannot be diagonalized, the calculator evaluates $e^{\mathbf{A}}$ symbolically using the Jordan canonical form or the power series expansion $\sum_{k=0}^{\infty} \frac{\mathbf{A}^k}{k!}$. In numeric software like SciPy, robust algorithms employ Padé rational approximations with scaling and squaring.
- Nineteen Dubious Ways: In 1978, mathematicians Cleve Moler and Charles Van Loan published the landmark paper "Nineteen Dubious Ways to Compute the Exponential of a Matrix," demonstrating how standard textbook methods (such as direct Taylor series or Cayley-Hamilton polynomials) fail numerically due to catastrophic roundoff, cementing scaling-and-squaring with Padé approximants as the scientific standard.
- Lie Theory and Rotations: In robotics and physics, the 3D rotation group $\mathrm{SO}(3)$ is generated by exponentiating $3 \times 3$ skew-symmetric matrices $\boldsymbol{\Omega} \in \mathfrak{so}(3)$ representing instantaneous angular velocity. Rodrigues' rotation formula is precisely the closed-form matrix exponential $e^{\boldsymbol{\Omega} t} = \mathbf{I} + \frac{\sin(\theta)}{\theta}\boldsymbol{\Omega} + \frac{1 - \cos(\theta)}{\theta^2}\boldsymbol{\Omega}^2$.