Solving Ax = b: one, none, or infinitely many
The question
Three equations in three unknowns describe three planes in space. Do they share exactly one point, infinitely many points, or none?
Sort six systems; the page draws the planes after each answer.
- 1 SeeSort six systems by their solutions.
- 2 TryMove the right side, predict the outcome.
- 3 ProveBuild the rank test, line by line.
- 4 ApplySix problems, two with bond prices.
Before you start · 3 quick checks on a matrix times a vector, rank and the null space, about 3 min
Two ideas before you start
2 ideasEach equation draws a line, or in space a plane
Figure: the solid line x + y = 2 and a dashed second line, with their common point when there is exactly one. It needs JavaScript.
Solid: x + y = 2 Dashed: x − y = 0
Common points: One common point: (1, 1).
A solution has to satisfy every equation at once, so it is a point on every line. Two lines can cross once, run parallel, or be the same line.
Exact definition
A linear system. A system of \(m\) linear equations in \(n\) unknowns \(x_1, \dots, x_n\) is
\[\begin{aligned} &a_{i1}x_1 + \dots + a_{in}x_n = b_i, \\ &i = 1, \dots, m, \end{aligned}\]with real numbers \(a_{ij}\) and \(b_i\). With the \(m \times n\) coefficient matrix \(A = (a_{ij})\), the unknown vector \(x \in \mathbb{R}^n\) and the right side \(b \in \mathbb{R}^m\), it is \(Ax = b\). A solution is a vector \(x\) that satisfies all \(m\) equations; the solution set is the set of all solutions.
The row picture. An equation whose coefficients are not all 0 describes a line when \(n = 2\) and a plane when \(n = 3\). A solution is a point that lies on all of them. An equation \(0x_1 + \dots + 0x_n = c\) holds for every \(x\) when \(c = 0\) and for no \(x\) when \(c \ne 0\).
Elimination ends in 0 = 0 or 0 = c
Figure: the solid line x + y = 2 and the second equation after one elimination step. It needs JavaScript.
Row 2 − row 1: −2y = −2
rank A = 2 rank [A | b] = 2
Subtracting a multiple of one equation from another keeps the same solutions. When the left side vanishes, the row reads 0 = 0, true everywhere (shaded), or 0 = c with c not 0, true nowhere.
Exact definition
Row operations. The augmented matrix \([A \mid b]\) is \(A\) with \(b\) added as a last column. Elimination uses three row operations: swap two rows, multiply a row by a nonzero number, and add a multiple of one row to another. Each can be undone by another row operation, so the system before and after has the same solutions.
Echelon form and rank. Elimination can always reach the reduced row echelon form: the first nonzero entry of each nonzero row, its pivot, is 1, it lies to the right of the pivot above, it is the only nonzero entry of its column, and rows of zeros come last. Row operations keep every linear relation among the columns, so they keep the rank, the dimension of the column space. The rank is therefore the number of pivots. The same reduction of \([A \mid b]\) gives \(\operatorname{rank} A\), the pivots left of the bar, and \(\operatorname{rank}\,[A \mid b]\), all the pivots.
Fine print: names and notation
A system with at least one solution is called consistent, and one with none inconsistent. A system with \(b = 0\) is called homogeneous; it always has the solution \(x = 0\). The unknowns that get no pivot in the reduced form are called free.
All numbers on this page are real numbers. In the figures, \(x\), \(y\) and \(z\) name the three unknowns, and each plane is drawn only where it passes through a box around the origin; the box is part of the drawing, not of the math.
Sort six systems
- Read the three equations. Work on paper if it helps.
- Pick exactly one, none or infinitely many solutions, then press Check. The page then draws the three planes and shows both ranks.
How the game works
There are six systems, each with three equations in the unknowns \(x\), \(y\) and \(z\). After Check, the page reduces the augmented matrix \([A \mid b]\) exactly, with fractions, shows the reduced form, the rank of \(A\) and the rank of \([A \mid b]\), and draws the three planes. A slider turns the 3D view. Next system moves on; after the sixth, a table lists your answers. Start over clears everything.
| System | You said | Solutions | rank A | rank [A | b] |
|---|
No solution exactly when elimination produces a row \(0 = c\) with \(c \ne 0\). That row has its pivot after the bar, so \(\operatorname{rank}\,[A \mid b]\) is larger than \(\operatorname{rank} A\).
Otherwise the two ranks are equal, and each unknown without a pivot is free. With 3 unknowns: rank 3 gives exactly one solution, rank 2 a line of solutions, rank 1 a plane of them.
The picture alone can mislead. System 4 has no two parallel planes and still no solution, and system 5 has three similar-looking equations and exactly one solution. The ranks decide.
Change only the right side
A prediction first. The explorer below it opens once it is answered.
Explorer: move b
- The left sides stay fixed. The sliders set \(b_1\), \(b_2\) and \(b_3\), whole numbers from −4 to 4; each one slides one plane.
- Turn the 3D view with its own slider. The tiles and the line under them say what the ranks are and where the solutions lie.
Goals
Two equations, three unknowns
Solvable right sides form a subspace. \(Ax\) is always a combination of the columns of \(A\), so \(Ax = b\) can be solved exactly when \(b\) lies in the column space \(\operatorname{Col}(A)\). For the explorer's matrix of rank 2 that is a plane through 0, \(b_3 = b_1 + b_2\); every other \(b\) gives no solution.
The left side fixes the shape, the right side only shifts it. When there are solutions, they form a copy of the null space moved to pass through one solution, as in the lesson on column space, null space and rank. In the explorer that is always a line in the direction \((1, 1, 1)\).
Two equations, three unknowns. The rank is at most the number of rows, here 2, so there is never exactly one solution: either none, or infinitely many.
Why two ranks decide everything
Assumptions. \(A\) is a real \(m \times n\) matrix with \(m, n \ge 1\) and columns \(a_1, \dots, a_n\), and \(b \in \mathbb{R}^m\). Write \(r = \operatorname{rank} A\) and \(r' = \operatorname{rank}\,[A \mid b]\).
Conclusion. If \(b \in \operatorname{Col}(A)\), then \(r' = r\); if \(b \notin \operatorname{Col}(A)\), then \(r' = r + 1\). So \(Ax = b\) has a solution exactly when \(r' = r\). When it has a solution, it has exactly one if \(r = n\), and infinitely many if \(r \lt n\).
Facts the proof uses.
- \(Ax = x_1a_1 + \dots + x_na_n\), so \(Ax = b\) has a solution exactly when \(b \in \operatorname{Col}(A)\), the span of the columns;
- if \(x_p\) is one solution, the solutions are exactly the vectors \(x_p + v\) with \(v \in \operatorname{Null}(A)\), because \(Ax - b = A(x - x_p)\);
- rank–nullity: \(r + \dim \operatorname{Null}(A) = n\) (lesson on column space, null space and rank);
- the rank of a matrix is the dimension of its column space, the number of vectors in any basis of it.
Each line starts from one case. Pick the option that is true for every matrix \(A\) and every \(b\) in that case. A step that fails for even one such \(A\) and \(b\) cannot be part of the proof.
- The four cases. Lines 1 and 2 cover every \(b\), and lines 3 and 4 every solvable system, so the outcome is always one of: no solution (\(r' = r + 1\)), exactly one (\(r' = r = n\)), or infinitely many (\(r' = r \lt n\)). Two or five solutions never happen.
- Fewer equations than unknowns. \(r \le m\), the number of rows. If \(m \lt n\), then \(r \lt n\), so a solvable system has infinitely many solutions.
- Square systems. If \(m = n\) and \(r = n\), then \(\operatorname{Col}(A) = \mathbb{R}^n\), so every \(b\) gives exactly one solution, \(x = A^{-1}b\). If \(r \lt n\), some \(b\) give none and the others infinitely many; that is when the determinant is 0.
- No solution is not the end. When \(b \notin \operatorname{Col}(A)\), least squares replaces \(b\) by the closest point of \(\operatorname{Col}(A)\) and solves that system instead; see projection onto a subspace.
Problems
Each problem has hints and a full solution.
Further reading
- G. Strang, Introduction to Linear Algebra, 5th ed. (Wellesley-Cambridge Press, 2016), chapter 2, "Solving Linear Equations," and section 3.3, "The Complete Solution to Ax = b."
- D. C. Lay, S. R. Lay and J. J. McDonald, Linear Algebra and Its Applications, 5th ed. (Pearson, 2016), chapter 1, "Linear Equations in Linear Algebra."