Foundations for Robotics, ML & Control

Understand Eigenvalues
& Eigenvectors

A matrix bends almost every arrow it touches. A precious few it merely stretches. Those special directions — and the numbers that say how much they stretch — are the secret skeleton of stability, PCA, and Google's PageRank.

Prerequisites: How to multiply a 2×2 matrix by a vector + solving a quadratic. That's it.
6
Chapters
7+
Simulations
0
Assumed Knowledge

Chapter 0: Why — The Arrows That Refuse to Turn

A matrix is a machine that eats an arrow and spits out a different arrow. Feed it the arrow pointing east; it might hand you back an arrow pointing north-east, longer than before. Feed it a different arrow; it twists that one somewhere else entirely. In general a matrix does two things at once to whatever you give it: it rotates the arrow (changes its direction) and it stretches or shrinks it (changes its length).

Here is the surprise that this entire lesson is built around. For almost any matrix, there exist a few special arrows that the matrix refuses to rotate. It still stretches them — maybe doubles them, maybe flips them, maybe squashes them to a third of their length — but it leaves them pointing along exactly the same line they started on. They come out parallel to how they went in.

The whole idea in one sentence: Most directions get rotated and stretched by a matrix. A handful of magic directions get only stretched. Those directions are the eigenvectors, and the stretch factor along each one is its eigenvalue.

Why should you care about a few arrows that happen not to turn? Because they are the matrix's natural grain — like the grain in a plank of wood. Push along the grain and the wood behaves simply. Push across it and things get complicated. If you describe any motion in terms of these special directions, the messy rotating-and-stretching machine collapses into something almost embarrassingly simple: just independent stretching, one number per direction.

That simplification is why eigenvalues run through the spine of so much engineering. Whether a spring-mass system settles down or shakes itself apart is decided by eigenvalues. The directions PCA picks to compress your data are eigenvectors. The steady-state importance score PageRank assigns to a web page is an eigenvector. We will meet all three by the end. But first, just watch the phenomenon.

Watch which arrows turn — and which don't

Drag the blue input arrow around the circle. The blue arrow is what you feed in; the orange arrow is what the matrix A = [[2, 1], [1, 2]] hands back. Watch the faint angle between them. At two special angles the angle snaps to zero — input and output point the same way. Those are the eigenvectors.

angle between in & out: ——

Play with it until you feel it. Almost everywhere, the orange output peels away from the blue input — the matrix is rotating your arrow. But at two angles (for this matrix, the 45° line and the 135° line) the orange arrow lies exactly on top of the blue line, only longer or shorter. The matrix gave up rotating and just stretched. Notice the stretch is bigger on the 45° line than on the 135° line — that difference in stretch is the difference between the two eigenvalues.

Naming the magic. “Eigen” is German for “own” or “characteristic.” An eigenvector is a direction the matrix considers its own — a direction so natural to A that A leaves it alone except for scaling. The eigenvalue is how much A scales it. That's the entire vocabulary.
Check: What makes a direction an eigenvector of a matrix A?

Chapter 1: The Definition — A·v = λ·v

Chapter 0 gave you the picture. Now let's pin it down with symbols, because the picture is an equation in disguise. “The matrix A leaves the direction v unchanged, only stretching it by some factor” translates literally into:

A · v = λ · v

Read it slowly, left to right. On the left, A·v means “run the vector v through the matrix machine” — the rotating-and-stretching operation. On the right, λ·v means “take the very same vector v and just scale it by the single number λ” — pure stretching, no rotation. The equation says those two operations land in the same place. The matrix did nothing the scalar couldn't do.

Here every symbol, defined once and for all: A is a square matrix (n×n), our transformation machine. v is the eigenvector — a non-zero direction (an n-component column). λ (the Greek letter lambda) is the eigenvalue — a single number, the stretch factor for that direction. A negative λ means the arrow flips to point backwards; a λ between 0 and 1 means it shrinks; a λ greater than 1 means it grows.

Why v must be non-zero. If we allowed v = 0, the equation A·0 = λ·0 = 0 would hold for every number λ. The zero arrow has no direction to preserve, so it tells us nothing. We always demand v ≠ 0. Eigenvalues, by contrast, are perfectly allowed to be zero — λ = 0 just means A squashes that direction flat onto the origin.

Hand-check: is v an eigenvector or not?

The fastest way to own the definition is to test it. Take the matrix from Chapter 0,

A = [ [2, 1], [1, 2] ]

and let's test the candidate direction v = [1, 1] (the 45° arrow). Multiply A by v, one row at a time. Row 1 of A is [2, 1], so the top entry of A·v is 2×1 + 1×1 = 2 + 1 = 3. Row 2 of A is [1, 2], so the bottom entry is 1×1 + 2×1 = 1 + 2 = 3. Therefore:

A · [1, 1] = [3, 3] = 3 · [1, 1]

That's a perfect match to the pattern A·v = λ·v with λ = 3. The output [3, 3] is just the input [1, 1] tripled — same direction, stretched by 3. So [1, 1] is an eigenvector and its eigenvalue is 3. The 45° line you snapped to in Chapter 0 grows by a factor of three.

Now the other candidate, v = [1, −1] (the 135° arrow). Top entry: 2×1 + 1×(−1) = 2 − 1 = 1. Bottom entry: 1×1 + 2×(−1) = 1 − 2 = −1. So:

A · [1, −1] = [1, −1] = 1 · [1, −1]

