Exponentiation
by Matrices
How eigendecomposition turns a matrix differential equation into a closed-form solution, and what phase portraits reveal about long-run behavior. Advanced Topics Math, 2023.
Given a matrix and an initial state , the differential equation has the exact solution . The catch: computing the matrix exponential directly is expensive. Eigendecomposition provides a shortcut that reduces the problem to scalar exponentials, one per eigenvalue of .
This project builds the intuition from first principles, implements interactive phase-plane visualizations in Python, and explores how the sign and magnitude of eigenvalues dictate qualitatively different long-run behaviors.
A linear autonomous system is a differential equation of the form:
where is a constant matrix and is the state we want to find. In 2D this describes trajectories in the plane. Each point has a velocity attached to it, forming a vector field.
The exact solution is the matrix exponential:
This generalizes the scalar case: when , the solution to is .
The matrix exponential is defined by a power series:
This converges for any square matrix , but computing many matrix powers is per term — expensive. Eigendecomposition replaces those matrix multiplications with cheap scalar ones.
If , then . The matrix exponential inherits the eigenstructure of .
A nonzero vector is an eigenvector of if applying only scales it, never rotates it:
Collecting eigenvectors as columns of and eigenvalues on the diagonal of :
This holds whenever has linearly independent eigenvectors (the diagonalizable case, which covers most matrices in practice).
Substituting into the power series, every , so:
Because is diagonal, its exponential is just:
The full closed-form solution is:
In the eigenvector basis , the system decouples completely:
Each coordinate evolves independently as a scalar exponential. Coupling only reappears when projecting back into the original basis with .
Equivalently, the solution is a superposition of modes:
Each mode decays or grows along its eigenvector direction. Long-run behavior is dominated by the mode with the largest real part of .
A phase portrait overlays the vector field with solution curves for many initial conditions simultaneously. The qualitative shape — whether trajectories converge, diverge, spiral, or oscillate — is entirely determined by the eigenvalues of . Dashed lines mark eigenvector directions.
Euler's method approximates the solution by taking small linear steps along the vector field:
After steps of size :
This limit is exactly the compound-interest definition of the exponential, now applied to matrices. It connects numerical integration directly to the analytic formula.
def generate_path(x0, A, steps=1000):
fwd = [x0]
for _ in range(steps): # forward in time
fwd.append(fwd[-1] + A @ fwd[-1] / steps)
bwd = [x0]
for _ in range(steps): # backward in time
bwd.append(bwd[-1] - A @ bwd[-1] / steps)
return np.concatenate([bwd[::-1], fwd[1:]])X, Y = np.meshgrid(np.arange(-15, 16), np.arange(-15, 16)) U = A[0,0]*X + A[0,1]*Y # ẋ₁ = a₁₁x₁ + a₁₂x₂ V = A[1,0]*X + A[1,1]*Y # ẋ₂ = a₂₁x₁ + a₂₂x₂ mag = np.hypot(U, V) ax.quiver(X, Y, U/mag, V/mag, pivot='mid')
The interactive part of the project lets a user specify eigenvectors and eigenvalues directly. Given and :
The resulting is guaranteed to have exactly those eigenpairs. Flipping eigenvalue signs immediately transforms a stable phase portrait into an unstable one — making the connection between eigenvalues and long-run behavior viscerally clear.
def make_A(eigenvectors, eigenvalues):
V = np.column_stack(eigenvectors)
Lambda = np.diag(eigenvalues)
return V @ Lambda @ np.linalg.inv(V) # A = V Λ V⁻¹
# Stable node: both eigenvalues negative
A = make_A([[1, 0], [0, 1]], [-1, -3])
# → [[-1, 0],
# [ 0, -3]]
# Saddle: mixed signs
A = make_A([[1, 0], [0, 1]], [-1, 2])
# → [[-1, 0],
# [ 0, 2]]The solution to is entirely determined by the eigenstructure of . Each eigenvalue contributes a mode to the solution. Negative real parts produce decay; positive real parts produce growth; imaginary parts produce oscillation. The phase portrait makes all three readable at a glance.







