Linear Algebra, Live
Strang §6.5 · Positive definite matrices

Positive definite matrices: every eigenvalue positive

Slide 5 showed that a symmetric matrix stretches along perpendicular axes, each by its own eigenvalue. Now ask for the nicest case: every one of those stretches is positive, so no axis is flipped. Such a matrix is called positive definite. Think of a marble. In a bowl it rolls to the one lowest point, wherever you drop it. On a horse saddle it rolls off, because one direction goes up and another goes down. For a symmetric A, the height over the point x is the number xᵀAx. Positive definite matrices give bowls: xᵀAx > 0 for every x except 0. One negative eigenvalue gives a saddle.

Lesson 7 · slide 6Positive definite
A positive definite ⇔ all λ > 0 ⇔ xᵀAx > 0 for all x ≠ 0
Key ideas
  1. A symmetric A is positive definite when all its eigenvalues are positive.
  2. Equivalent test: the energy xᵀAx (defined below) > 0 for every nonzero x.
  3. For 2 by 2 abbc: a > 0 and ac − b² > 0. (Also: all pivots positive.)
  4. The graph of xᵀAx is a bowl. One negative eigenvalue turns it into a saddle.

The number xᵀAx

xᵀAx is the dot product of x with Ax: one number for every x, often called the energy. The name comes from springs: for the row of springs in the bigger example below, ½xᵀAx is the energy stored when the masses are moved by x. For A = abbc and a point x = xy, writing x and y for its two entries:

xᵀAx = a x² + 2b xy + c y²
A = 2112:   2x² + 2xy + 2y² = x² + y² + (x + y)²
At 10: 2.   At 1−1: 2 − 2 + 2 = 2.   At 11: 2 + 2 + 2 = 6

It is a sum of squares, so it is positive unless x = 0. Read it as a surface: for every point of the floor, raise a dot to height xᵀAx; the dots form a surface. Here that surface is a bowl with its lowest point at the origin. Since xᵀAx = x · Ax, being positive also means Ax never points more than 90° away from x (lesson 1: a positive dot product means an angle under 90°).

A positive definite matrix. The unit eigenvectors q₁ and q₂ are stretched forward (λ = 3 and λ = 1), never flipped. Every arrow stays within 90° of where it started.

The eigenvalue test

Write x in the perpendicular unit eigenvectors from slide 5: x = k₁q₁ + k₂q₂. Then Ax = λ₁k₁q₁ + λ₂k₂q₂. Multiply out the dot product of the two, using q₁ · q₁ = q₂ · q₂ = 1 and q₁ · q₂ = 0:

xᵀAx = (k₁q₁ + k₂q₂) · (λ₁k₁q₁ + λ₂k₂q₂)
= λ₁k₁²(q₁ · q₁) + λ₂k₁k₂(q₁ · q₂) + λ₁k₂k₁(q₂ · q₁) + λ₂k₂²(q₂ · q₂)
= λ₁k₁² + 0 + 0 + λ₂k₂² = λ₁k₁² + λ₂k₂²

Both λ positive: this is positive for every nonzero x. A bowl. One λ negative: move along its eigenvector and xᵀAx goes negative. A saddle. Both λ negative: xᵀAx is negative for every nonzero x, an upside-down bowl (a hilltop).

A = 2112: λ = 3 and 1, both positive. Bowl
A = 2332: λ = 5 and −1. Saddle: x = 1−1 gives xᵀAx = 2 − 6 + 2 = −2
A saddle matrix. q₁ is stretched 5 times, but q₂, on the line through 1−1, is flipped to point the other way: λ = −1. Along that line the height xᵀAx goes negative.
Ax = −11 for x = 1−1. Then xᵀAx = 1·(−1) + (−1)·1 = −2: below zero, so this is not a bowl.

Quick tests for 2 by 2

abbc is positive definite exactly when a > 0 and ac − b² > 0. The determinant ac − b² equals λ₁λ₂ (slide 2), so a negative determinant means one λ is negative: a saddle. A positive determinant means both λ have the same sign. Why also a > 0? Because a is xᵀAx at x = 10, so a > 0 rules out both λ being negative (the upside-down bowl). For 2bb2, the determinant 4 − b² is negative (a saddle) when b² > 4.

4223:   a = 4 > 0,   ac − b² = 12 − 4 = 8 > 0.   Positive definite
1331:   ac − b² = 1 − 9 = −8 < 0.   Saddle

The pivot test

Elimination gives the same answer: A is positive definite exactly when all its pivots (lesson 2) are positive. For a 2 by 2 matrix the pivots are a and (ac − b²)/a, so this is the same test as above:

2112  →  row 2 − ½·row 1  →  2101.5:   pivots 2 and 1.5, both positive ✓

Pivots are the cheap test for big matrices: one pass of elimination, no eigenvalues needed.

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 bowl

A = 3001: xᵀAx = 3x² + y², positive for x ≠ 0. λ = 3 and 1.

Exercise Change b so that A is no longer positive definite: the bowl becomes a saddle. Edit the code and press Run.
slide_6.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