Another match, this time with λ = 1. The 135° line is left completely fixed (stretched by 1, i.e. not at all). Two eigenvectors, two eigenvalues: 3 and 1. Exactly what the simulation showed — one direction stretched hard, the other barely touched.

To feel what a non-eigenvector looks like, try v = [1, 0] (pointing east). Top: 2×1 + 1×0 = 2. Bottom: 1×1 + 2×0 = 1. So A·[1,0] = [2, 1]. There is no single number λ with λ·[1,0] = [2,1], because [2,1] is not a multiple of [1,0] — it has tilted upward. East is not an eigenvector; the matrix rotated it. This is the common case.

The eigenvector test, in plain steps: (1) compute A·v; (2) check whether the result is a scalar multiple of v, i.e. every component scaled by the same factor; (3) if yes, that shared factor is the eigenvalue and v is an eigenvector; if the components scale by different factors, v is not an eigenvector.

An eigenvector is a whole line, not a single arrow

One subtlety worth nailing now: if v is an eigenvector, so is 2v, and 10v, and −v. Scaling v doesn't change the equation — A·(2v) = 2·(A·v) = 2·(λv) = λ·(2v). So eigenvectors come as entire lines through the origin, not single points. We usually pick a convenient representative, often the unit-length one. The eigenvalue, though, is pinned: the stretch factor 3 is 3 no matter how long the arrow you draw along that line.

python
import numpy as np

A = np.array([[2., 1.], [1., 2.]])

# Test a candidate by hand: is the output a scalar multiple of the input?
v = np.array([1., 1.])
out = A @ v                 # [3, 3]
ratios = out / v            # [3, 3]  -> all equal -> eigenvector!
print(out, ratios)         # [3. 3.] [3. 3.]

v2 = np.array([1., 0.])
print(A @ v2 / v2)         # [2.  inf] -> ratios DIFFER -> NOT an eigenvector
Reading the code: dividing the output component-by-component by the input is the numerical version of the hand test. Equal ratios ⇒ eigenvector (the shared ratio is λ). Unequal ratios ⇒ the matrix rotated it, so it's not an eigenvector. The inf in the last line is just 2÷0 from the east arrow — a flag that the ratios cannot agree.
Check: For A = [[2,1],[1,2]] you compute A·v = [6, −6] when v = [1, −1]×? — actually, what is the eigenvalue if A·v = [−4, 4] for the eigenvector v = [1, −1]?

Chapter 2: Finding Them — det(A − λI) = 0

So far we've only been able to check a guess. That's fine when someone hands you a candidate, but useless if you're staring at a fresh matrix with no idea which directions are special. We need a way to find the eigenvalues from scratch. The trick is a beautiful piece of algebraic judo.

Start from the definition and shove everything to one side:

A · v = λ · v  ⇒  A · v − λ · v = 0

We'd love to factor out v, but A is a matrix and λ is a number — you can't subtract a number from a matrix directly. The fix is the identity matrix I (1's on the diagonal, 0's elsewhere), the matrix that does nothing: I·v = v. So λ·v is the same as λI·v, and now everything is a matrix:

A · v − λI · v = 0  ⇒  (A − λI) · v = 0

Look hard at (A − λI)·v = 0. It says: the matrix (A − λI) takes our non-zero arrow v and crushes it to the zero vector. A matrix that can crush a non-zero arrow to nothing must be singular — it collapses space flat, losing a dimension. And the signature of a singular matrix is that its determinant is zero. (The determinant measures how much a matrix scales area/volume; a determinant of 0 means it flattens everything, which is exactly the collapse we need.) That gives us the master key:

det(A − λI) = 0

This is the characteristic equation. Expanding the determinant produces a polynomial in λ — the characteristic polynomial — whose roots are exactly the eigenvalues. For an n×n matrix it's a degree-n polynomial, so an n×n matrix has n eigenvalues (counting repeats and allowing complex ones).

The logic in one breath: “A stretches v” ⇒ “(A − λI) kills v” ⇒ “(A − λI) is singular” ⇒ “its determinant is 0.” Each arrow is an “if and only if,” so the eigenvalues are precisely the λ that make the determinant vanish — no more, no fewer.

The 2×2 determinant, then a full worked example

For a 2×2 matrix the determinant is the down-diagonal product minus the up-diagonal product:

det( [ [a, b], [c, d] ] ) = a·d − b·c

Let's grind a complete example by hand. Take

A = [ [4, 1], [2, 3] ]

Step 1 — build A − λI. Subtracting λI means subtracting λ from each diagonal entry, nothing else:

A − λI = [ [4 − λ, 1], [2, 3 − λ] ]

Step 2 — take its determinant using a·d − b·c, where now a = (4−λ), d = (3−λ), b = 1, c = 2:

det = (4 − λ)(3 − λ) − (1)(2)

Step 3 — expand the product, term by term so nothing hides. (4−λ)(3−λ) = 4·3 + 4·(−λ) + (−λ)·3 + (−λ)(−λ) = 12 − 4λ − 3λ + λ² = λ² − 7λ + 12. Then subtract the 2:

det = λ² − 7λ + 12 − 2 = λ² − 7λ + 10

Step 4 — set it to zero and solve. The characteristic equation is λ² − 7λ + 10 = 0. We need two numbers that multiply to 10 and add to 7. That's 5 and 2:

λ² − 7λ + 10 = (λ − 5)(λ − 2) = 0  ⇒  λ = 5  or  λ = 2

The eigenvalues of A are 5 and 2. Done — entirely by hand, every step visible.

