Skip to content
VidiMaster it, module by module
Module 5/Symmetric Matrices & the Spectral Theorem

The Spectral Theorem

A real square matrix can be diagonalized by an orthogonal change of basis exactly when it is symmetric. The Spectral Theorem (Theorem 9.1) packages a symmetric AA as A=QDQT=QDQ−1A=QDQ^{T}=QDQ^{-1}, where DD holds the (always real) eigenvalues and the columns of the orthogonal matrix QQ form an orthonormal eigenbasis. This lesson shows why symmetry is the exact dividing line, and how to build QQ and DD in practice.

Before you start — give these a try

Attempting first primes your brain for the lesson — even if you miss. Nothing is graded or saved; it's just a warm-up.

The matrix A=[5222]A=\begin{bmatrix}5&2\\2&2\end{bmatrix} is symmetric, hence orthogonally diagonalizable. Find its smaller eigenvalue.

For the symmetric matrix A=[3449]A=\begin{bmatrix}3&4\\4&9\end{bmatrix}, enter its two eigenvalues as a vector in increasing order (λmin⁡,λmax⁡)(\lambda_{\min},\lambda_{\max}).

What you’ll be able to do

  • State Definition 9.1: AA is orthogonally diagonalizable when some orthogonal matrix QQ (written SS in the course notes) makes QTAQ=Q−1AQQ^{T}AQ=Q^{-1}AQ diagonal, and recognise that this happens exactly when AA has an orthonormal eigenbasis.
  • Apply the Spectral Theorem (Theorem 9.1): a real square matrix is orthogonally diagonalizable if and only if it is symmetric (AT=AA^{T}=A), so a single symmetry check settles the question.
  • Explain both directions: orthogonally diagonalizable ⇒\Rightarrow symmetric (Remark 9.1, since A=QDQT⇒AT=AA=QDQ^{T}\Rightarrow A^{T}=A), and symmetric ++ diagonalizable ⇒\Rightarrow orthogonally diagonalizable (Proposition 9.1), using that eigenspaces for distinct eigenvalues are orthogonal (Lemma 9.1).
  • Construct QQ and DD from a symmetric matrix (Remark 9.3): find the real eigenvalues, produce an orthonormal eigenbasis (normalise each eigenvector, Gram--Schmidt within a repeated eigenspace), put those vectors in the columns of QQ and the matching eigenvalues on the diagonal of DD.
  • Use and verify the spectral decomposition A=QDQTA=QDQ^{T}: reconstruct AA from QQ and DD, check QTQ=IQ^{T}Q=I, and remember that QQ is not unique (eigenvector columns may be sign-flipped, reordered, or rotated inside a repeated eigenspace) while DD is fixed up to the order of its entries.

In your course

· MATH2015 · Linear Algebra & Probability
§9.1 The Spectral Theorem
  • Definition 9.1Orthogonally diagonalizable
    AA is orthogonally diagonalizable if there is an orthogonal QQ (notes: SS) with Q−1AQ=QTAQQ^{-1}AQ=Q^{T}AQ diagonal; equivalently AA has an orthonormal eigenbasis.
  • Remark 9.1Orthogonally diagonalizable matrices are symmetric
    A=QDQT⇒AT=QDTQT=QDQT=AA=QDQ^{T}\Rightarrow A^{T}=QD^{T}Q^{T}=QDQ^{T}=A.
  • Theorem 9.1Spectral Theorem
    A real n×nn\times n matrix is orthogonally diagonalizable if and only if it is symmetric.
  • Lemma 9.1Eigenspaces of a symmetric matrix are orthogonal
    Eigenvectors for distinct eigenvalues of a symmetric matrix are orthogonal.
  • Proposition 9.1Symmetric and diagonalizable implies orthogonally diagonalizable
  • Proposition 9.2A symmetric n-by-n matrix has n real eigenvalues (with multiplicity)
  • Lemma 9.2For an eigenvector vv of symmetric AA, span⁡(v)⊥\operatorname{span}(v)^{\perp} is an AA-invariant (n−1)(n-1)-dimensional subspace
  • Remark 9.3Building the orthogonal diagonalizing matrix
The course notes denote the orthogonal diagonalizing matrix by SS in Definition 9.1; this lesson follows the common convention and writes it QQ, with A=QDQT=QDQ−1A=QDQ^{T}=QDQ^{-1}. Remarks 9.1--9.3 and Lemmas 9.1--9.2 are the supporting results of the section (the OCR source renders λ\lambda, ∈\in, ×\times, ⊥\perp, ∥⋅∥\|\cdot\| and −1^{-1} as corrupted glyphs; they have been restored here).
1

