Skip to content

Chapter 64. Spectral Theorem

The spectral theorem describes the best possible form of certain linear transformations.

For a general matrix, diagonalization may fail. A matrix may lack enough eigenvectors. Its eigenvalues may be complex. Its eigenvectors may fail to be orthogonal. The spectral theorem identifies an important class of matrices for which these difficulties disappear.

For real symmetric matrices, the theorem says that every such matrix has an orthonormal basis of eigenvectors. Equivalently, every real symmetric matrix can be diagonalized by an orthogonal matrix. This is the finite-dimensional real form of the spectral theorem.

64.1 Symmetric Matrices

A real square matrix AA is symmetric if

AT=A. A^T=A.

This means that the entry in row ii, column jj, equals the entry in row jj, column ii:

aij=aji. a_{ij}=a_{ji}.

For example,

A=[2113] A= \begin{bmatrix} 2 & 1 \\ 1 & 3 \end{bmatrix}

is symmetric.

The matrix

B=[2413] B= \begin{bmatrix} 2 & 4 \\ 1 & 3 \end{bmatrix}

is not symmetric, because

b12=4 b_{12}=4

but

b21=1. b_{21}=1.

Symmetric matrices occur naturally in geometry, quadratic forms, least squares, optimization, mechanics, statistics, and graph theory.

64.2 Statement of the Real Spectral Theorem

Let AA be a real n×nn\times n symmetric matrix.

Then there exists an orthonormal basis of Rn\mathbb{R}^n consisting of eigenvectors of AA.

Equivalently, there exists an orthogonal matrix QQ and a real diagonal matrix DD such that

A=QDQT. A=QDQ^T.

Here

QTQ=I, Q^TQ=I,

so

Q1=QT. Q^{-1}=Q^T.

The columns of QQ are orthonormal eigenvectors of AA. The diagonal entries of DD are the corresponding eigenvalues.

This is stronger than ordinary diagonalization. Ordinary diagonalization gives

A=PDP1. A=PDP^{-1}.

The spectral theorem gives

A=QDQT, A=QDQ^T,

with QQ orthogonal.

64.3 Why This Is Special

A general matrix may not be diagonalizable.

For example,

[2102] \begin{bmatrix} 2 & 1 \\ 0 & 2 \end{bmatrix}

has only one independent eigenvector.

A general real matrix may also have no real eigenvectors.

For example,

[0110] \begin{bmatrix} 0 & -1 \\ 1 & 0 \end{bmatrix}

rotates the plane by 9090^\circ. Its eigenvalues are ii and i-i, so it has no real eigenvectors.

A real symmetric matrix avoids both problems. It has real eigenvalues. It has enough eigenvectors. Those eigenvectors can be chosen orthonormally.

This makes symmetric matrices one of the most important classes of matrices in linear algebra.

64.4 Orthogonal Diagonalization

A matrix AA is orthogonally diagonalizable if there exists an orthogonal matrix QQ and a diagonal matrix DD such that

A=QDQT. A=QDQ^T.

Since

Q1=QT, Q^{-1}=Q^T,

this is a special case of diagonalization:

A=QDQ1. A=QDQ^{-1}.

The advantage is numerical and geometric. Orthogonal matrices preserve lengths and angles. They do not distort the inner product.

If QQ is orthogonal, then for all vectors x,yx,y,

(Qx)(Qy)=xy. (Qx)\cdot(Qy)=x\cdot y.

Thus orthogonal diagonalization changes coordinates by a rotation or reflection, then applies independent scaling, then changes coordinates back.

64.5 Matrix Form of the Theorem

Suppose

q1,q2,,qn q_1,q_2,\ldots,q_n

are orthonormal eigenvectors of AA, with corresponding eigenvalues

λ1,λ2,,λn. \lambda_1,\lambda_2,\ldots,\lambda_n.

Let

Q=[q1q2qn]. Q= \begin{bmatrix} | & | & & | \\ q_1 & q_2 & \cdots & q_n \\ | & | & & | \end{bmatrix}.

Let

D=[λ1000λ2000λn]. D= \begin{bmatrix} \lambda_1 & 0 & \cdots & 0 \\ 0 & \lambda_2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \lambda_n \end{bmatrix}.

Then

AQ=QD. AQ=QD.