Two free shortcuts that catch arithmetic slips. The eigenvalues of a 2×2 always satisfy: their sum equals the trace (sum of the diagonal, here 4 + 3 = 7) and their product equals the determinant of A (here 4·3 − 1·2 = 10). Check: 5 + 2 = 7 ✓ and 5 × 2 = 10 ✓. If your roots don't reproduce the trace and determinant, you made an error.

Finding the eigenvector once you have the eigenvalue

The eigenvalue tells you the stretch; to get the direction, plug λ back into (A − λI)·v = 0 and solve. For λ = 5: A − 5I = [[4−5, 1], [2, 3−5]] = [[−1, 1], [2, −2]]. The top row says −1·v₁ + 1·v₂ = 0, i.e. v₂ = v₁. So any multiple of [1, 1] is the eigenvector for λ = 5. (The bottom row, 2v₁ − 2v₂ = 0, says the same thing — it must, because the matrix is singular and the two rows are secretly the same equation.)

Quick verify: A·[1,1] = [4·1 + 1·1, 2·1 + 3·1] = [5, 5] = 5·[1,1]. ✓ The eigenvalue and its eigenvector agree.

Roots of the characteristic parabola

Drag the matrix entries. The curve is the characteristic polynomial λ² − (trace)λ + (det). Where it crosses zero (the orange dots) are the eigenvalues. Watch them go complex (curve lifts off the axis) when the discriminant turns negative.

a (top-left)4.0
b (top-right)1.0
c (bot-left)2.0
d (bot-right)3.0
python
import numpy as np

def eig_2x2(a, b, c, d):
    # characteristic poly: lam^2 - (trace) lam + (det) = 0
    tr  = a + d
    det = a * d - b * c
    disc = tr * tr - 4 * det          # the quadratic discriminant
    root = disc ** 0.5                # complex automatically if disc < 0
    return (tr + root) / 2, (tr - root) / 2

print(eig_2x2(4, 1, 2, 3))          # (5.0, 2.0)  -- matches our hand work
print(np.linalg.eigvals([[4.,1],[2,3]]))  # [5. 2.] -- the library agrees
Same answer, two ways. Our four-line function applies the quadratic formula to λ² − tr·λ + det = 0 (note the +tr÷2 ± root form is just (−b ± √disc)÷2a with a = 1, b = −tr). NumPy's eigvals does exactly what we did by hand — it builds the characteristic polynomial and finds its roots. The library is not magic; it's our procedure, automated.
Check: For A = [[6, 2], [2, 3]], the trace is 9 and det is 6·3 − 2·2 = 14. Without solving, which pair of eigenvalues is even possible?

Chapter 3: The Triangular Shortcut

Chapter 2's machinery — expand the determinant, build the polynomial, solve it — works for any matrix but it's labor. For one enormous family of matrices, you can skip the entire calculation and read the eigenvalues straight off. Those are the triangular matrices, and the shortcut is the single most useful trick in this lesson.

A matrix is upper-triangular when every entry below the main diagonal is zero (the non-zero stuff sits on or above the diagonal, forming a triangle in the upper-right). Lower-triangular is the mirror image, zeros above the diagonal. Here's the punchline:

The shortcut: For any triangular matrix — upper or lower — the eigenvalues are the diagonal entries. No determinant expansion, no polynomial, no quadratic formula. Just read down the diagonal.

Why it's true — proven from the determinant

This isn't a coincidence to memorize; it falls out of two facts. Fact 1: subtracting λI from a triangular matrix keeps it triangular (you only touch the diagonal, and the zeros stay put). Fact 2: the determinant of a triangular matrix is just the product of its diagonal entries — the off-diagonal stuff can't contribute, because every term in the determinant expansion that uses an off-diagonal entry is forced to also pick up one of the structural zeros, killing that term.

Watch it on a 3×3 upper-triangular matrix. Form A − λI:

A − λI = [ [a−λ, *, *], [0, b−λ, *], [0, 0, c−λ] ]