Orthogonal diagonalization: the definition

Recall that an orthogonal matrix QQ is a square matrix with orthonormal columns, equivalently QTQ=IQ^{T}Q=I, so that Q−1=QTQ^{-1}=Q^{T}. A matrix AA is orthogonally diagonalizable when there is an orthogonal QQ for which QTAQ=Q−1AQ=DQ^{T}AQ=Q^{-1}AQ=D is diagonal (Definition 9.1; the course notes call this matrix SS). Rearranging gives the spectral decomposition A=QDQT=QDQ−1.A=QDQ^{T}=QDQ^{-1}. Reading the equation AQ=QDAQ=QD column by column shows exactly what QQ and DD contain: the ii-th column qi\mathbf{q}_i of QQ satisfies Aqi=diqiA\mathbf{q}_i=d_i\mathbf{q}_i, so the columns of QQ are eigenvectors of AA and the diagonal entries of DD are the corresponding eigenvalues. Because the columns of QQ are orthonormal, this says precisely that AA is orthogonally diagonalizable if and only if AA has an orthonormal eigenbasis -- an orthonormal basis of Rn\mathbb{R}^{n} made entirely of eigenvectors of AA.

2

The Spectral Theorem: symmetry is the whole story

The Spectral Theorem (Theorem 9.1) is one of the cleanest classification results in linear algebra: a real n×nn\times n matrix AA is orthogonally diagonalizable if and only if AA is symmetric (AT=AA^{T}=A). One direction is a one-line computation (Remark 9.1): if A=QDQTA=QDQ^{T} with QQ orthogonal and DD diagonal, then AT=(QDQT)T=(QT)TDTQT=QDQT=A,A^{T}=(QDQ^{T})^{T}=(Q^{T})^{T}D^{T}Q^{T}=QDQ^{T}=A, using DT=DD^{T}=D. So every orthogonally diagonalizable matrix is automatically symmetric. The striking direction is the converse -- that symmetry alone guarantees an orthonormal eigenbasis -- proved by induction on nn, peeling off one real unit eigenvector at a time and restricting AA to its orthogonal complement, which stays symmetric (Lemma 9.2). The practical payoff is enormous: to decide whether a real matrix can be orthogonally diagonalized you do not compute a single eigenvalue -- you just check whether AT=AA^{T}=A.

3

Why symmetric matrices always cooperate

Two facts about a symmetric AA make the hard direction work. First, all eigenvalues are real (Proposition 9.2): there are nn of them, counted with multiplicity, so the characteristic polynomial never forces complex roots. Second, eigenvectors from distinct eigenvalues are automatically orthogonal (Lemma 9.1). The proof computes v1⋅Av2\mathbf{v}_1\cdot A\mathbf{v}_2 two ways for eigenvectors with λ1≠λ2\lambda_1\neq\lambda_2: on one hand v1⋅Av2=λ2(v1⋅v2)\mathbf{v}_1\cdot A\mathbf{v}_2=\lambda_2(\mathbf{v}_1\cdot\mathbf{v}_2), and on the other, using AT=AA^{T}=A, v1⋅Av2=(Av1)⋅v2=λ1(v1⋅v2)\mathbf{v}_1\cdot A\mathbf{v}_2=(A\mathbf{v}_1)\cdot\mathbf{v}_2=\lambda_1(\mathbf{v}_1\cdot\mathbf{v}_2); subtracting gives (λ1−λ2)(v1⋅v2)=0(\lambda_1-\lambda_2)(\mathbf{v}_1\cdot\mathbf{v}_2)=0, so v1⋅v2=0\mathbf{v}_1\cdot\mathbf{v}_2=0. These two facts drive Proposition 9.1: if a symmetric AA is diagonalizable then it is orthogonally diagonalizable -- its distinct eigenspaces are already mutually perpendicular, so you only normalise the eigenvectors in each one-dimensional eigenspace and run Gram--Schmidt inside any higher-dimensional eigenspace to finish an orthonormal eigenbasis.

4

Building $Q$ and $D$ -- and why $Q$ is not unique