Since QQ is orthogonal,

A=QDQT. A=QDQ^T.

The order of the columns of QQ must match the order of the eigenvalues in DD.

64.6 Real Eigenvalues

A key fact behind the spectral theorem is that a real symmetric matrix has real eigenvalues.

More generally, a Hermitian matrix has real eigenvalues. A matrix AA over C\mathbb{C} is Hermitian if

A=A, A^*=A,

where AA^* is the conjugate transpose.

Suppose

Av=λv Av=\lambda v

with v0v\neq 0. If AA is real symmetric, then

vTAv v^TAv

is a real number.

Using the eigenvalue equation,

vTAv=vT(λv)=λvTv. v^TAv=v^T(\lambda v)=\lambda v^Tv.

Since

vTv>0, v^Tv>0,

the scalar λ\lambda must be real.

Over complex inner product spaces, the same argument uses

Av,v=v,Av \langle Av,v\rangle=\langle v,Av\rangle

for Hermitian operators. Hermitian operators have real eigenvalues.

64.7 Orthogonality of Eigenvectors

Another key fact is that eigenvectors belonging to distinct eigenvalues are orthogonal.

Let AA be symmetric. Suppose

Av=λv Av=\lambda v

and

Aw=μw, Aw=\mu w,

where

λμ. \lambda\neq \mu.

Using symmetry,

(Av)w=v(Aw). (Av)\cdot w = v\cdot(Aw).

Substitute the eigenvalue equations:

(λv)w=v(μw). (\lambda v)\cdot w = v\cdot(\mu w).

Thus

λ(vw)=μ(vw). \lambda(v\cdot w)=\mu(v\cdot w).

So

(λμ)(vw)=0. (\lambda-\mu)(v\cdot w)=0.

Since λμ\lambda\neq\mu,

vw=0. v\cdot w=0.

Therefore vv and ww are orthogonal.

64.8 Repeated Eigenvalues

If an eigenvalue has multiplicity greater than one, its eigenspace may have dimension greater than one.

Inside that eigenspace, every vector has the same eigenvalue. The spectral theorem says that we can choose an orthonormal basis for each eigenspace.

This is done using Gram-Schmidt orthogonalization.

Suppose

Eλ E_\lambda

has basis

v1,v2,,vk. v_1,v_2,\ldots,v_k.

Applying Gram-Schmidt produces an orthonormal basis

q1,q2,,qk q_1,q_2,\ldots,q_k

for the same eigenspace.

Since each qiq_i remains in EλE_\lambda, each qiq_i is still an eigenvector with eigenvalue λ\lambda.

Thus repeated eigenvalues cause no difficulty for symmetric matrices.

64.9 Spectral Decomposition

The spectral theorem can also be written as a sum of rank-one projections.

If

A=QDQT A=QDQ^T

with orthonormal eigenvectors

q1,,qn q_1,\ldots,q_n

and eigenvalues

λ1,,λn, \lambda_1,\ldots,\lambda_n,

then

A=λ1q1q1T+λ2q2q2T++λnqnqnT. A= \lambda_1 q_1q_1^T + \lambda_2 q_2q_2^T + \cdots + \lambda_n q_nq_n^T.

The matrix

qiqiT q_iq_i^T

is the orthogonal projection onto the line spanned by qiq_i.

Thus AA is a weighted sum of orthogonal projections. This representation is called the spectral decomposition. The finite-dimensional spectral theorem gives such a decomposition into eigenspaces or projections.

64.10 Projection Form by Eigenspaces

If the distinct eigenvalues of AA are

α1,α2,,αk, \alpha_1,\alpha_2,\ldots,\alpha_k,

then the space decomposes as an orthogonal direct sum

Rn=Eα1Eα2Eαk. \mathbb{R}^n = E_{\alpha_1} \oplus E_{\alpha_2} \oplus \cdots \oplus E_{\alpha_k}.

Let PiP_i be the orthogonal projection onto EαiE_{\alpha_i}. Then

A=α1P1+α2P2++αkPk. A= \alpha_1P_1+\alpha_2P_2+\cdots+\alpha_kP_k.

This form groups together repeated eigenvalues.

The projection matrices satisfy

PiPj=0 P_iP_j=0

for iji\neq j, and

P1+P2++Pk=I. P_1+P_2+\cdots+P_k=I.