(The asterisks are whatever was above the diagonal — they don't matter.) By Fact 2, the determinant is the product of the diagonal:

det(A − λI) = (a − λ)(b − λ)(c − λ)

Set it to zero: (a−λ)(b−λ)(c−λ) = 0. A product is zero exactly when one of its factors is zero, so the solutions are λ = a, λ = b, λ = c — the diagonal entries themselves. The characteristic polynomial came pre-factored. That's the whole proof.

Reading off the assessment matrix

Now the matrix this lesson was built around — the one from the AA174A pre-knowledge assessment:

A = [ [5, 3, 1], [0, −2, −4], [0, 0, 1] ]

Every entry below the diagonal is zero, so it's upper-triangular. By the shortcut, the eigenvalues are the diagonal entries read top-left to bottom-right:

λ = 5,   λ = −2,   λ = 1

That's the answer to the assessment question — 5, −2, and 1 — and you can see it in under a second without writing a single line of algebra. To convince yourself it isn't sleight of hand, do it the long way for this matrix: A − λI = [[5−λ, 3, 1], [0, −2−λ, −4], [0, 0, 1−λ]]. Expanding the determinant along the first column (which has a single non-zero entry, 5−λ, since the two below it are zero) gives (5−λ) times the determinant of [[−2−λ, −4], [0, 1−λ]]. That inner 2×2 is itself triangular, so its determinant is (−2−λ)(1−λ). Altogether det = (5−λ)(−2−λ)(1−λ) — the diagonal product, exactly as promised.

Why this matters far beyond a quiz. Algorithms like the QR algorithm find eigenvalues of arbitrary matrices by repeatedly nudging them toward triangular form, then reading the diagonal. The triangular shortcut isn't a special case — it's the destination that general eigenvalue solvers are racing toward. Triangular is where eigenvalues become free.
Triangular eigenvalue reader

Drag the diagonal entries of this 3×3 upper-triangular matrix. The orange highlighted diagonal is, instantly, the list of eigenvalues. The off-diagonal numbers (greyed) never affect them.

diag ₁5
diag ₂-2
diag ₃1
python
import numpy as np

A = np.array([[5., 3, 1],
              [0, -2, -4],
              [0, 0, 1]])

# The shortcut: eigenvalues ARE the diagonal of a triangular matrix.
print(np.diag(A))               # [ 5. -2.  1.]

# The general solver agrees (order may differ -- eigenvalues are a SET).
print(sorted(np.linalg.eigvals(A).real))  # [-2.0, 1.0, 5.0]
Eigenvalues are a set, not a list. np.diag returns them in diagonal order (5, −2, 1) while the solver may return them sorted or in any order. That's fine — the eigenvalues of a matrix form an unordered collection. We sorted them only to make the equality obvious to the eye.
Check: What are the eigenvalues of the lower-triangular matrix [[7, 0, 0], [9, −3, 0], [4, 5, 2]]?

Chapter 4: Power Iteration — Letting the Matrix Reveal Itself

Solving the characteristic polynomial is fine for 2×2 or 3×3 matrices. But PageRank operates on a matrix with billions of rows — one per web page. Nobody is expanding a billion-degree polynomial. There's a gorgeous, almost lazy alternative that finds the most important eigenvector by doing nothing but multiplying repeatedly. It's called power iteration, and it's the engine inside PageRank.

The recipe is almost insultingly simple. Start with any random vector. Multiply it by A. Normalize it back to length 1 (so it doesn't blow up or vanish). Multiply by A again. Normalize again. Repeat. The vector swings around and then locks onto the eigenvector with the largest eigenvalue — the dominant eigenvector. Watch:

Start
pick any v₀ ≠ 0
Multiply
w = A · v
Normalize
v = w / ‖w‖
↻ repeat

Why on earth does it converge?

Here is the entire secret, and it's worth savoring. Any starting vector can be written as a blend of the eigenvectors. Suppose A has eigenvectors v₁, v₂ with eigenvalues λ₁, λ₂, and we write our start as a mix:

v₀ = c₁ v₁ + c₂ v₂

Now multiply by A. Because each v is an eigenvector, A just scales each piece by its own λ:

A v₀ = c₁ λ₁ v₁ + c₂ λ₂ v₂

Multiply by A again, and each piece picks up another factor of its eigenvalue. After k multiplications:

Aᵏ v₀ = c₁ λ₁ᵏ v₁ + c₂ λ₂ᵏ v₂

Now suppose λ₁ is the bigger eigenvalue (say λ₁ = 4, λ₂ = 1). Then λ₁ᵏ = 4ᵏ rockets up while λ₂ᵏ = 1ᵏ stays at 1. After 10 steps the first piece is scaled by 4¹⁰ ≈ 1,000,000 and the second by 1. The v₁ piece utterly drowns out the v₂ piece. Whatever you started with, after enough multiplications the vector points essentially all in the v₁ direction. Normalizing each step just keeps the length sane while this domination plays out.

The race nobody else can win. Each eigen-component grows like λᵏ. The biggest λ has the steepest exponential, so it wins the race by a landslide — and the gap widens every step. That's why power iteration always finds the dominant eigenvector (as long as your start isn't perfectly perpendicular to it, a measure-zero accident). The speed of convergence depends on the ratio |λ₂|∕|λ₁| — a big gap means fast lock-on; eigenvalues close in size means a slow crawl.

We can also recover the eigenvalue itself, not just its direction. Once v has locked onto the dominant eigenvector, the Rayleigh quotient reads off the eigenvalue: λ ≈ vᵀ A v (for a unit-length v). It literally asks “by what factor did A stretch v?” and since v is now an eigenvector, that factor is the eigenvalue.

One step, by hand

Take A = [[2, 1], [1, 3]] and start at v₀ = [1, 0]. Multiply: w = A·[1,0] = [2·1 + 1·0, 1·1 + 3·0] = [2, 1]. Rayleigh estimate before normalizing v: λ ≈ v₀ᵀ w = [1,0]·[2,1] = 1·2 + 0·1 = 2. Normalize: ‖[2,1]‖ = √(4+1) = √5 ≈ 2.236, so v₁ = [2, 1]÷2.236 = [0.894, 0.447]. Already the vector has tilted away from pure east toward the dominant direction. Repeat a few times and the Rayleigh estimate climbs toward the true dominant eigenvalue, which for this matrix is (5 + √5)÷2 ≈ 3.618.

python
import numpy as np

def power_iteration(A, steps=25):
    v = np.array([1., 0.])      # any non-zero start works
    for _ in range(steps):
        w   = A @ v                # multiply
        lam = v @ w                # Rayleigh quotient (v is unit-norm)
        v   = w / np.linalg.norm(w)# normalize back to length 1
    return lam, v

A = np.array([[2., 1], [1, 3]])
lam, v = power_iteration(A)
print(round(lam, 4))                        # ~3.618
print(max(np.linalg.eigvals(A).real))      # 3.618... -- exact match
Same destination, two roads. np.linalg.eigvals solves the polynomial and returns all eigenvalues at once; power iteration finds only the dominant one but does so with nothing fancier than matrix–vector products — which is exactly why it scales to billion-page web graphs where polynomial methods are hopeless.
Check: A matrix has eigenvalues 5 and −1. Run power iteration. Which eigenvector does the normalized vector lock onto, and why?

Chapter 5: Why It Matters — Stability, PCA, PageRank

You can now find eigenvalues four ways: by definition-checking, by the characteristic polynomial, by the triangular shortcut, and by power iteration. This final chapter is the payoff — why three of the most important systems in engineering are, underneath, just eigenvalue problems. And it's where the showcase simulation lets you watch the dominant eigenvector emerge from a cloud of iterates.

1. Stability of dynamical systems

Imagine a system whose state x evolves by repeated multiplication: xₘ₊₁ = A·xₘ. (A spring-mass-damper discretized in time looks exactly like this.) Will the system settle to rest, or shake itself apart? Decompose the state into eigenvectors, and each component just multiplies by its eigenvalue every step — the same exponential race from Chapter 4. So:

This is precisely the story told in the ODEs → State-Space lesson, where the spring-damper's behavior — overdamped crawl, critically-damped snap, underdamped oscillation, or unstable blow-up — is decided entirely by the eigenvalues of its state matrix A. The discriminant b² − 4mk that sorts the four regimes there is nothing but the discriminant of the characteristic polynomial we built in Chapter 2. The regimes are the eigenvalues. A negative real part means decay (stable); a non-zero imaginary part means oscillation; a positive real part means it shakes itself apart.

The one-line stability test. Compute the eigenvalues of your system matrix and look at where they sit. Discrete time: inside the unit circle = stable. Continuous time: in the left half-plane (negative real part) = stable. Every controls engineer's first instinct, when asked “is it stable?”, is “what are the eigenvalues?”

2. PCA — the directions of maximum variance

Given a cloud of data points, Principal Component Analysis asks: along which direction does the data vary the most? Form the covariance matrix of the data; its eigenvectors are the principal directions, and each eigenvalue is the amount of variance captured along its eigenvector. The biggest eigenvalue points along the data's longest axis. Keep the top few eigenvectors and you've compressed the data while throwing away the least information — that's dimensionality reduction in one sentence.

3. PageRank — the web's dominant eigenvector

Google's original ranking treats the web as a giant matrix: entry (i, j) is the probability a random surfer hops from page j to page i. The importance score of every page is the dominant eigenvector of that matrix — the steady-state distribution of where a random surfer spends their time. And how do you find the dominant eigenvector of a billion-by-billion matrix? Power iteration, exactly Chapter 4. PageRank is power iteration on the web graph. The whole edifice of early Google search is one eigenvector.

The showcase: watch power iteration converge

Below is the lesson's centerpiece. A 2×2 matrix A acts on a vector; we repeatedly multiply and normalize, drawing each iterate. You control A. Watch the trail of arrows fan out and then collapse onto the dominant eigenvector — and watch the eigenvalue estimate climb to the true value. Push the off-diagonal coupling and stretch values around; make the two eigenvalues nearly equal and watch convergence slow to a crawl (that's the |λ₂|∕|λ₁| ratio biting).

