Survey of Mathematics

3.1 Symmetric matrices and the spectral theorem

A symmetric matrix has real eigenvalues and perpendicular eigenvectors, so it is nothing but a stretch along perpendicular axes. That is the spectral theorem, the most useful theorem in linear algebra, and Apostol's chapter 5 that MATH 375 only touched.

Taught in 375/376Apostol, not taughtApostol 5.1 to 5.9Spagnolie, Lecture 19 (fluid deformation)Axler, Linear Algebra Done Right, 7A to 7B

Chapter 2.8 showed that diagonalizing can fail: a shear has too few eigenvectors, and a rotation has no real ones. This chapter finds a large class of matrices for which nothing can go wrong. If a real matrix equals its own transpose, its eigenvalues are real, its eigenvectors can be chosen perpendicular, and it is diagonalized by a rotation of axes. Symmetric matrices appear everywhere: second derivatives, covariance in statistics, stress in materials, energy in physics. That is why this theorem is used more than any other in linear algebra.

Before you start

Chapter 2.8 (eigenvalues, diagonalization) and 2.9 (inner products, orthonormal bases, orthogonal complements).

Quick checkFor the dot product on Rn\mathbb R^n, which identity is true for every matrix AA?
Quick checkWhich matrix has no real eigenvectors?

The picture

The symmetric matrix [2112]\begin{bmatrix}2&1\\1&2\end{bmatrix} stretches by 3 along (1,1)(1, 1) and by 1 along (1,−1)(1, -1), and these two directions are perpendicular. Compare with “Eigen example” (not symmetric): its eigenlines are not perpendicular. And “Rotate 90°” has none. A symmetric matrix is always the clean case: stretch along perpendicular axes, nothing else.

Where this came from· From the axes of a spinning body to Hilbert's 'spectrum'

Every rigid body, however lumpy, has three perpendicular axes about which it can spin steadily: the principal axes. Leonhard Euler worked them out in his mechanics of rigid bodies in the 1700s. In matrix language they are the eigenvectors of a symmetric matrix, the inertia tensor. Astronomers met the same mathematics from another side: to find out whether planetary orbits stay stable, they needed the roots of a “secular equation”, and in 1829 Augustin-Louis Cauchy showed that those roots are real when the underlying quadratic form is symmetric. That is our first theorem. Between about 1904 and 1910 David Hilbert, studying integral equations, called the set of eigenvalues the “spectrum”, with no physics in mind. When quantum mechanics arrived in the 1920s, the spectral lines of atoms turned out to be eigenvalues of Hermitian operators, so his word fitted better than he could have known.

Definitions

Chapter 2.9 defined inner products over the real numbers. The first theorem below needs eigenvalues that might be complex, so we need the complex version too. For complex vectors x=(x1,…,xn)x = (x_1, \dots, x_n) and y=(y1,…,yn)y = (y_1, \dots, y_n) define

(x,y)=x1y1‾+⋯+xnyn‾,(x, y) = x_1\overline{y_1} + \cdots + x_n\overline{y_n},

where the bar is the conjugate of 0.6. Three facts are all we use. It is linear in the first slot: (cx,y)=c (x,y)(cx, y) = c\,(x, y). It is conjugate-linear in the second: (x,cy)=cˉ (x,y)(x, cy) = \bar c\,(x, y), because the bar acts on cc. And (x,x)=∣x1∣2+⋯+∣xn∣2(x, x) = |x_1|^2 + \cdots + |x_n|^2 is a positive real number when x≠Ox \ne O. The bar is there for the third fact: without it, (x,x)(x, x) for x=(i)x = (i) would be i2=−1i^2 = -1, and lengths would break. For real vectors the bars do nothing and this is the dot product.

Definition A

Adjoint

Let VV be a finite-dimensional inner product space. The adjoint of a linear map A:V→VA: V \to V is the linear map A∗A^* with

(Ax,y)=(x,A∗y)for all x,y∈V.(Ax, y) = (x, A^*y) \quad\text{for all } x, y \in V.

For Rn\mathbb R^n with the dot product, A∗=ATA^* = A^{\mathsf T}. For Cn\mathbb C^n with (x,y)=∑xiyi‾(x, y) = \sum x_i \overline{y_i}, A∗=A‾TA^* = \overline{A}^{\mathsf T}, the conjugate transpose.

In one lineThe adjoint A∗A^* is the map with (Ax,y)=(x,A∗y)(Ax, y) = (x, A^*y) for all x,yx, y; for real matrices with the dot product it is the transpose.

Why it existsIt moves a map from one side of an inner product to the other, which is the step every proof in this chapter uses.

Spagnolie put it this way in Lecture 19: in general, “transpose” is whatever operation makes (v,Aw)=(ATv,w)(v, Aw) = (A^{\mathsf T}v, w) true. For real matrices the check is index bookkeeping: (Ax)⋅y=∑i,jaijxjyi=x⋅(ATy)(Ax) \cdot y = \sum_{i,j} a_{ij} x_j y_i = x \cdot (A^{\mathsf T}y).

Definition T

Symmetric operator

A linear map AA on a real inner product space is symmetric (Apostol: Hermitian when complex, self-adjoint in general) if A∗=AA^* = A, that is, (Ax,y)=(x,Ay)(Ax, y) = (x, Ay) for all x,yx, y. A real matrix is symmetric when AT=AA^{\mathsf T} = A: entry aij=ajia_{ij} = a_{ji}.

In one lineA real linear map with A∗=AA^* = A, that is (Ax,y)=(x,Ay)(Ax, y) = (x, Ay); for a matrix, AT=AA^{\mathsf T} = A.

