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 matrixD— The diagonal matrix containing eigenvalues on the diagonalS— The matrix whose columns are the eigenvectors of AS⁻¹— 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.
- 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.
- 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.
- 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.
- 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.