Showcase — power iteration converging to the dominant eigenvector

The teal lines are the true eigenvectors. The fading blue arrows are the iterates v₀, v₁, v₂, … The bright orange arrow is the current estimate. Press Step to advance one multiplication, or Run to animate. Watch the orange arrow swing onto the dominant teal line.

A: top-left2.00
A: off-diag (b=c)1.00
A: bottom-right3.00
start angle20°
The Feynman test for this whole lesson. If you can watch that orange arrow snap onto the teal line and narrate why — “the dominant eigenvalue's exponential is winning the race, dragging any starting vector onto its eigenvector” — then you understand eigenvalues at the level that lets you reason about stability, build PCA, and explain PageRank. That's the whole point.

Cheat sheet

IdeaFormula / RuleWhat it means
DefinitionA·v = λ·v, v ≠ 0v is a direction A only stretches; λ is the stretch factor.
Find eigenvaluesdet(A − λI) = 0Roots of the characteristic polynomial.
2×2 checkssum = trace, product = detFree sanity check on your roots.
Triangular shortcutλ = diagonal entriesRead them off directly; no algebra.
Power iterationv ← A·v / ‖A·v‖Converges to the dominant eigenvector.
Eigenvalue from vectorλ ≈ vᵀA·vRayleigh quotient (v unit-length).
Stability (discrete)all |λ| < 1System decays to rest.
Stability (continuous)all Re(λ) < 0Negative real part = decay.

Where to go next

You've met eigenvalues as stretch factors, learned four ways to find them, and seen them decide stability, drive PCA, and rank the web. The natural next step is to see them in action governing a physical system: the ODEs → State-Space lesson takes a spring-mass-damper, writes it as x′ = A·x, and shows that the eigenvalues of A — their real parts and imaginary parts — are exactly the damping regimes you can feel when you tap a real spring. Everything you proved here about the characteristic polynomial becomes the discriminant that sorts a wobble from a crash.

Feynman's closing thought. “What I cannot create, I do not understand.” You no longer just recognize eigenvalues — you can compute them by hand, prove the triangular shortcut, code power iteration from scratch, and explain why each method works. That's creation, not recognition. The Code Lab and Workbook below are where you prove it to yourself.
Check: A discrete-time system xₘ₊₁ = A·xₘ has eigenvalues 0.9 and 1.2. Is it stable?

