Linear Algebra, Live
Strang §3.3 · The complete solution to Ax = b

Every solution = one particular solution + the nullspace.

If Ax = b has one solution x_p, you get all of them by adding any vector from the nullspace. Nothing else solves it.

x = x_p + x_n     Ax_p = b,   Ax_n = 0

Think: a route plus a loop

You have one route that reaches the destination. Add any loop that brings you back to where you started, and you still reach the destination. Those loops are the nullspace.

With the boat: one throttle setting gives the motion you want. Add any cancelling combination, like (2, −1), and the boat moves exactly the same. The engines just work harder.

Why it is exactly this

  • Adding a nullspace vector keeps a solution: A(x_p + x_n) = b + 0 = b.
  • Any two solutions differ by a nullspace vector: if Ax = b and Ay = b, then A(x − y) = 0.

In the plot, the solutions form a line parallel to N(A), shifted so it passes through x_p.

Worked example

A = 1224, b = (4, 8). One solution is x_p = (4, 0).
N(A) = all c·(2, −1)  →  x = (4 + 2c, −c)
With c = −2: x = (0, 2). Check: 0 + 2·2 = 4 and 0 + 4·2 = 8 ✓
With b = (4, 9) instead, elimination ends in 0 = 1. b is off the column space line, so there is no solution at all.

How many solutions?

It depends on the rank r of an m by n matrix:

  • r = m = n: exactly one solution. A is invertible.
  • r = n < m: zero or one. More equations than unknowns.
  • r = m < n: infinitely many. Every b works, and there are free variables.
  • r < m and r < n: zero or infinitely many, depending on b.
Exercise Find a different solution of Ax = b, not (4, 0). Edit the code and press Run.
slide_4.py Loading Python…
1
Output · Ctrl+Enter runs
Press Run to execute this slide's code. Ctrl+Enter works too.
✎Lesson review
3 more worked examples and 5 mixed problems with solutions
→