Why it existsThese are exactly the maps that can be diagonalized by perpendicular axes.

Definition A

Hermitian

A complex matrix is Hermitian if A‾T=A\overline{A}^{\mathsf T} = A. A real symmetric matrix is Hermitian, since conjugating real numbers changes nothing.

In one lineA complex matrix equal to its conjugate transpose: aij=aji‾a_{ij} = \overline{a_{ji}}.

Why it existsIt is the complex version of symmetric, and the setting of quantum mechanics.

Definition A

Orthogonally diagonalizable

A real square matrix AA is orthogonally diagonalizable if A=QΛQTA = Q \Lambda Q^{\mathsf T} where Λ\Lambda is diagonal and QQ is an orthogonal matrix: its columns form an orthonormal basis, so QTQ=IQ^{\mathsf T}Q = I and Q−1=QTQ^{-1} = Q^{\mathsf T}. Equivalently, Rn\mathbb R^n has an orthonormal basis of eigenvectors of AA (the columns of QQ).

In one lineA=QΛQTA = Q\Lambda Q^{\mathsf T} with Λ\Lambda diagonal and QQ having orthonormal columns: diagonalized by a rotation or reflection of axes.

Why it existsThen Q−1=QTQ^{-1} = Q^{\mathsf T} costs nothing to compute, and the eigen-directions are perpendicular.

The three facts

Theorem T Apostol Thm 5.2; Spagnolie Lecture 19

Symmetric matrices have real eigenvalues

If AA is Hermitian and Ax=λxAx = \lambda x with x≠Ox \ne O (allowing complex λ\lambda and xx), then λ\lambda is real.

In one lineEvery eigenvalue of a Hermitian (in particular real symmetric) matrix is a real number.

Why it is true(Ax, x) = λ(x, x) and also (x, Ax) = conj(λ)(x, x); symmetry makes these equal, so λ equals its own conjugate.

ProofSpagnolie Lecture 19 (corrected), Apostol 5.2
The idea: Compute (Ax, x) in two ways: pull λ out of the first slot, and move A across with symmetry and pull λ out of the second slot, where it comes out conjugated. Compare.
(Ax,x)=(λx,x)=λ(x,x)(Ax, x) = (\lambda x, x) = \lambda (x, x).
Use Ax=λxAx = \lambda x; an inner product is linear in its first slot.
(Ax,x)=(x,Ax)=(x,λx)(Ax, x) = (x, Ax) = (x, \lambda x).
AA is Hermitian, so (Ax,x)=(x,Ax)(Ax, x) = (x, Ax).
(x,λx)=λˉ(x,x)(x, \lambda x) = \bar\lambda (x, x).
A complex inner product is conjugate-linear in its second slot: (x,cy)=cˉ(x,y)(x, cy) = \bar c(x, y).Spagnolie's notes write y where x is needed here; the argument uses the same vector x in both slots.
λ(x,x)=λˉ(x,x)\lambda (x, x) = \bar\lambda (x, x).
The two computations equal the same number.
λ=λˉ\lambda = \bar\lambda, so λ\lambda is real. ■\blacksquare
(x,x)=∥x∥2>0(x, x) = \lVert x \rVert^2 > 0 because x≠Ox \ne O, so we may divide.
Theorem T Apostol Thm 5.4; Spagnolie Lecture 19

Eigenvectors of a symmetric matrix are orthogonal

If AA is symmetric, Ax=λxAx = \lambda x and Ay=μyAy = \mu y with λ≠μ\lambda \ne \mu, then (x,y)=0(x, y) = 0.

In one lineEigenvectors of a symmetric matrix for different eigenvalues are perpendicular.

Why it is true(Ax, y) gives λ(x, y) and, moving A across, μ(x, y); with λ ≠ μ the only way out is (x, y) = 0.

ProofSpagnolie Lecture 19
The idea: Compute (Ax, y) two ways: as λ(x, y), and by moving A to y as μ(x, y). Subtract.
(Ax,y)=λ(x,y)(Ax, y) = \lambda (x, y).
Ax=λxAx = \lambda x.
(Ax,y)=(x,Ay)=μ(x,y)(Ax, y) = (x, Ay) = \mu (x, y).
Symmetry, then Ay=μyAy = \mu y (and μ\mu is real by the previous theorem, so no conjugate appears).
(λ−μ)(x,y)=0(\lambda - \mu)(x, y) = 0.
Subtract the two lines.
Hence (x,y)=0(x, y) = 0. ■\blacksquare
λ≠μ\lambda \ne \mu, so the first factor is not zero.
Proof workshopGive the reason for each line: eigenvectors are orthogonal

Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.

  1. (Ax,y)=λ(x,y)(Ax, y) = \lambda (x, y)
  2. (Ax,y)=(x,Ay)(Ax, y) = (x, Ay)
  3. (x,Ay)=μ(x,y)(x, Ay) = \mu (x, y)
  4. (λ−μ)(x,y)=0(\lambda - \mu)(x, y) = 0, so (x,y)=0(x, y) = 0
Theorem A Apostol Thm 5.6 and 5.8; Axler 7.29

Spectral theorem

Let AA be a real symmetric n×nn \times n matrix. Then Rn\mathbb R^n has an orthonormal basis q1,…,qnq_1, \dots, q_n of eigenvectors of AA. Equivalently, A=QΛQTA = Q \Lambda Q^{\mathsf T} with Q=[q1⋯qn]Q = [q_1 \cdots q_n] orthogonal and Λ=diag⁡(λ1,…,λn)\Lambda = \operatorname{diag}(\lambda_1, \dots, \lambda_n) real. The theorem holds even when eigenvalues repeat.

