What Is a Matrix?

A matrix is a rectangular array of numbers arranged in rows and columns. When we write an m × n matrix, we mean m rows and n columns. Matrices appear throughout science and engineering—from describing systems of linear equations to representing transformations in graphics and physics.

A square matrix has an equal number of rows and columns. These square matrices are special because they can have eigenvalues and eigenvectors, making them candidates for diagonalization. In practical applications, square matrices often represent transformations that preserve dimension, such as rotations, reflections, or stress tensors in materials.

Diagonal Matrices and Why They Matter

A diagonal matrix contains non-zero entries only along its main diagonal; all other entries are zero:

D = [d₁ 0 0 ]
[0 d₂ 0 ]
[0 0 d₃]

Diagonal matrices are computationally elegant because:

  • Multiplying a diagonal matrix by a vector is straightforward—just scale each component.
  • Computing powers is trivial: raise each diagonal element to the power.
  • Matrix multiplication with a diagonal matrix requires far fewer operations.
  • Determinants and traces are immediate: just multiply or sum the diagonal entries.

By converting a general matrix into diagonal form, we unlock these computational advantages and gain insight into the matrix's fundamental behavior.

The Diagonalization Formula

If a matrix A is diagonalizable, it can be expressed as:

A = S · D · S⁻¹

or equivalently: D = S⁻¹ · A · S

  • A — The original square matrix
  • D — The diagonal matrix containing eigenvalues on the diagonal
  • S — The matrix whose columns are the eigenvectors of A
  • S⁻¹ — The inverse of the eigenvector matrix

Eigenvalues and Eigenvectors

The key to diagonalization lies in finding eigenvalues and eigenvectors. For a square matrix A, if a non-zero vector v and scalar λ satisfy:

A · v = λ · v

then λ is an eigenvalue and v is the corresponding eigenvector.

Geometrically, multiplying by A stretches or shrinks the eigenvector by the factor λ, without changing its direction. Finding these special vectors and their scaling factors is the foundation of the diagonalization process. For a 2×2 or 3×3 matrix, eigenvalues are found by solving the characteristic polynomial det(A − λI) = 0, and eigenvectors are found by solving (A − λI)v = 0 for each eigenvalue.

Common Pitfalls and Practical Considerations

Not every matrix can be diagonalized, and even those that can require careful handling.

  1. Not all matrices are diagonalizable — A matrix may have repeated eigenvalues with fewer independent eigenvectors than needed. This happens when geometric multiplicity is less than algebraic multiplicity. Always verify that you have enough linearly independent eigenvectors to form the matrix <strong>S</strong> before assuming diagonalization is possible.
  2. Complex eigenvalues and eigenvectors — Matrices with real entries can have complex eigenvalues and eigenvectors. When this occurs, diagonalization occurs over the complex numbers, not the reals. Your calculator will distinguish between real and complex diagonalization to clarify what type of result you're obtaining.
  3. Numerical stability in matrix inversion — Computing <strong>S</strong>⁻¹ numerically can introduce round-off errors, especially when <strong>S</strong> is nearly singular (its determinant is close to zero). For applied work, consider using decompositions like QR or SVD instead, which are more numerically stable than explicit inversion.
  4. Order matters for matrix reconstruction — When you construct <strong>S</strong>, the order of eigenvectors must match the order of corresponding eigenvalues in <strong>D</strong>. Swapping an eigenvector without swapping its eigenvalue will produce incorrect results.

Frequently Asked Questions

Why is diagonalization useful in practice?

Diagonalization simplifies matrix computations dramatically. Computing <strong>A</strong>¹⁰⁰ by repeated multiplication is slow and numerically unstable. If you diagonalize <strong>A</strong> = <strong>S</strong> · <strong>D</strong> · <strong>S</strong>⁻¹, then <strong>A</strong>¹⁰⁰ = <strong>S</strong> · <strong>D</strong>¹⁰⁰ · <strong>S</strong>⁻¹. Since <strong>D</strong> is diagonal, raising it to a power means raising each diagonal entry independently—a trivial operation. This principle extends to matrix exponentials, which appear in solutions to differential equations and stability analysis.

Can a non-square matrix be diagonalized?

No. Diagonalization, as defined here, applies only to square matrices. Non-square matrices can be analyzed using the singular value decomposition (SVD), which is a related but distinct technique. SVD works for any rectangular matrix and provides decomposition <strong>A</strong> = <strong>U</strong> · <strong>Σ</strong> · <strong>V</strong>ᵀ, where <strong>Σ</strong> is diagonal. If you're working with rectangular matrices, an SVD calculator is the appropriate tool.

What does it mean if a matrix has repeated eigenvalues?

Repeated eigenvalues complicate diagonalization. An eigenvalue with algebraic multiplicity <em>m</em> (meaning it appears <em>m</em> times as a root of the characteristic polynomial) may have geometric multiplicity less than <em>m</em> (fewer than <em>m</em> linearly independent eigenvectors). If geometric multiplicity is less than algebraic multiplicity, the matrix is not diagonalizable. Such matrices are called defective and may be analyzed using Jordan normal form instead.

How do I know if my matrix is diagonalizable before attempting the calculation?

A matrix is diagonalizable if and only if it has enough linearly independent eigenvectors to fill the columns of <strong>S</strong>. For most general matrices with distinct eigenvalues, diagonalization succeeds automatically. However, when eigenvalues repeat, you must check whether enough independent eigenvectors exist. This calculator performs that check for you and reports whether diagonalization is possible, real, or complex.

What is the difference between real and complex diagonalization?

Real diagonalization uses only real eigenvalues and eigenvectors, producing a diagonal matrix <strong>D</strong> and eigenvector matrix <strong>S</strong> with real entries. Complex diagonalization allows complex eigenvalues and eigenvectors, resulting in complex-valued <strong>D</strong> and <strong>S</strong>. A real matrix always has a complete set of eigenvalues and eigenvectors in the complex numbers. If you need only real arithmetic, you may need to use the real Jordan form or a real Schur decomposition instead.

Why is the eigenvector matrix called 'S'?

The letter 'S' traditionally denotes the similarity transformation matrix in the equation <strong>A</strong> = <strong>S</strong> · <strong>D</strong> · <strong>S</strong>⁻¹. This transformation is called a similarity transformation because matrices related by <strong>A</strong> = <strong>S</strong> · <strong>B</strong> · <strong>S</strong>⁻¹ are said to be similar. Similar matrices share important properties: same eigenvalues, same trace, same determinant, and same rank. The matrix <strong>S</strong> acts as the change-of-basis matrix from the standard basis to the eigenvector basis.

More math calculators (see all)