Matrix Calculator

🌐 English
A (3×3)
Rows: 3
Cols: 3
B (3×3)
Rows: 3
Cols: 3
Supports: fractions (1/2), decimals (0.5), constants (pi, e). Empty cells are treated as 0.

Calculation Results

1. Definition & formulas

The matrix exponential of an $n\times n$ matrix $A$ is defined by the power series (which always converges):

$$ \exp(A) = e^{A} = \sum_{k=0}^{\infty} \frac{A^{k}}{k!} = I + A + \frac{A^{2}}{2!} + \frac{A^{3}}{3!} + \cdots $$

Matrix exponential is fundamental for solving linear systems of ODEs $\dot{x}=Ax$, where $x(t)=e^{tA}x(0)$.

Two useful computation methods:

  • Diagonal (or diagonalizable) case: if $A = VDV^{-1}$ with $D$ diagonal, then \[ e^{A} = V e^{D} V^{-1}, \quad e^{D} = \operatorname{diag}(e^{d_{11}},e^{d_{22}},\dots). \]
  • Simpler special matrices: for a 2×2 rotation-like matrix $\begin{pmatrix}0 & -\theta\\ \theta & 0\end{pmatrix}$, $e^{A}$ yields a rotation matrix with $\cos,\sin$ entries. For nilpotent matrices ($N^{m}=0$) the series truncates.

2. Worked examples

Example 1 — diagonal matrix (easy)

Compute $e^{A}$ for

$$ A = \begin{pmatrix}2 & 0 \\[4pt] 0 & 3\end{pmatrix} $$

Since $A$ is diagonal, $e^{A}$ is diagonal with exponentials of the diagonal entries:

$$ e^{A} = \begin{pmatrix}e^{2} & 0 \\[4pt] 0 & e^{3}\end{pmatrix}. $$

Example 2 — 2×2 rotation-like matrix

Compute $e^{A}$ for

$$ A = \begin{pmatrix}0 & -1 \\[4pt] 1 & 0\end{pmatrix} $$

This matrix represents a $90^\circ$ rotation generator. Use the series or known formula:

Because $A^{2} = -I$, $A^{3} = -A$, $A^{4}=I$, the exponential series groups into cosine and sine:

$$ e^{A} = I + A + \frac{A^{2}}{2!} + \frac{A^{3}}{3!} + \cdots = \cos(1)\,I + \sin(1)\,A. $$

Therefore

$$ e^{A} = \begin{pmatrix} \cos 1 & -\sin 1 \\[6pt] \sin 1 & \cos 1 \end{pmatrix}. $$

More generally, for $A=\begin{pmatrix}0 & -\theta\\ \theta & 0\end{pmatrix}$, $e^{A}=\begin{pmatrix}\cos\theta & -\sin\theta\\ \sin\theta & \cos\theta\end{pmatrix}$.

3. Common mistakes

  • Treating $e^{A}$ like elementwise exponential: $e^{A}\neq (e^{a_{ij}})$ in general — must use series or decomposition.
  • Assuming $e^{A+B}=e^{A}e^{B}$: this is false unless $A$ and $B$ commute ($AB=BA$).
  • Forgetting series convergence vs numerical truncation: practical computation truncates the series or uses diagonalization, Padé approximants, or scaling-and-squaring algorithms.
  • Applying diagonalization without checking: $A$ must be diagonalizable to use $V e^{D} V^{-1}$ directly; otherwise use Jordan form or other methods.
  • Mishandling complex/imaginary values: eigenvalues can be complex — exponentials will use complex exponentials (equivalently cos/sin for imaginary pairs).

4. Practice problems

Try these problems. Click Show Answer to reveal the result.

Exercise 1

$$ A = \begin{pmatrix}1 & 0 \\[4pt] 0 & 0\end{pmatrix} $$
Show Answer
$$ e^{A} = \begin{pmatrix}e & 0 \\[4pt] 0 & 1\end{pmatrix}. $$

Because $A$ is diagonal with entries $1$ and $0$.

Exercise 2

$$ A = \begin{pmatrix}0 & 1 \\[4pt] 0 & 0\end{pmatrix} $$
Show Answer
$$ A^{2} = 0\quad(\text{nilpotent}),\quad e^{A} = I + A = \begin{pmatrix}1 & 1 \\[4pt] 0 & 1\end{pmatrix}. $$

Series truncates because $A^{2}=0$.

Exercise 3

$$ A = \begin{pmatrix}2 & 0 & 0 \\[4pt] 0 & -1 & 0 \\[4pt] 0 & 0 & 0\end{pmatrix} $$
Show Answer
$$ e^{A} = \begin{pmatrix}e^{2} & 0 & 0 \\[4pt] 0 & e^{-1} & 0 \\[4pt] 0 & 0 & 1\end{pmatrix}. $$

Diagonal matrix — exponentiate each diagonal entry.

Exercise 4

$$ A = \begin{pmatrix}0 & -\pi \\[4pt] \pi & 0\end{pmatrix} $$
Show Answer

Use the rotation formula (here $\theta=\pi$):

$$ e^{A} = \begin{pmatrix}\cos\pi & -\sin\pi \\[6pt] \sin\pi & \cos\pi \end{pmatrix} = \begin{pmatrix}-1 & 0 \\[4pt] 0 & -1\end{pmatrix}. $$

This matrix generates a rotation by $\pi$, so the exponential is $-I$.


Learn matrix multiplication more easily in just 2 minutes with this free game.

Matrix Multiplication Game