In one lineEvery real symmetric matrix is orthogonally diagonalizable: A=QΛQTA = Q\Lambda Q^{\mathsf T}, with real eigenvalues and an orthonormal basis of eigenvectors.

Why it is trueFind one unit eigenvector; the space perpendicular to it is mapped into itself, so the same argument repeats there, one dimension down.

Why· The picture behind the proof

Find one eigenvector q1q_1 of length 1. Look at the plane (or hyperplane) WW perpendicular to it. A symmetric matrix maps WW into itself: if w⊥q1w \perp q_1, then Aw⊥q1Aw \perp q_1 too. So inside WW you have a smaller symmetric problem, one dimension down, and the same argument finds the next eigenvector, perpendicular to the first. Repeating peels off one perpendicular axis at a time.

ProofApostol 5.6, Axler 7.29
The idea: Induction on n. A real eigenvalue exists (complex eigenvalues always exist and are real here). Take a unit eigenvector q₁. The orthogonal complement W = q₁⊥ is invariant under A, and A restricted to W is symmetric. By induction W has an orthonormal eigenbasis; add q₁.
Base case n=1n = 1: true. Assume the theorem for symmetric maps on spaces of dimension n−1n - 1.
Induction on the dimension nn. For n=1n = 1 every unit vector is an eigenvector of the 1×11 \times 1 matrix.
AA has a real eigenvalue λ1\lambda_1 with a real eigenvector; scale it to length 1 and call it q1q_1.
The characteristic polynomial has a complex root (fundamental theorem of algebra, 0.6), and a real symmetric matrix is Hermitian, so by the first theorem that root is real. Then A−λ1IA - \lambda_1 I is a real matrix with determinant 0, so the real system (A−λ1I)x=O(A - \lambda_1 I)x = O has a non-zero real solution (2.8).
Let W={w:(w,q1)=0}W = \{w : (w, q_1) = 0\}.
The vectors perpendicular to q1q_1 form a subspace of dimension n−1n - 1 (orthogonal complement, 2.9).
If w∈Ww \in W, then Aw∈WAw \in W: WW is invariant under AA.
Symmetry moves AA across: (Aw,q1)=(w,Aq1)=λ1(w,q1)=0(Aw, q_1) = (w, Aq_1) = \lambda_1 (w, q_1) = 0.This is the step that needs symmetry. For a non-symmetric matrix W need not be mapped into itself.
AA restricted to WW is a symmetric map on the (n−1)(n - 1)-dimensional inner product space WW.
The identity (Ax,y)=(x,Ay)(Ax, y) = (x, Ay) holds for all vectors, in particular those in WW.
WW has an orthonormal basis q2,…,qnq_2, \dots, q_n of eigenvectors of AA.
Induction hypothesis.
q1,q2,…,qnq_1, q_2, \dots, q_n is an orthonormal basis of eigenvectors of AA. ■\blacksquare
q1q_1 is a unit vector perpendicular to all of WW, and nn orthonormal vectors in Rn\mathbb R^n form a basis (orthonormal sets are independent, 2.9).
Proof workshopRebuild the spectral theorem proof