Code Lab — build power iteration and watch the arrow lock on

Chapter 5's showcase let you press Step on a finished animation. Here you write the two lines that ARE power iteration and watch your code swing a unit arrow onto the dominant eigenvector — the same A = [[2, 1], [1, 3]] from Chapter 4, dominant eigenvalue (5 + √5)/2 ≈ 3.618. Press Run (Python boots once, ~5s), then play the animation.

Exercises & Workbook

The lesson showed you eigenvalues four ways. This workbook makes you produce them — every exercise asks you to derive, trace, build, design, or debug, never just recall. Work them with a blank sheet and a pencil; the answers check your arithmetic, and every reveal walks the full path. Nothing is a placeholder.

Mastery
0 / 32 exercises (0%)
0
Day Streak
Best: 0

Part A — The definition A·v = λ·v

Everything starts with one equation: the matrix only stretches an eigenvector. These exercises make you test that pattern in both directions.

A.1 — What an eigenvector is Trace
A·v = λ·v with v ≠ 0. What does this equation say in words?
A.2 — Verify an eigenpair Derive

For A = [[3, 0], [8, −1]], the vector v = [0, 1] is claimed to be an eigenvector. Compute A·v and read off the eigenvalue. Enter λ.

Hint: A·[0,1] picks out the second column of A.

λ
Show derivation
A·[0,1]: top = 3·0 + 0·1 = 0;   bottom = 8·0 + (−1)·1 = −1
A·[0,1] = [0, −1] = −1 · [0, 1]  ⇒  λ = −1

Every component scaled by the same −1, so [0,1] is genuinely an eigenvector and its eigenvalue is −1.

A.3 — Eigenvalue of an eigenpair Derive

A matrix sends the eigenvector v = [2, −2] to A·v = [−6, 6]. Since [−6, 6] is a scalar multiple of [2, −2], what is the eigenvalue?

λ
Show derivation
[−6, 6] = λ · [2, −2]  ⇒  −6 = 2λ  ⇒  λ = −3

Check the other component: −3 × (−2) = 6 ✓. The negative eigenvalue means A flips the arrow backwards and triples its length.

A.4 — The non-eigenvector test Trace
For A = [[2,1],[1,2]] you compute A·[1,0] = [2,1]. Why is [1,0] NOT an eigenvector?
A.5 — Scaling an eigenvector Trace
v is an eigenvector of A with eigenvalue 4. What is the eigenvalue of the vector 7v (seven times longer)?
A.6 — Implement the eigenpair test Build

Write stretch(a, b, c, d, v1, v2) for A = [[a,b],[c,d]] and v = [v1, v2]. Return the array A·v = [a·v1 + b·v2, c·v1 + d·v2].

Show solution
javascript
function stretch(a, b, c, d, v1, v2) {
  return [a * v1 + b * v2, c * v1 + d * v2];
}
The Part A formula. A·v = λ·v means the output is the input scaled by one number. To test a candidate, multiply and check that every component scaled by the same factor. Same factor ⇒ eigenvector, and that factor is λ.

Part B — The characteristic polynomial det(A − λI) = 0

To find eigenvalues from scratch you expand a determinant into a polynomial and solve it. These drill the full 2×2 grind, plus the trace/determinant sanity checks.

B.1 — Form A − λI Trace
For A = [[4,1],[2,3]], what is A − λI?
B.2 — Constant term of the characteristic polynomial Derive

For A = [[4,1],[2,3]], the characteristic polynomial is λ² − (trace)λ + (det). What is its constant term (the determinant of A)?

Hint: det = a·d − b·c.

det A
Show derivation
det A = 4·3 − 1·2 = 12 − 2 = 10
char. poly = λ² − 7λ + 10

The constant term of the 2×2 characteristic polynomial is always exactly det A. The coefficient of λ (with its minus sign) is the trace.

B.3 — Solve for the larger eigenvalue Derive

Solve λ² − 7λ + 10 = 0 (the polynomial of A = [[4,1],[2,3]]). Enter the larger root.

Hint: two numbers multiplying to 10 and adding to 7.

λ
Show derivation
λ² − 7λ + 10 = (λ − 5)(λ − 2) = 0
λ = 5  or  λ = 2

Check: 5 + 2 = 7 = trace ✓, 5 × 2 = 10 = det ✓. Both shortcuts confirm the roots.

B.4 — Eigenvalues from trace and determinant Derive

A 2×2 matrix has trace 0 and determinant −9. Its eigenvalues sum to 0 and multiply to −9. Enter the positive eigenvalue.

λ
Show derivation
λ₁ + λ₂ = 0 ⇒ λ₂ = −λ₁
λ₁ · (−λ₁) = −9 ⇒ −λ₁² = −9 ⇒ λ₁ = 3, λ₂ = −3

Trace and determinant alone pin down the eigenvalues of a 2×2 — you never even needed the matrix entries.

B.5 — The discriminant and complex eigenvalues Derive

For A = [[0,−1],[1,0]] (a 90° rotation), trace = 0 and det = 1, so the polynomial is λ² + 1 = 0. Compute the discriminant tr² − 4det.

A negative discriminant means complex eigenvalues — no real direction is preserved, which makes sense for a pure rotation.

disc
Show derivation
disc = tr² − 4det = 0² − 4(1) = −4
λ = (0 ± √−4)/2 = ±i