Thus the identity decomposes into orthogonal spectral components.

64.11 Example: Orthogonal Diagonalization

Let

A=[2112]. A= \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix}.

The characteristic polynomial is

det(AλI)=det[2λ112λ]. \det(A-\lambda I) = \det \begin{bmatrix} 2-\lambda & 1 \\ 1 & 2-\lambda \end{bmatrix}.

Thus

det(AλI)=(2λ)21. \det(A-\lambda I) = (2-\lambda)^2-1.

So

λ24λ+3=0. \lambda^2-4\lambda+3=0.

The eigenvalues are

λ1=3,λ2=1. \lambda_1=3, \qquad \lambda_2=1.

For λ1=3\lambda_1=3, one eigenvector is

[11]. \begin{bmatrix} 1 \\ 1 \end{bmatrix}.

Normalize it:

q1=12[11]. q_1= \frac{1}{\sqrt2} \begin{bmatrix} 1 \\ 1 \end{bmatrix}.

For λ2=1\lambda_2=1, one eigenvector is

[11]. \begin{bmatrix} 1 \\ -1 \end{bmatrix}.

Normalize it:

q2=12[11]. q_2= \frac{1}{\sqrt2} \begin{bmatrix} 1 \\ -1 \end{bmatrix}.

Then

Q=12[1111] Q= \frac{1}{\sqrt2} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}

and

D=[3001]. D= \begin{bmatrix} 3 & 0 \\ 0 & 1 \end{bmatrix}.

The spectral theorem gives

A=QDQT. A=QDQ^T.

64.12 Checking the Example

First observe that

QTQ=I. Q^TQ=I.

Indeed,

QTQ=12[1111][1111]=[1001]. Q^TQ = \frac12 \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}.

Now compute

QDQT. QDQ^T.

Since

QDQT=12[1111][3001][1111], QDQ^T = \frac12 \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix} \begin{bmatrix} 3 & 0 \\ 0 & 1 \end{bmatrix} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix},

we get

QDQT=[2112]. QDQ^T = \begin{bmatrix} 2 & 1 \\ 1 & 2 \end{bmatrix}.

Thus

A=QDQT. A=QDQ^T.

64.13 Quadratic Forms

The spectral theorem is especially useful for quadratic forms.

A quadratic form on Rn\mathbb{R}^n has the form

xTAx, x^TAx,

where AA is symmetric.

If

A=QDQT, A=QDQ^T,

let

y=QTx. y=Q^Tx.

Since QQ is orthogonal, this is a change to orthonormal coordinates.

Then

xTAx=xTQDQTx=(QTx)TD(QTx)=yTDy. x^TAx = x^TQDQ^Tx = (Q^Tx)^TD(Q^Tx) = y^TDy.

If

D=diag(λ1,,λn), D=\operatorname{diag}(\lambda_1,\ldots,\lambda_n),

then

yTDy=λ1y12+λ2y22++λnyn2. y^TDy = \lambda_1y_1^2+\lambda_2y_2^2+\cdots+\lambda_ny_n^2.

Thus the spectral theorem removes all cross terms from a quadratic form.

64.14 Positive Definite Matrices

A symmetric matrix AA is positive definite if

xTAx>0 x^TAx>0

for every nonzero vector xx.

Using the spectral theorem,

xTAx=λ1y12++λnyn2. x^TAx = \lambda_1y_1^2+\cdots+\lambda_ny_n^2.

Therefore AA is positive definite exactly when all eigenvalues are positive.

Similarly:

Matrix typeEigenvalue condition
Positive definiteAll eigenvalues are positive
Positive semidefiniteAll eigenvalues are nonnegative
Negative definiteAll eigenvalues are negative
Negative semidefiniteAll eigenvalues are nonpositive
IndefiniteEigenvalues have both positive and negative signs

This criterion is one of the main uses of the spectral theorem in optimization and analysis.

64.15 Matrix Powers and Functions

If

A=QDQT, A=QDQ^T,

then powers of AA are easy to compute:

Ak=QDkQT. A^k=QD^kQ^T.

Since DD is diagonal,

Dk=diag(λ1k,,λnk). D^k= \operatorname{diag}(\lambda_1^k,\ldots,\lambda_n^k).

More generally, for a function ff,