Remark 9.3 turns the theory into a recipe for a symmetric AA: (1) find the eigenvalues from det⁡(A−λI)=0\det(A-\lambda I)=0; (2) for each eigenvalue find its eigenvectors; (3) orthonormalise -- normalise within each one-dimensional eigenspace, and apply Gram--Schmidt inside any repeated eigenspace (distinct eigenspaces are already orthogonal by Lemma 9.1); (4) place the orthonormal eigenvectors as the columns of QQ and the matching eigenvalues, in the same order, on the diagonal of DD. Then A=QDQTA=QDQ^{T}. A crucial caveat for checking answers: QQ is far from unique. You may replace any column qi\mathbf{q}_i by −qi-\mathbf{q}_i (still a unit eigenvector), reorder the columns (reordering DD to match), or, inside a repeated eigenspace, rotate to any other orthonormal basis. The diagonal matrix DD is unique up to the order of its entries -- it is literally the list of eigenvalues -- but there is no single 'correct' QQ. This is why the reconstructed product A=QDQTA=QDQ^{T} and the (ordered) eigenvalues are well-defined answers, while 'QQ' is not.

Definition 9.1 -- Orthogonally diagonalizable

An n×nn\times n matrix AA is orthogonally diagonalizable if there exists an orthogonal matrix QQ (denoted SS in the course notes) such that Q−1AQ=QTAQQ^{-1}AQ=Q^{T}AQ is diagonal. Equivalently, AA is orthogonally diagonalizable if and only if AA has an orthonormal eigenbasis.

Intuition. An orthogonal matrix satisfies Q−1=QTQ^{-1}=Q^{T}, so the usual diagonalization Q−1AQ=DQ^{-1}AQ=D becomes QTAQ=DQ^{T}AQ=D, i.e. A=QDQTA=QDQ^{T}. The columns of QQ are eigenvectors and, being columns of an orthogonal matrix, they are orthonormal -- which is exactly what 'orthonormal eigenbasis' means. The change of basis is a rigid motion (rotation/reflection) that preserves lengths and angles, not a general shear.
Theorem 9.1 -- Spectral Theorem

An n×nn\times n real matrix AA is orthogonally diagonalizable if and only if AA is symmetric (AT=AA^{T}=A). In that case A=QDQTA=QDQ^{T} with QQ orthogonal (its columns an orthonormal eigenbasis) and DD the diagonal matrix of the real eigenvalues.

Intuition. (⇒\Rightarrow) If A=QDQTA=QDQ^{T} then AT=QDTQT=QDQT=AA^{T}=QD^{T}Q^{T}=QDQ^{T}=A, so AA must be symmetric (Remark 9.1). (⇐\Leftarrow) Symmetry forces real eigenvalues (Proposition 9.2) and perpendicular eigenspaces (Lemma 9.1); an induction on nn -- with Lemma 9.2 keeping the restricted matrix symmetric on span⁡(u1)⊥\operatorname{span}(\mathbf{u}_1)^{\perp} -- assembles a full orthonormal eigenbasis. So the only hypothesis to check is AT=AA^{T}=A.
Proposition 9.1 -- Symmetric and diagonalizable $\Rightarrow$ orthogonally diagonalizable

If a symmetric matrix AA is diagonalizable, then it is orthogonally diagonalizable.

Intuition. By Lemma 9.1 the eigenspaces for distinct eigenvalues are already mutually orthogonal. Inside each eigenspace just manufacture an orthonormal basis: normalise the spanning vector of a one-dimensional eigenspace, and run Gram--Schmidt in any eigenspace of dimension >1>1. Concatenating these bases gives an orthonormal eigenbasis, so A=QDQTA=QDQ^{T}. (For a symmetric matrix with nn distinct eigenvalues this is automatic -- Remark 9.2.)
Remark 9.3 -- Building the orthogonal diagonalizing matrix

For a symmetric AA: find the eigenvalues, find an eigenvector for each, orthonormalise them (normalise one-dimensional eigenspaces; Gram--Schmidt within a repeated eigenspace), and take Q=[ q1  ⋯  qn ]Q=[\,\mathbf{q}_1\;\cdots\;\mathbf{q}_n\,] with those orthonormal eigenvectors as columns and D=diag⁡(λ1,…,λn)D=\operatorname{diag}(\lambda_1,\dots,\lambda_n) with the eigenvalues in the matching order. Then A=QDQTA=QDQ^{T}.