Negative discriminant → complex eigenvalues ±i. A 90° rotation has NO real eigenvector — every real arrow gets turned, which is exactly what the imaginary eigenvalues encode.

B.6 — Find the eigenvector for a known eigenvalue Derive

For A = [[4,1],[2,3]] and the eigenvalue λ = 2, the equation (A − 2I)v = 0 has top row (4−2)v₁ + 1·v₂ = 0, i.e. 2v₁ + v₂ = 0. If v₁ = 1, what is v₂?

v₂
Show derivation
2(1) + v₂ = 0 ⇒ v₂ = −2
eigenvector for λ=2 is [1, −2]

Verify: A·[1,−2] = [4−2, 2−6] = [2, −4] = 2·[1,−2] ✓. Plugging λ back into (A−λI)v=0 always recovers the direction.

B.7 — Implement the 2×2 eigenvalue solver Build

Write eig2(a, b, c, d) returning the two real eigenvalues of [[a,b],[c,d]] as [larger, smaller] using the quadratic formula on λ² − (a+d)λ + (ad−bc).

Show solution
javascript
function eig2(a, b, c, d) {
  var tr = a + d, det = a * d - b * c;
  var root = Math.sqrt(tr * tr - 4 * det);
  return [(tr + root) / 2, (tr - root) / 2];
}
B.8 — The sign-error bug in det(A − λI) Debug

A student expands the characteristic polynomial of A = [[4,1],[2,3]]. Exactly one line has a sign error. Click it.

A - λI = [[4-λ, 1], [2, 3-λ]]
det = (4-λ)(3-λ) - (1)(2)
expand: (4-λ)(3-λ) = 12 - 7λ + λ²
det = 12 - 7λ + λ² + 2        # subtract the off-diagonal product
char. poly: λ² - 7λ + 14 = 0
(this gives the wrong roots)
B.9 — Order the eigenvalue-finding recipe Design

Put the steps of finding eigenvalues via the characteristic polynomial in order.

?
?
?
?
solve poly for λ form A − λI expand into a polynomial take determinant, set = 0
The Part B engine. det(A − λI) = 0 is the master key. Subtract λ from the diagonal, take the determinant, get a polynomial, solve. For 2×2 always cross-check: roots sum to the trace, multiply to the determinant.

Part C — The triangular shortcut

When a matrix is triangular, the eigenvalues are its diagonal. These exercises drill the shortcut and the assessment matrix it was built for.

C.1 — Eigenvalues of the assessment matrix Trace
What are the eigenvalues of [[5,3,1],[0,−2,−4],[0,0,1]]?
C.2 — Sum of the assessment eigenvalues Derive

The trace (sum of the diagonal) always equals the sum of the eigenvalues. For [[5,3,1],[0,−2,−4],[0,0,1]], what is that sum?

sum
Show derivation
5 + (−2) + 1 = 4

The trace equals the sum of eigenvalues for ANY square matrix, triangular or not — here it's also just the diagonal sum.

C.3 — Product of the assessment eigenvalues Derive

The determinant always equals the product of the eigenvalues. For the assessment matrix, what is 5 × (−2) × 1?

det
Show derivation
5 × (−2) × 1 = −10

det = product of eigenvalues. For a triangular matrix the determinant is also just the diagonal product, so both views agree: −10.

C.4 — Why the off-diagonal doesn't matter Trace
In det(A − λI) = (5−λ)(−2−λ)(1−λ) for the triangular matrix, why did the 3, 1, −4 above the diagonal vanish?
C.5 — A diagonal matrix Derive

A diagonal matrix is triangular both ways. For diag(7, 0, −3), enter the eigenvalue that equals zero's neighbor on the diagonal — specifically, the largest eigenvalue.

λmax
Show derivation
diag(7, 0, −3) ⇒ λ = 7, 0, −3
largest = 7

A zero on the diagonal is a perfectly valid eigenvalue — it means the matrix flattens that direction to the origin.

C.6 — Implement the triangular reader Build

Write triEig(d1, d2, d3) that returns the eigenvalues of a 3×3 triangular matrix whose diagonal is [d1, d2, d3]. Just return the diagonal as an array.

Show solution
javascript
function triEig(d1, d2, d3) {
  return [d1, d2, d3];
}
C.7 — The misread-triangular bug Debug

A student finds eigenvalues of the upper-triangular [[5,3,1],[0,−2,−4],[0,0,1]]. Exactly one line is wrong. Click it.

matrix is upper-triangular (zeros below diagonal)
shortcut: eigenvalues = the diagonal entries
diagonal = 5, -2, 1
eigenvalues = 5, 3, 1     # read the top ROW instead of the diagonal
check: sum should equal trace 5 + (-2) + 1 = 4
but 5 + 3 + 1 = 9 ≠ 4, so something is wrong
The Part C shortcut. Triangular (or diagonal) ⇒ eigenvalues are the diagonal entries, read straight off. Cross-check with the trace (their sum) and determinant (their product). Reading a row instead of the diagonal is the classic slip.

Part D — Power iteration & the dominant eigenvalue

Repeated multiply-and-normalize finds the biggest eigenvalue without any polynomial. These exercises run the loop by hand and reason about its convergence.

D.1 — One multiplication step Derive

Power iteration on A = [[2,1],[1,3]] starts at v = [1, 0]. Compute w = A·v and enter its top component.

w₁
Show derivation
w = A·[1,0]: top = 2·1 + 1·0 = 2; bottom = 1·1 + 3·0 = 1

