Linear Algebra, Live
Strang §6.4 · Symmetric matrices

Symmetric matrices: perpendicular eigenvectors

On slides 2 to 4 the eigenvectors could point any way: 11 and 1−2 meet at a slant. Symmetric matrices (A = Aᵀ, from lesson 3) are much tidier. Think of pizza dough pulled harder east–west than north–south. The two pull directions don't turn, and they are at a right angle. Every symmetric matrix acts like that: it stretches or flips along perpendicular axes, and does nothing else. Its eigenvalues are real numbers, and its eigenvectors can be chosen perpendicular and of length 1. Put those unit eigenvectors in the columns of Q. Then Q is an orthogonal matrix (lesson 5: a square matrix with orthonormal columns, so QᵀQ = I), its inverse is simply Qᵀ, and A = QΛQᵀ. This fact is called the spectral theorem.

Lesson 7 · slide 5Symmetric matrices
A = Aᵀ ⇒ A = QΛQᵀ    QᵀQ = I
Key ideas
  1. Every eigenvalue of a symmetric matrix is a real number (never complex, unlike the rotation on slide 1).
  2. Eigenvectors for different eigenvalues are perpendicular.
  3. Scaled to length 1, they form the columns of an orthogonal Q (lesson 5): Q⁻¹ = Qᵀ.
  4. So A = QΛQᵀ. (This result is called the spectral theorem.) Every symmetric matrix is a stretch along perpendicular axes.

Stretching along perpendicular axes

Take the symmetric A = 3113: row 1 and column 1 hold the same numbers. Trace 6, det 9 − 1 = 8:

λ² − 6λ + 8 = (λ − 4)(λ − 2) = 0
λ = 4 with 11,   λ = 2 with 1−1.   11 · 1−1 = 1 − 1 = 0 ✓ perpendicular
The two eigenvector lines cross at a right angle. x₁ grows 4 times, x₂ grows 2 times, and both stay on their lines.

A circle shows the same thing. The unit circle becomes an ellipse whose long and short axes lie exactly on the eigenvector lines. The long half-axis is 4, the short one is 2.

The unit circle stretches into an ellipse along the perpendicular eigenvectors. The unit arrows q₁ and q₂ grow to lengths 4 and 2.

Why the eigenvectors are perpendicular

Take Ax = λ₁x and Ay = λ₂y with λ₁ ≠ λ₂. Compute xᵀAy two ways (the transpose rules are from lesson 3):

xᵀ(Ay) = λ₂ xᵀy
(Ax)ᵀy = λ₁ xᵀy,   and (Ax)ᵀy = xᵀAᵀy = xᵀAy because A = Aᵀ
So λ₁ xᵀy = λ₂ xᵀy. Since λ₁ ≠ λ₂, xᵀy = 0: x ⟂ y

Without symmetry the second line fails, and so does the right angle. The matrix 4123 from slide 2 is not symmetric, and its eigenvectors give 11 · 1−2 = −1 ≠ 0.

Unit length: from X to Q

Divide each eigenvector by its length, √2 here, to get unit vectors. They are perpendicular and of length 1, so the matrix Q with them as columns has QᵀQ = I (lesson 5):

q₁ = 11/√2,   q₂ = 1−1/√2
Q = (1/√2)111−1,   Λ = 4002,   A = QΛQᵀ
QᵀQ = ½1 + 11 − 11 − 11 + 1 = 1001 ✓
Turning X into Q: shrink each eigenvector to length 1 (0.707 shows as 0.7). Then QᵀQ is the identity, and the transpose is the inverse.

Length 1 matters. Without the √2, QᵀQ = 2I and QΛQᵀ comes out as 2A. That is the exercise below.

A sum of simple pieces

First multiply QΛQᵀ out directly, row times column as in lesson 2. QΛ multiplies column 1 of Q by 4 and column 2 by 2:

QΛQᵀ = ½424−2111−1 = ½4 + 24 − 24 − 24 + 2 = 3113 ✓

The same product can be grouped another way: column 1 of QΛ times row 1 of Qᵀ, plus column 2 of QΛ times row 2 of Qᵀ (lesson 8, slide 3 uses this a lot). That gives A = λ₁q₁q₁ᵀ + λ₂q₂q₂ᵀ. A column times a row is a full matrix: entry (i, j) is entry i of q times entry j of q.

q₁q₁ᵀ = (1/√2) 11 (1/√2)11 = ½1111    q₂q₂ᵀ = (1/√2) 1−1 (1/√2)1−1 = ½1−1−11

Each qqᵀ is the projection matrix onto the line through q (lesson 5). So A splits x onto the two lines, stretches each piece by its λ, and adds them back:

4·½1111 + 2·½1−1−11 = 2222 + 1−1−11 = 3113 ✓

Check an eigenvector by multiplying

A times 1−1 gives 2−2 = 2·1−1: the short axis of the ellipse.

Keep reading with the full course

Finish lesson 7 and you will be able to: tell whether a system settles down or blows up.

Still locked here:

  • The rest of this explanation
  • 4 more examples with step-by-step solutions
  • Five extra members-only problems with worked solutions

$20 once, lifetime access. Lessons 1 to 3 stay free.

Examples

Example 1 · A diagonal matrix

A = 5001: Q = I, Λ = A. The axes are already perpendicular eigenvectors.

Exercise Make the columns of Q unit vectors, so that Q Lam Qᵀ gives back A. Edit the code and press Run.
slide_5.py Loading Python…
1
Output · Ctrl+Enter runs
Press Run to execute this slide's code. Ctrl+Enter works too.

Questions and comments

Stuck on something, or found a mistake? Ask here and I'll answer. You sign in with GitHub.

The full course

From Ax = b to PCA, by running it

Lessons 1 to 3 are free. Finish all eight and you will be able to:

You get: all 8 lessons with Python labs · every worked example and solution · 5 extra problems per lesson · your progress tracked · answers to your questions · every future update.

$20 once · lifetime access
Continue to checkout →

Already a member? Log in to the course