Intuition. The construction mirrors the inductive proof of Theorem 9.1: a change-of-basis matrix P=[u1  v2  ⋯  vn]P=[\mathbf{u}_1\;\mathbf{v}_2\;\cdots\;\mathbf{v}_n] puts AA in block form [λ100B]\begin{bmatrix}\lambda_1&0\\0&B\end{bmatrix} with BB symmetric, and orthogonally diagonalizing the smaller block B=QDQTB=QDQ^{T} then reassembling yields the full orthogonal matrix. Order matters only in that each column of QQ must sit over its own eigenvalue in DD; reordering both together is harmless.

Worked examples

Example 1

Orthogonally diagonalize the symmetric matrix A=[2112]A=\begin{bmatrix}2&1\\1&2\end{bmatrix}: find an orthogonal QQ and diagonal DD with A=QDQTA=QDQ^{T}, and verify the factorization.

  1. 1

    Check symmetry first. AT=AA^{T}=A, so by the Spectral Theorem (Theorem 9.1) AA is orthogonally diagonalizable -- an orthonormal eigenbasis exists.

  2. 2

    Eigenvalues. det⁡(A−λI)=det⁡[2−λ112−λ]=(2−λ)2−1=λ2−4λ+3=(λ−1)(λ−3)\det(A-\lambda I)=\det\begin{bmatrix}2-\lambda&1\\1&2-\lambda\end{bmatrix}=(2-\lambda)^2-1=\lambda^2-4\lambda+3=(\lambda-1)(\lambda-3), so λ1=1\lambda_1=1 and λ2=3\lambda_2=3.

  3. 3

    Eigenvectors. For λ1=1\lambda_1=1: A−I=[1111]A-I=\begin{bmatrix}1&1\\1&1\end{bmatrix} gives x1+x2=0x_1+x_2=0, eigenvector (1,−1)(1,-1). For λ2=3\lambda_2=3: A−3I=[−111−1]A-3I=\begin{bmatrix}-1&1\\1&-1\end{bmatrix} gives x1=x2x_1=x_2, eigenvector (1,1)(1,1). They are orthogonal, as Lemma 9.1 promises for distinct eigenvalues.

  4. 4

    Normalise. Each eigenvector has length 2\sqrt{2}, so q1=12(1,−1)\mathbf{q}_1=\tfrac{1}{\sqrt2}(1,-1) and q2=12(1,1)\mathbf{q}_2=\tfrac{1}{\sqrt2}(1,1).

  5. 5

    Assemble (Remark 9.3). Put the eigenvectors in the columns of QQ and the eigenvalues in the matching order on DD: Q=12[11−11],D=[1003].Q=\frac{1}{\sqrt2}\begin{bmatrix}1&1\\-1&1\end{bmatrix},\qquad D=\begin{bmatrix}1&0\\0&3\end{bmatrix}.

  6. 6

    Verify. QTQ=IQ^{T}Q=I (columns orthonormal), and QDQT=12[11−11][1003][1−111]=12[4224]=[2112]=A.QDQ^{T}=\frac{1}{2}\begin{bmatrix}1&1\\-1&1\end{bmatrix}\begin{bmatrix}1&0\\0&3\end{bmatrix}\begin{bmatrix}1&-1\\1&1\end{bmatrix}=\frac12\begin{bmatrix}4&2\\2&4\end{bmatrix}=\begin{bmatrix}2&1\\1&2\end{bmatrix}=A.

Answer. A=QDQTA=QDQ^{T} with Q=12[11−11]Q=\frac{1}{\sqrt2}\begin{bmatrix}1&1\\-1&1\end{bmatrix} and D=diag⁡(1,3)D=\operatorname{diag}(1,3). (Any column may be negated, or the two columns swapped with DD reordered to match, so QQ is not unique -- but the diagonal entries {1,3}\{1,3\} are.)
Example 2

You are given an orthogonal matrix Q=12[111−1]Q=\frac{1}{\sqrt2}\begin{bmatrix}1&1\\1&-1\end{bmatrix} and diagonal D=[5001]D=\begin{bmatrix}5&0\\0&1\end{bmatrix}. Reconstruct the symmetric matrix A=QDQTA=QDQ^{T}, and confirm its eigenvalues and eigenvectors match QQ and DD.

Example 3

Orthogonally diagonalize A=[4112]A=\begin{bmatrix}4&1\\1&2\end{bmatrix}, whose eigenvalues are irrational. Give DD and QQ to 33 decimal places and verify A≈QDQTA\approx QDQ^{T}.