w = [2, 1]. The vector has already tilted off the x-axis toward the dominant direction.

D.2 — The Rayleigh quotient estimate Derive

With v = [1, 0] (unit-length) and w = A·v = [2, 1], the eigenvalue estimate is λ ≈ vᵀw = v₁w₁ + v₂w₂. Compute it.

λ est
Show derivation
vᵀw = 1·2 + 0·1 = 2

First estimate is 2; the true dominant eigenvalue of this matrix is about 3.618, so iterating will climb the estimate upward.

D.3 — Normalize the vector Derive

After w = [2, 1], the norm is ‖w‖ = √(2² + 1²) = √5 ≈ 2.236. Compute the top component of the normalized vector v = w/‖w‖. (Round to 3 decimals.)

v₁
Show derivation
‖w‖ = √(4 + 1) = √5 ≈ 2.236
v₁ = 2 / 2.236 ≈ 0.894

Normalizing keeps the length at 1 so the vector neither explodes nor vanishes over many steps — only its direction matters.

D.4 — Which eigenvector wins Trace
A has eigenvalues 6 and 2. After many power-iteration steps, the 6-component is scaled by 6ᵏ and the 2-component by 2ᵏ. Why does the vector lock onto the 6-eigenvector?
D.5 — Convergence speed Trace
Two matrices: matrix X has eigenvalues 10 and 1; matrix Y has eigenvalues 10 and 9. Which converges faster under power iteration?
D.6 — Implement power iteration Build

Write powerStep(a, b, c, d, v1, v2) for A = [[a,b],[c,d]] and unit vector v = [v1, v2]. Multiply w = A·v, then return the normalized [w1/norm, w2/norm] where norm = √(w1² + w2²).

Show solution
javascript
function powerStep(a, b, c, d, v1, v2) {
  var w1 = a * v1 + b * v2, w2 = c * v1 + d * v2;
  var norm = Math.sqrt(w1 * w1 + w2 * w2);
  return [w1 / norm, w2 / norm];
}
D.7 — Order the power-iteration loop Design

Put one iteration of power iteration in the correct order.

?
?
?
?
normalize v = w/‖w‖ pick v ≠ 0 multiply w = A·v estimate λ = vᵀw
D.8 — The normalization bug Debug

A student writes a power-iteration loop. Exactly one line breaks it. Click it.

v = [1, 0]                  # start
for step in range(25):
    w = A @ v               # multiply
    lam = v @ w             # Rayleigh estimate
    v = w                   # forgot to normalize! v grows without bound
return lam, v
The Part D engine. Multiply, estimate (Rayleigh), normalize, repeat. The biggest eigenvalue's exponential wins the race, so the vector locks onto its eigenvector. Skip normalization and the numbers overflow; convergence speed is set by the ratio of the two largest eigenvalues.

Part E — Stability, design & the big picture

Eigenvalues decide whether a dynamical system settles or explodes. These exercises connect eigenvalues to stability and ask you to design matrices with target eigenvalues.

E.1 — Discrete-time stability Trace
A system xₘ₊₁ = A·xₘ has eigenvalues 0.5 and 0.8. Is it stable?
E.2 — Continuous-time stability Trace
A continuous system x′ = A·x has eigenvalues −2 ± 3i. Is it stable, and does it oscillate?
E.3 — Design a diagonal matrix with given eigenvalues Design

You want a 2×2 matrix with eigenvalues 3 and −5. The easiest construction is diagonal. Enter the trace (which must equal 3 + (−5)) of your matrix.

trace
Show derivation
diag(3, −5) has eigenvalues 3, −5 directly
trace = 3 + (−5) = −2

To build a matrix with target eigenvalues, the trivial answer is to put them on the diagonal. The trace then equals their sum, −2.

E.4 — Design via trace & determinant Derive

You want a (non-diagonal) 2×2 matrix with eigenvalues 4 and 1. Any such matrix must have determinant equal to their product. What determinant must you target?

det
Show derivation
det = product of eigenvalues = 4 × 1 = 4
e.g. [[2,1],[2,3]] has trace 5, det 4 ⇒ eigenvalues 4, 1

Fix trace = 5 (= sum) and det = 4 (= product) and ANY 2×2 with those two invariants has eigenvalues 4 and 1, diagonal or not.

E.5 — Implement a discrete-stability classifier Build

Write isStable(lam1, lam2) returning true if BOTH eigenvalues satisfy |λ| < 1 (discrete-time stable), else false.

Show solution
javascript
function isStable(lam1, lam2) {
  return Math.abs(lam1) < 1 && Math.abs(lam2) < 1;
}
E.6 — The stability sign-flip bug Debug

A student writes a continuous-time stability check (x′ = A·x is stable iff every eigenvalue has negative real part). Exactly one line has the test backwards. Click it.

eigs = eigenvalues(A)           # may be complex
stable = True
for lam in eigs:
    if lam.real > 0:            # POSITIVE real part means stable
        stable = False
return stable                   # comment is backward: positive real = UNSTABLE
E.7 — PageRank as power iteration Trace
Why does Google's PageRank use power iteration instead of solving det(A − λI) = 0 directly?
You can now create, not just recognize. Across 32 exercises you verified eigenpairs, expanded characteristic polynomials by hand, read triangular diagonals, ran power iteration step-by-step, classified stability, and designed matrices to hit target eigenvalues. That is the Feynman bar: what you can build, you understand.