f(A)=Qf(D)QT, f(A)=Qf(D)Q^T,

where

f(D)=diag(f(λ1),,f(λn)). f(D)=\operatorname{diag}(f(\lambda_1),\ldots,f(\lambda_n)).

This applies to functions such as

A1/2,eA,logA,(A+αI)1. A^{1/2}, \qquad e^A, \qquad \log A, \qquad (A+\alpha I)^{-1}.

The spectral theorem therefore reduces many matrix operations to scalar operations on eigenvalues.

64.16 Square Roots of Positive Semidefinite Matrices

If AA is symmetric positive semidefinite, all eigenvalues satisfy

λi0. \lambda_i\geq 0.

With

A=QDQT, A=QDQ^T,

define

A1/2=QD1/2QT, A^{1/2}=QD^{1/2}Q^T,

where

D1/2=diag(λ1,,λn). D^{1/2} = \operatorname{diag}(\sqrt{\lambda_1},\ldots,\sqrt{\lambda_n}).

Then

A1/2A1/2=A. A^{1/2}A^{1/2}=A.

This square root is symmetric and positive semidefinite.

Matrix square roots are used in covariance matrices, numerical analysis, optimization, and differential equations.

64.17 Singular Value Decomposition Connection

The spectral theorem applies to symmetric or Hermitian matrices. The singular value decomposition applies to every matrix.

For a real matrix BB, the matrix

BTB B^TB

is symmetric positive semidefinite. Therefore it has an orthonormal eigenbasis.

The eigenvalues of BTBB^TB are nonnegative. Their square roots are the singular values of BB.

Thus the singular value decomposition is built from the spectral theorem applied to BTBB^TB and BBTBB^T. The spectral decomposition is also commonly viewed as a special case related to the singular value decomposition.

64.18 Complex Version

Over complex vector spaces, the corresponding class is Hermitian matrices.

A matrix AA is Hermitian if

A=A. A^*=A.

The spectral theorem for Hermitian matrices states that there exists a unitary matrix UU and a real diagonal matrix DD such that

A=UDU. A=UDU^*.

Here

UU=I. U^*U=I.

The columns of UU form an orthonormal basis of eigenvectors.

More generally, every normal complex matrix is unitarily diagonalizable. A matrix is normal if

AA=AA. AA^*=A^*A.

For normal matrices, the eigenvalues may be complex, but an orthonormal eigenbasis still exists.

64.19 Spectral Theorem for Linear Transformations

Let VV be a finite-dimensional real inner product space, and let

T:VV T:V\to V

be a self-adjoint linear transformation. Self-adjoint means

Tv,w=v,Tw \langle T v,w\rangle=\langle v,Tw\rangle

for all v,wVv,w\in V.

The spectral theorem states that VV has an orthonormal basis consisting of eigenvectors of TT.

In such a basis, the matrix of TT is diagonal.

Thus the theorem is fundamentally a statement about self-adjoint transformations, not merely about arrays of numbers.

64.20 Common Errors

The first common error is to assume that every diagonalizable matrix is orthogonally diagonalizable. Orthogonal diagonalization is stronger.

The second common error is to forget symmetry. A real matrix with real eigenvalues may still fail to have orthogonal eigenvectors.

The third common error is to write

A=QDQ1 A=QDQ^{-1}

without using

Q1=QT. Q^{-1}=Q^T.

For orthogonal diagonalization, the canonical form is

A=QDQT. A=QDQ^T.

The fourth common error is to treat repeated eigenvalues as a problem. For symmetric matrices, repeated eigenspaces can always be given orthonormal bases.

The fifth common error is to ignore the distinction between real symmetric, complex Hermitian, and complex normal matrices.

64.21 Summary

The spectral theorem states that every real symmetric matrix has an orthonormal basis of eigenvectors.

Equivalently, if A=ATA=A^T, then there exists an orthogonal matrix QQ and a real diagonal matrix DD such that

A=QDQT. A=QDQ^T.

The columns of QQ are orthonormal eigenvectors. The entries of DD are eigenvalues.

The theorem makes symmetric matrices structurally transparent. It explains why quadratic forms can be diagonalized by orthogonal changes of coordinates, why positive definiteness is determined by eigenvalues, and why many matrix functions reduce to scalar functions of eigenvalues.