Matrix Similarity and Diagonalization Criteria

Two square matrices A and B are similar if B = P−1AP for an invertible matrix P; a matrix is diagonalizable if it is similar to a diagonal matrix, which happens exactly when it has n linearly independent eigenvectors, for instance whenever its n eigenvalues are distinct. In brief: A = [[4, 1], [2, 3]] has the eigenvalues 5 and 2 with the eigenvectors (1, 1) and (1, −2), so A = PDP−1 with P = [[1, 1], [1, −2]] and D = diag(5, 2). Then An = PDnP−1, which makes powers easy to compute.

Similarity expresses that two matrices represent the same operator in different bases. This guide defines similarity and its invariants, gives the criteria for diagonalizability, shows how to diagonalize a matrix and compute its powers, and treats symmetric matrices, with worked examples and a table.

What is matrix similarity?

A ~ B means B = P−1AP for some invertible P. Similarity is an equivalence relation (reflexive, symmetric, transitive). Similar matrices share the characteristic polynomial and so the eigenvalues, the trace, the determinant, the rank and the nullity. These invariants are necessary but not sufficient for similarity: [[2, 1], [0, 2]] and 2I have the same characteristic polynomial (λ − 2)2, trace 4, determinant 4, but they are not similar, because 2I is the only matrix similar to 2I (P−1(2I)P = 2I).

When is a matrix diagonalizable?

An n × n matrix A is diagonalizable (over a given field, usually ℝ or ℂ) if there is an invertible P with P−1AP = D diagonal. The following are equivalent:

A sufficient condition: n distinct eigenvalues. This condition is not necessary: the identity matrix has one eigenvalue but is diagonal.

How do you diagonalize a matrix?

Find the eigenvalues and a basis for each eigenspace. If the total number of basis vectors is n, put them as columns of P and the corresponding eigenvalues on the diagonal of D, in the same order. Then A = PDP−1.

Example 1: a diagonalizable matrix

A = [[4, 1], [2, 3]], with the eigenpairs (5, (1, 1)) and (2, (1, −2)). P = [[1, 1], [1, −2]], det P = −3, P−1 = (1/3) [[2, 1], [1, −1]]. Check: PD = [[5, 2], [5, −4]], and PDP−1 = (1/3) [[5 · 2 + 2 · 1, 5 · 1 − 2 · 1], [5 · 2 − 4 · 1, 5 · 1 + 4 · 1]] = (1/3) [[12, 3], [6, 9]] = [[4, 1], [2, 3]] ✓.

P = 111−2 , D = 5002 , P^−1 = (1/3) 211−1 PDP^−1 = (1/3) 12369 = 4123

Example 2: a defective matrix

N = [[2, 1], [0, 2]]: the single eigenvalue 2 has the algebraic multiplicity 2 but only one eigenvector (1, 0), so N is not diagonalizable. It is a Jordan block.

Example 3: dependence on the field

The rotation [[0, −1], [1, 0]] has the eigenvalues ±i. Over ℝ it is not diagonalizable (no real eigenvalues), but over ℂ it is similar to diag(i, −i), since the two eigenvalues are distinct.

Example 4: repeated eigenvalue, still diagonalizable

B = [[2, 0, 0], [0, 2, 0], [0, 0, 5]] is already diagonal. A less obvious example is [[3, 1, 1], [1, 3, 1], [1, 1, 3]], with the eigenvalues 5 (once) and 2 (twice, geometric multiplicity 2): the eigenspace for 2 is x + y + z = 0, which is 2-dimensional, so the matrix is diagonalizable.

How do you compute powers with diagonalization?

From A = PDP−1 we get An = PDnP−1, where Dn raises each diagonal entry to the power n. The same works for polynomials, exponentials and other functions of A.

Example 5: a formula for An

For A of Example 1: PDn = [[5n, 2n], [5n, −2 · 2n]], and An = (1/3) [[2 · 5n + 2n, 5n − 2n], [2 · 5n − 2 · 2n, 5n + 2 · 2n]]. For n = 2: (1/3) [[54, 21], [42, 33]] = [[18, 7], [14, 11]], which agrees with direct multiplication: A2 = [[16 + 2, 4 + 3], [8 + 6, 2 + 9]] = [[18, 7], [14, 11]] ✓.

Example 6: a recurrence

The Fibonacci numbers satisfy [[1, 1], [1, 0]]n = [[Fn+1, Fn], [Fn, Fn−1]]. Diagonalizing the matrix with the eigenvalues φ = (1 + √5)/2 and ψ = (1 − √5)/2 leads to Binet’s formula Fn = (φn − ψn)/√5. For n = 10: φ10 ≈ 122.9919 and ψ10 ≈ 0.0081, so F10 = 122.9838/2.2361 ≈ 55 ✓.

Why are symmetric matrices special?

The spectral theorem: every real symmetric matrix is orthogonally diagonalizable, that is A = QDQT with an orthogonal Q (orthonormal eigenvector columns) and a real diagonal D. All its eigenvalues are real, and eigenvectors of distinct eigenvalues are orthogonal. This is the basis of principal axes of conics and quadratic forms.

Example 7: orthogonal diagonalization

S = [[2, 1], [1, 2]]: the eigenvalues 3 and 1 with the eigenvectors (1, 1) and (1, −1). Normalize: Q = (1/√2) [[1, 1], [1, −1]]. Then QTSQ = diag(3, 1). The matrix Q is orthogonal, so Q−1 = QT and no inverse needs to be computed.

Table of criteria

Diagonalizability of sample matrices
Matrix Eigenvalues Eigenvectors found Diagonalizable?
[[4, 1], [2, 3]]5, 22 of 2yes (distinct eigenvalues)
[[2, 1], [0, 2]]2, 21 of 2no (defective)
[[2, 0], [0, 2]]2, 22 of 2yes (already diagonal)
[[0, −1], [1, 0]]±inone realover ℂ only
[[2, 1], [1, 2]]3, 12 orthogonalyes, orthogonally
[[0, 1], [0, 0]]0, 01 of 2no (nilpotent)

Where does the theory come from?

The reduction of a quadratic form to principal axes was known to Euler and Lagrange, and the spectral theorem for real symmetric matrices was established by Cauchy (1829). The classification of matrices up to similarity was completed by Camille Jordan in 1870 with his canonical form, and by Weierstrass and Frobenius with the theory of elementary divisors.

Which mistakes are common?

Mismatching the order of columns and eigenvalues

The k-th column of P must be an eigenvector for the k-th diagonal entry of D.

Writing PDP instead of PDP−1

The similarity is P−1AP = D, so A = PDP−1.

Equating distinct eigenvalues with a necessary condition

Distinct eigenvalues guarantee diagonalizability, but diagonalizable matrices can have repeated eigenvalues.

Concluding similarity from equal invariants

Equal characteristic polynomials, traces and determinants do not prove similarity (see the example of 2I and the Jordan block).