Tap the lines in the order a proof would write them. Each line can only use what is already above it.

    Same idea elsewhere· Why A = QΛQᵀ is the same statement

    With QQ having columns qiq_i: AQ=[λ1q1⋯λnqn]=QΛAQ = [\lambda_1 q_1 \cdots \lambda_n q_n] = Q\Lambda. Orthonormal columns give QTQ=IQ^{\mathsf T}Q = I, so Q−1=QTQ^{-1} = Q^{\mathsf T}, and A=QΛQTA = Q\Lambda Q^{\mathsf T}. This is the change of basis of 2.5 with the cheapest possible inverse, the transpose.

    Quick checkIn the spectral theorem's proof, where is symmetry used?

    Examples

    Worked example
    Orthogonally diagonalize A=[2112]A = \begin{bmatrix}2&1\\1&2\end{bmatrix}.

    Solution.

    1. Eigenvalues. det⁡(A−λI)=(2−λ)2−1=(λ−3)(λ−1)\det(A - \lambda I) = (2 - \lambda)^2 - 1 = (\lambda - 3)(\lambda - 1). So λ=3,1\lambda = 3, 1. Characteristic polynomial (2.8). Both real, as the theorem promises.
    2. Eigenvectors. λ=3\lambda = 3: (A−3I)x=O(A - 3I)x = O gives x=(1,1)x = (1, 1). λ=1\lambda = 1: x=(1,−1)x = (1, -1). Solve each null space.
    3. Check perpendicular, then normalize. (1,1)⋅(1,−1)=0(1,1) \cdot (1,-1) = 0. Unit vectors: q1=12(1,1)q_1 = \frac1{\sqrt2}(1, 1), q2=12(1,−1)q_2 = \frac1{\sqrt2}(1, -1). Different eigenvalues, so perpendicular automatically; divide by the length to get an orthonormal basis.
    4. Assemble. Q=12[111−1]Q = \frac1{\sqrt2}\begin{bmatrix}1&1\\1&-1\end{bmatrix}, Λ=[3001]\Lambda = \begin{bmatrix}3&0\\0&1\end{bmatrix}, and A=QΛQTA = Q\Lambda Q^{\mathsf T}. Columns of QQ in the same order as the eigenvalues in Λ\Lambda.

    Answer. AA stretches by 3 along the diagonal y=xy = x and leaves the perpendicular diagonal unchanged: the picture at the top.

    Worked example
    Spagnolie's Lecture 19 example: diagonalize D=[2/31012/3000−4/3]D = \begin{bmatrix}2/3&1&0\\1&2/3&0\\0&0&-4/3\end{bmatrix} and explain its trace.

    Solution.

    1. Use structure. D=A−43ID = A - \frac43 I with A=[210120000]A = \begin{bmatrix}2&1&0\\1&2&0\\0&0&0\end{bmatrix}, whose eigenvalues are 3,1,03, 1, 0 (the 2×22\times2 block from the previous example, and 0). Subtracting cIcI shifts every eigenvalue by cc and keeps eigenvectors.
    2. Eigenvalues of DD. 3−43=533 - \frac43 = \frac53, 1−43=−131 - \frac43 = -\frac13, 0−43=−430 - \frac43 = -\frac43. Shift each by −43-\frac43.
    3. Eigenvectors. (1,1,0)(1, 1, 0), (1,−1,0)(1, -1, 0), (0,0,1)(0, 0, 1), mutually perpendicular; divide the first two by 2\sqrt 2. Same as for AA.
    4. Trace. 53−13−43=0=tr⁡D\frac53 - \frac13 - \frac43 = 0 = \operatorname{tr} D. Trace = sum of eigenvalues (2.8). Spagnolie’s point: zero trace means the flow below preserves volume.

    Answer. D=QΛQTD = Q\Lambda Q^{\mathsf T} with Λ=diag⁡(53,−13,−43)\Lambda = \operatorname{diag}(\frac53, -\frac13, -\frac43). In the fluid flow, a ball of fluid stretches fastest along (1,1,0)(1, 1, 0).

    Worked example
    Show B=[1203]B = \begin{bmatrix}1&2\\0&3\end{bmatrix} is diagonalizable but NOT orthogonally diagonalizable.

    Solution.

    1. Eigenvalues. Triangular, so 11 and 33, distinct, so BB is diagonalizable (2.8). Distinct eigenvalues give independent eigenvectors.
    2. Eigenvectors. λ=1\lambda = 1: (1,0)(1, 0). λ=3\lambda = 3: (1,1)(1, 1). Solve (B−λI)x=O(B - \lambda I)x = O.
    3. Angle. (1,0)⋅(1,1)=1≠0(1,0) \cdot (1,1) = 1 \ne 0, not perpendicular, and each eigenspace is a single line, so no other choice exists. An orthonormal eigenbasis would need perpendicular eigenlines.

    Answer. Diagonalizable, but not by perpendicular axes. In fact a real matrix is orthogonally diagonalizable exactly when it is symmetric (problem below), and B≠BTB \ne B^{\mathsf T}.

    Python labSymmetric versus not symmetric, on a computer
    import numpy as np
    
    A = np.array([[2.0, 1.0], [1.0, 2.0]])
    w, Q = np.linalg.eigh(A)          # eigh is for symmetric matrices
    print("eigenvalues:", w)
    print("Q^T Q =", np.round(Q.T @ Q, 12).tolist())
    print("Q diag(w) Q^T =", np.round(Q @ np.diag(w) @ Q.T, 12).tolist())
    
    B = np.array([[1.0, 2.0], [0.0, 3.0]])   # not symmetric
    w2, V = np.linalg.eig(B)
    print("non-symmetric eigenvectors dot product:", round(float(V[:, 0] @ V[:, 1]), 4))

    Try this. Run it. For the symmetric matrix, eigh returns an orthogonal QQ (so QTQ=IQ^{\mathsf T}Q = I) and QΛQTQ\Lambda Q^{\mathsf T} rebuilds AA. For the non-symmetric matrix, the two eigenvectors have dot product 0.70710.7071, not 0: they are not perpendicular. Change B to [[1.0, 2.0], [2.0, 3.0]] (symmetric) and the dot product becomes 0 up to rounding.

    Your answerWhat is the larger eigenvalue of the symmetric matrix [5222]\begin{bmatrix}5&2\\2&2\end{bmatrix}?
    Worked example
    Compute A10A^{10} for A=[2112]A = \begin{bmatrix}2&1\\1&2\end{bmatrix} using A=QΛQTA = Q\Lambda Q^{\mathsf T}.

    Solution.

    1. Use the decomposition from the first example. A=QΛQTA = Q\Lambda Q^{\mathsf T} with Λ=diag⁡(3,1)\Lambda = \operatorname{diag}(3, 1) and Q=12[111−1]Q = \frac1{\sqrt2}\begin{bmatrix}1&1\\1&-1\end{bmatrix}. We already have the eigen-data, so no new eigenvalue work is needed.
    2. Collapse the product. A2=QΛQTQΛQT=QΛ2QTA^2 = Q\Lambda Q^{\mathsf T}Q\Lambda Q^{\mathsf T} = Q\Lambda^2 Q^{\mathsf T}, because QTQ=IQ^{\mathsf T}Q = I sits in the middle. The same cancellation repeats, so A10=QΛ10QTA^{10} = Q\Lambda^{10}Q^{\mathsf T}. Each neighbouring pair QTQQ^{\mathsf T}Q becomes II. This is why diagonalizing makes powers cheap.
    3. Power the diagonal matrix entry by entry. Λ10=diag⁡(310,110)=diag⁡(59049,1)\Lambda^{10} = \operatorname{diag}(3^{10}, 1^{10}) = \operatorname{diag}(59049, 1). A diagonal matrix multiplies each diagonal entry by itself.
    4. Multiply back. QΛ10QT=12[111−1][59049001][111−1]=12[59050590485904859050]Q\Lambda^{10}Q^{\mathsf T} = \frac12\begin{bmatrix}1&1\\1&-1\end{bmatrix}\begin{bmatrix}59049&0\\0&1\end{bmatrix}\begin{bmatrix}1&1\\1&-1\end{bmatrix} = \frac12\begin{bmatrix}59050&59048\\59048&59050\end{bmatrix}. The factor 12\frac12 is (12)2\left(\frac1{\sqrt2}\right)^2, from the two copies of QQ.

    Answer. A10=[29525295242952429525]A^{10} = \begin{bmatrix}29525&29524\\29524&29525\end{bmatrix}. Check with A2=[5445]A^2 = \begin{bmatrix}5&4\\4&5\end{bmatrix}: the formula 12[32+132−132−132+1]\frac12\begin{bmatrix}3^2+1&3^2-1\\3^2-1&3^2+1\end{bmatrix} gives the same.

    Your answerFor A=[2112]A = \begin{bmatrix}2&1\\1&2\end{bmatrix}, what is the top-left entry of A10A^{10}?
    Worked example Spagnolie Lecture 19
    Split A=[1312]A = \begin{bmatrix}1&3\\1&2\end{bmatrix} into its symmetric and antisymmetric parts, and find the eigenvalues of each.

    Solution.

    1. Symmetric part. E=12(A+AT)=12[2444]=[1222]E = \frac12(A + A^{\mathsf T}) = \frac12\begin{bmatrix}2&4\\4&4\end{bmatrix} = \begin{bmatrix}1&2\\2&2\end{bmatrix}. Adding AA and its transpose makes entry (i,j)(i,j) equal to entry (j,i)(j,i).
    2. Antisymmetric part. R=12(A−AT)=12[02−20]=[01−10]R = \frac12(A - A^{\mathsf T}) = \frac12\begin{bmatrix}0&2\\-2&0\end{bmatrix} = \begin{bmatrix}0&1\\-1&0\end{bmatrix}. Subtracting makes entry (i,j)(i,j) the negative of entry (j,i)(j,i).
    3. Check they add up. E+R=[1312]=AE + R = \begin{bmatrix}1&3\\1&2\end{bmatrix} = A. The halves of ATA^{\mathsf T} cancel.
    4. Eigenvalues of EE. λ2−3λ−2=0\lambda^2 - 3\lambda - 2 = 0, so λ=3±172\lambda = \frac{3 \pm \sqrt{17}}2, about 3.563.56 and −0.56-0.56. Trace 3 and determinant 2−4=−22 - 4 = -2. Real, as the spectral theorem promises for symmetric EE.
    5. Eigenvalues of RR. λ2+1=0\lambda^2 + 1 = 0, so λ=±i\lambda = \pm i. Purely imaginary: RR is a quarter turn, so no real direction stays on its line.

    Answer. E=[1222]E = \begin{bmatrix}1&2\\2&2\end{bmatrix} (a stretch along perpendicular axes) and R=[01−10]R = \begin{bmatrix}0&1\\-1&0\end{bmatrix} (a rotation).

    Worked example Apostol 5.5 style
    Prove: if AA is orthogonally diagonalizable, then AA is symmetric.

    Solution.

    1. Write down the hypothesis. A=QΛQTA = Q\Lambda Q^{\mathsf T} with QTQ=IQ^{\mathsf T}Q = I and Λ\Lambda diagonal. This is the definition of orthogonally diagonalizable.
    2. Transpose both sides. AT=(QΛQT)TA^{\mathsf T} = (Q\Lambda Q^{\mathsf T})^{\mathsf T}. Goal: show AT=AA^{\mathsf T} = A.
    3. Reverse the order of the product. (QΛQT)T=(QT)TΛTQT(Q\Lambda Q^{\mathsf T})^{\mathsf T} = (Q^{\mathsf T})^{\mathsf T}\Lambda^{\mathsf T}Q^{\mathsf T}. The transpose of a product is the product of transposes in reverse order (2.5).
    4. Simplify each factor. (QT)T=Q(Q^{\mathsf T})^{\mathsf T} = Q and ΛT=Λ\Lambda^{\mathsf T} = \Lambda. Transposing twice gives the original, and a diagonal matrix is unchanged by transposing.
    5. Compare. AT=QΛQT=AA^{\mathsf T} = Q\Lambda Q^{\mathsf T} = A.

    Answer. AA is symmetric. ■\blacksquare With the spectral theorem, a real matrix is orthogonally diagonalizable if and only if it is symmetric.

    Worked example
    Prove: every eigenvalue of a real antisymmetric matrix (AT=−AA^{\mathsf T} = -A) is zero or purely imaginary. Test on [02−20]\begin{bmatrix}0&2\\-2&0\end{bmatrix}.

    Solution.

    1. Set up. Let Ax=λxAx = \lambda x with x≠Ox \ne O, where xx and λ\lambda may be complex. Eigenvalues of a real matrix can be complex, so we use the complex inner product defined above.
    2. Compute (Ax,x)(Ax, x) two ways. First, (Ax,x)=λ(x,x)(Ax, x) = \lambda(x, x). Second, moving AA across, (Ax,x)=(x,A∗x)=(x,−Ax)=(x,−λx)=−λˉ (x,x)(Ax, x) = (x, A^{*}x) = (x, -Ax) = (x, -\lambda x) = -\bar\lambda\,(x, x). For a real matrix A∗=AT=−AA^* = A^{\mathsf T} = -A. The conjugate appears because λ\lambda comes out of the second slot.
    3. Compare. λ(x,x)=−λˉ(x,x)\lambda(x, x) = -\bar\lambda(x, x), and (x,x)>0(x, x) > 0, so λ=−λˉ\lambda = -\bar\lambda. Divide by the positive number (x,x)(x, x).
    4. Read off. Write λ=a+bi\lambda = a + bi. Then a+bi=−a+bia + bi = -a + bi, so a=0a = 0. The real parts must be opposites of each other and equal, so they are 0.
    5. Test. [02−20]\begin{bmatrix}0&2\\-2&0\end{bmatrix} has λ2+4=0\lambda^2 + 4 = 0, so λ=±2i\lambda = \pm 2i. Purely imaginary, as proved.

    Answer. Every eigenvalue of a real antisymmetric matrix has real part 0. ■\blacksquare

    Worked example
    Write A=[2112]A = \begin{bmatrix}2&1\\1&2\end{bmatrix} as a sum of eigenvalue times projection, and show each piece is a projection.

    Solution.

    1. Take the unit eigenvectors. q1=12(1,1)q_1 = \frac1{\sqrt2}(1, 1), q2=12(1,−1)q_2 = \frac1{\sqrt2}(1, -1), with eigenvalues 33 and 11. From the first example.
    2. Build each rank-one matrix. q1q1T=12[1111]q_1q_1^{\mathsf T} = \frac12\begin{bmatrix}1&1\\1&1\end{bmatrix} and q2q2T=12[1−1−11]q_2q_2^{\mathsf T} = \frac12\begin{bmatrix}1&-1\\-1&1\end{bmatrix}. A column times a row is a matrix.
    3. Show it is a projection. For any xx, (q1q1T)x=q1(q1Tx)=(x⋅q1) q1(q_1q_1^{\mathsf T})x = q_1(q_1^{\mathsf T}x) = (x \cdot q_1)\,q_1. This is the projection of xx onto the line through the unit vector q1q_1 (2.9).
    4. Add up. 3q1q1T+1 q2q2T=12[3+13−13−13+1]=[2112]3q_1q_1^{\mathsf T} + 1\,q_2q_2^{\mathsf T} = \frac12\begin{bmatrix}3+1&3-1\\3-1&3+1\end{bmatrix} = \begin{bmatrix}2&1\\1&2\end{bmatrix}. Matches AA, so the decomposition is right.

    Answer. A=3 q1q1T+1 q2q2TA = 3\,q_1q_1^{\mathsf T} + 1\,q_2q_2^{\mathsf T}: project onto each axis, then scale by that axis’s eigenvalue. In general, A=∑iλiqiqiTA = \sum_i \lambda_i q_iq_i^{\mathsf T}, because the column-times-row expansion of QΛQTQ\Lambda Q^{\mathsf T} has exactly these terms.

    Worked example Axler 7B
    For A=[2112]A = \begin{bmatrix}2&1\\1&2\end{bmatrix} and x=(1,2)x = (1, 2), compute xTAxx^{\mathsf T}Ax in the eigenbasis and see why it lies between the eigenvalues.

    Solution.

    1. Compute directly. Ax=(4,5)Ax = (4, 5), so xTAx=4+10=14x^{\mathsf T}Ax = 4 + 10 = 14, and ∥x∥2=5\lVert x\rVert^2 = 5. The ratio xTAxxTx=2.8\frac{x^{\mathsf T}Ax}{x^{\mathsf T}x} = 2.8 is what we explain next.
    2. Find the coordinates in the eigenbasis. c1=x⋅q1=32c_1 = x \cdot q_1 = \frac3{\sqrt2} and c2=x⋅q2=−12c_2 = x \cdot q_2 = -\frac1{\sqrt2}, so x=c1q1+c2q2x = c_1q_1 + c_2q_2. In an orthonormal basis the coordinates are dot products (2.9).
    3. Expand. xTAx=λ1c12+λ2c22=3⋅92+1⋅12=14x^{\mathsf T}Ax = \lambda_1c_1^2 + \lambda_2c_2^2 = 3 \cdot \frac92 + 1 \cdot \frac12 = 14. Ax=λ1c1q1+λ2c2q2Ax = \lambda_1c_1q_1 + \lambda_2c_2q_2, and the dot product with xx keeps only matching pairs, because q1⋅q2=0q_1 \cdot q_2 = 0.
    4. Bound it. c12+c22=5=∥x∥2c_1^2 + c_2^2 = 5 = \lVert x\rVert^2, so 14=3c12+c2214 = 3c_1^2 + c_2^2 is a weighted average (weights 9/25\frac{9/2}5 and 1/25\frac{1/2}5) of the eigenvalues 3 and 1, times 5. An average of 3 and 1 lies between them. Here 2.82.8 is between 11 and 33.

    Answer. xTAx=14x^{\mathsf T}Ax = 14, and the ratio 2.82.8 lies between the smallest and largest eigenvalue. Taking x=q1x = q_1 gives the top value 3, and any x≠Ox \ne O gives a positive value when both eigenvalues are positive.

    Your answerFor A=[2112]A = \begin{bmatrix}2&1\\1&2\end{bmatrix}, what is the largest value of xTAxx^{\mathsf T}Ax over all unit vectors xx?
    Your answerWhat is the sum of the squares of the two eigenvalues of the symmetric matrix [1440]\begin{bmatrix}1&4\\4&0\end{bmatrix}?
    Quick checkWhich real matrices can be orthogonally diagonalized (that is, A=QΛQTA = Q\Lambda Q^{\mathsf T} with QQ orthogonal)?
    Quick checkA real 5×55 \times 5 symmetric matrix has eigenvalues 2,2,2,7,72, 2, 2, 7, 7. How many independent eigenvectors does it have?

    Where it is used

    Used inside maths· Inside maths: quadratic forms, the Hessian, and PCA

    Chapter 3.2 uses the spectral theorem to remove the cross term from ax2+2bxy+cy2ax^2 + 2bxy + cy^2 by rotating axes, which classifies every conic. Chapter 5.6 applies it to the Hessian (the symmetric matrix of second derivatives) to decide whether a critical point is a maximum, minimum or saddle. Chapter 3.4 applies it to ATAA^{\mathsf T}A to build the SVD.

    Used in the real world· Fluid mechanics: how a blob of fluid deforms (Spagnolie, Lecture 19)

    In a steady linear flow dxdt=xA\frac{dx}{dt} = xA, split A=E+RA = E + R into its symmetric part E=12(A+AT)E = \frac12(A + A^{\mathsf T}) and antisymmetric part R=12(A−AT)R = \frac12(A - A^{\mathsf T}). RR rotates the fluid. EE is symmetric, so by the spectral theorem it is a pure stretch along three perpendicular axes qiq_i: in those coordinates each component grows like eλite^{\lambda_i t}, and a ball of fluid becomes an ellipsoid. Engineers call EE the strain-rate tensor, and its eigenvectors the principal strain directions. A shear flow, in which the layers slide past each other, is half rotation and half stretching along the diagonals (one of the problems below splits one).

    Used in the real world· Physics and engineering: principal axes and real measurements

    The inertia matrix of a rigid body is symmetric, so every body has three perpendicular principal axes; satellites and spinning tops are analysed in those coordinates. The stress tensor in a loaded beam is symmetric; its eigenvectors are the principal stress directions, along which materials crack. In quantum mechanics every measurable quantity is a Hermitian operator, and the first theorem of this chapter is why every measurement gives a real number.

    Traps

    Watch out· Repeated eigenvalues: choose perpendicular eigenvectors

    Eigenvectors for DIFFERENT eigenvalues of a symmetric matrix are automatically perpendicular. Inside one eigenspace (a repeated eigenvalue) they need not be; run Gram–Schmidt inside that eigenspace, as in the step-through.

    Watch out· Symmetric means equal to its transpose, not 'looks balanced'

    [1221]\begin{bmatrix}1&2\\2&1\end{bmatrix} is symmetric; [12−21]\begin{bmatrix}1&2\\-2&1\end{bmatrix} is not (it is a rotation times a scale, with complex eigenvalues).

    Watch out· Complex inner products conjugate the second slot

    The proof that eigenvalues are real works because (x,λx)=λˉ(x,x)(x, \lambda x) = \bar\lambda(x, x). Forgetting the conjugate “proves” every eigenvalue real, which is false for rotations.

    Problems

    check

    Which are symmetric: [1440]\begin{bmatrix}1&4\\4&0\end{bmatrix}, [01−10]\begin{bmatrix}0&1\\-1&0\end{bmatrix}, [5005]\begin{bmatrix}5&0\\0&5\end{bmatrix}?

    Solution

    The first and third. The second equals minus its transpose (antisymmetric); its eigenvalues are ±i\pm i.

    check

    A symmetric matrix has eigenvectors (1,2)(1, 2) for λ=4\lambda = 4. Find an eigenvector for its other eigenvalue without knowing the matrix.

    Solution

    Eigenvectors of a symmetric 2×22 \times 2 matrix for different eigenvalues are perpendicular, so (2,−1)(2, -1) (or any multiple). (If the other eigenvalue were also 4, every vector would be an eigenvector, and (2,−1)(2,-1) still works.)

    check

    If QQ is orthogonal, what is Q−1Q^{-1}? Why does that matter for computing A=QΛQ−1A = Q\Lambda Q^{-1}?

    Solution

    Q−1=QTQ^{-1} = Q^{\mathsf T}. Inverting a matrix normally takes elimination; for an orthogonal matrix it is a transpose, which is free and numerically exact.

    useApostol 5.5 style

    Orthogonally diagonalize [5222]\begin{bmatrix}5&2\\2&2\end{bmatrix}.

    Solution

    det⁡=(5−λ)(2−λ)−4=λ2−7λ+6=(λ−6)(λ−1)\det = (5 - \lambda)(2 - \lambda) - 4 = \lambda^2 - 7\lambda + 6 = (\lambda - 6)(\lambda - 1). λ=6\lambda = 6: (2,1)(2, 1); λ=1\lambda = 1: (1,−2)(1, -2). Q=15[211−2]Q = \frac1{\sqrt5}\begin{bmatrix}2&1\\1&-2\end{bmatrix}, Λ=diag⁡(6,1)\Lambda = \operatorname{diag}(6, 1).

    use

    Use A=QΛQTA = Q\Lambda Q^{\mathsf T} to compute A10A^{10} for A=[2112]A = \begin{bmatrix}2&1\\1&2\end{bmatrix}.

    Solution

    A10=QΛ10QTA^{10} = Q\Lambda^{10}Q^{\mathsf T} with Λ10=diag⁡(310,1)\Lambda^{10} = \operatorname{diag}(3^{10}, 1). Multiplying out: A10=12[310+1310−1310−1310+1]=[29525295242952429525]A^{10} = \frac12\begin{bmatrix}3^{10} + 1 & 3^{10} - 1\\ 3^{10} - 1 & 3^{10} + 1\end{bmatrix} = \begin{bmatrix}29525 & 29524\\ 29524 & 29525\end{bmatrix}.

    useSpagnolie Lecture 19

    Split A=[0100]A = \begin{bmatrix}0&1\\0&0\end{bmatrix} (a shear flow) into symmetric and antisymmetric parts, and find the principal stretching directions of the symmetric part.

    Solution

    E=12[0110]E = \frac12\begin{bmatrix}0&1\\1&0\end{bmatrix}, R=12[01−10]R = \frac12\begin{bmatrix}0&1\\-1&0\end{bmatrix}. EE has eigenvalues ±12\pm\frac12 with eigenvectors (1,1)(1, 1) (stretching) and (1,−1)(1, -1) (compressing): the diagonals.

    proveApostol 5.5 style

    Prove that if AA is orthogonally diagonalizable, then AA is symmetric. (So for real matrices, orthogonally diagonalizable is the same as symmetric.)

    Solution

    A=QΛQTA = Q\Lambda Q^{\mathsf T} gives AT=(QT)TΛTQT=QΛQT=AA^{\mathsf T} = (Q^{\mathsf T})^{\mathsf T}\Lambda^{\mathsf T}Q^{\mathsf T} = Q\Lambda Q^{\mathsf T} = A, since Λ\Lambda is diagonal so ΛT=Λ\Lambda^{\mathsf T} = \Lambda.

    prove

    Prove that every eigenvalue of an antisymmetric real matrix (AT=−AA^{\mathsf T} = -A) is purely imaginary or zero.

    Solution

    If Ax=λxAx = \lambda x, x≠Ox \ne O complex: λ(x,x)=(Ax,x)=(x,A∗x)=(x,−Ax)=(x,−λx)=−λˉ(x,x)\lambda(x, x) = (Ax, x) = (x, A^*x) = (x, -Ax) = (x, -\lambda x) = -\bar\lambda(x, x). So λ=−λˉ\lambda = -\bar\lambda, meaning the real part of λ\lambda is 0. (This is Spagnolie’s “antisymmetric part = pure rotation”.)

    prove

    Prove the spectral decomposition: if A=QΛQTA = Q\Lambda Q^{\mathsf T} then A=∑i=1nλiqiqiTA = \sum_{i=1}^n \lambda_i q_i q_i^{\mathsf T}, and each qiqiTq_i q_i^{\mathsf T} is the projection onto the line through qiq_i.

    Solution

    QΛQT=[λ1q1⋯λnqn] QT=∑iλiqiqiTQ\Lambda Q^{\mathsf T} = [\lambda_1 q_1 \cdots \lambda_n q_n]\,Q^{\mathsf T} = \sum_i \lambda_i q_i q_i^{\mathsf T} (column times row expansion of a product). And (qiqiT)x=qi(qiTx)=(x⋅qi)qi(q_i q_i^{\mathsf T})x = q_i(q_i^{\mathsf T}x) = (x \cdot q_i)q_i, the projection onto the unit vector qiq_i (2.9).

    proveAxler 7B

    Prove that a symmetric AA with all eigenvalues positive satisfies xTAx>0x^{\mathsf T}Ax > 0 for every x≠Ox \ne O.

    Solution

    Write x=∑ciqix = \sum c_i q_i in the orthonormal eigenbasis. Then Ax=∑λiciqiAx = \sum \lambda_i c_i q_i and xTAx=∑iλici2x^{\mathsf T}Ax = \sum_i \lambda_i c_i^2 (orthonormality kills cross terms). Each term is ≥0\ge 0 and at least one ci≠0c_i \ne 0, so the sum is positive. (Such matrices are called positive definite; 3.2.)

    stretch

    Let AA be real symmetric with largest eigenvalue λmax⁡\lambda_{\max}. Prove max⁡∥x∥=1xTAx=λmax⁡\max_{\lVert x \rVert = 1} x^{\mathsf T}Ax = \lambda_{\max} (the Rayleigh quotient), and say where it is attained.

    Solution

    With x=∑ciqix = \sum c_i q_i, ∥x∥2=∑ci2=1\lVert x \rVert^2 = \sum c_i^2 = 1 and xTAx=∑λici2≤λmax⁡∑ci2=λmax⁡x^{\mathsf T}Ax = \sum \lambda_i c_i^2 \le \lambda_{\max}\sum c_i^2 = \lambda_{\max}. Equality at x=qmax⁡x = q_{\max}, a unit eigenvector for λmax⁡\lambda_{\max}. This is how PCA (3.4) finds the direction of greatest variance.

    Summary

    • The adjoint moves a map across an inner product: (Ax,y)=(x,A∗y)(Ax, y) = (x, A^*y); for real matrices it is the transpose.
    • A symmetric matrix (AT=AA^{\mathsf T} = A) has real eigenvalues, and eigenvectors for different eigenvalues are perpendicular.
    • Spectral theorem: every real symmetric matrix is A=QΛQTA = Q\Lambda Q^{\mathsf T}, an orthonormal eigenbasis with real eigenvalues, even with repeated eigenvalues. Proof: one unit eigenvector, then its perpendicular space is invariant, and induct.
    • For real matrices, orthogonally diagonalizable is exactly the same as symmetric.
    • A symmetric matrix is a pure stretch along perpendicular axes: principal axes, principal strains, principal components.

    Watch and read

    The same ideas explained by someone else. Use these when an explanation here does not land.

    Where this sits

    Comes from
    2.8 Eigenvalues and eigenvectors
    2.9 Inner products, orthogonality, Gram–Schmidt, projection
    Leads to
    3.2 Quadratic forms and principal axes
    3.4 The singular value decomposition and PCA
    Same idea elsewhere
    MATH 375: Lecture 19 proved the two key facts (real eigenvalues, perpendicular eigenvectors) for symmetric matrices, with the fluid-flow example below. The full theorem, Apostol 5.6, was not proved in class.
    MATH 376: The second-derivative test in several variables uses the Hessian, a symmetric matrix; its eigenvalues decide maximum, minimum or saddle (5.6).
    AI / CS 532: Covariance matrices are symmetric. Diagonalizing one is principal component analysis (3.4).