Spectral Decomposition Calculator

JJ Ben-Joseph headshot JJ Ben-Joseph

What this spectral decomposition calculator does

This calculator analyzes a real 2×2 matrix by computing its eigenvalues and eigenvectors. When your input matrix is symmetric (a12 = a21), it additionally provides a true real spectral decomposition (also called the symmetric eigen-decomposition):

A = QΛQᵀ

where Q is orthogonal (its columns are orthonormal eigenvectors) and Λ is diagonal (the eigenvalues). This representation is the cleanest way to see how the matrix stretches/compresses space along perpendicular “principal directions.”

Terminology: spectral decomposition vs diagonalization

Matrix and core formulas (2×2)

Let

A= [ a11a12 a21a22 ]

The characteristic polynomial is

p(λ) = det(A − λI) = λ² − (tr A)λ + det(A)

with

The eigenvalues are the roots of the quadratic:

λ1,2 = (tr A ± √Δ) / 2, where Δ = (tr A)² − 4 det(A).

How to use the calculator

  1. Choose a preset to quickly load a common 2×2 matrix (identity, covariance-like example, saddle/indefinite, etc.), or keep Custom entries.
  2. Enter a11, a12, a21, a22. Values may be integers or decimals.
  3. If your matrix should be symmetric, enable Enforce symmetry so a21 follows a12.
  4. Click Compute spectral decomposition to see eigenvalues, eigenvectors, classification (definiteness), conditioning, and the reconstruction check.

Interpreting results

Eigenvalues (λ)

Eigenvalues tell you the scaling along eigenvector directions. For symmetric matrices they also classify the associated quadratic form:

Eigenvectors and angles

An eigenvector v satisfies Av = λv. For symmetric matrices, eigenvectors for distinct eigenvalues are orthogonal, so you can interpret the reported angle as a rotation from the standard x-axis toward the principal direction.

QΛQᵀ reconstruction (symmetric case)

If the matrix is symmetric and has a real orthonormal eigenbasis, the tool can build:

If you see a tiny mismatch, that is usually normal numeric error; large mismatch suggests the matrix is not symmetric, not diagonalizable in the assumed form, or is ill-conditioned.

Conditioning (2×2 intuition)

For symmetric positive definite matrices, a common condition number proxy is κ ≈ |λmax| / |λmin|. Large ratios mean the matrix squashes strongly in one direction compared to another, and small perturbations can change computed eigenvectors noticeably.

Worked example (symmetric covariance-like matrix)

Use the matrix:

A = [ 3 1.5; 1.5 2 ]

Because A is symmetric, a real spectral decomposition exists. The calculator will report two real eigenvalues, one larger (the “principal variance”) and one smaller. The first eigenvector’s angle indicates the direction of maximum stretch/variance; the second is perpendicular. Since both eigenvalues are positive, the classification reads positive definite. The condition number (largest divided by smallest eigenvalue) indicates how elongated the associated ellipse is.

Comparison table: common 2×2 cases

Case Eigenvalues Eigenvectors Decomposition you can expect Typical notes
Symmetric, distinct eigenvalues Real, λ1 ≠ λ2 Two orthogonal eigenvectors A = QΛQᵀ with Q orthogonal Most stable/standard “spectral decomposition” setting
Symmetric, repeated eigenvalue Real, λ1 = λ2 Eigenvectors not unique A = QΛQᵀ still valid Angle/eigenvector direction may change with tiny perturbations
Non-symmetric, real distinct eigenvalues May be real Not necessarily orthogonal Possibly A = PΛP⁻¹ (if diagonalizable) “QΛQᵀ” generally does not apply
Non-symmetric, complex eigenvalues Complex conjugate pair Complex eigenvectors No real diagonalization / no real spectral form Often corresponds to rotation/spiral behavior in dynamics

Assumptions & limitations

Enter the matrix entries or choose a preset to begin.

Embed this calculator

Copy and paste the HTML below to add the Spectral Decomposition Calculator (2×2) — Eigenvalues, Eigenvectors... to your website.