Skip to content

The complete solution

Write every solution of Ax = b as one particular solution plus the null space, and tell from the rank when there are none, one or infinitely many.

Helps to know firstThe null space

Helps to know first
This topic

First, the picture

One answer, plus a whole line of freedom. Watch a line of inputs slide out, and every point on it solve the same equation.

Infinitely many answers in a line

The inputs x of A = [1 0 1; 0 1 1; 1 1 2] that give Ax = b.

The null line of A, through the origin along (−1, −1, 1): every point on it has Ax = 0.

b
(2, 3, 5)
solutions
–
5
0.00 / 10.50 s
Describe this picture

A slowly turning view of the inputs x\mathbf{x} in 3-D space for the matrix A=[101011112]\mathbf{A}=\begin{bmatrix}1&0&1\\0&1&1\\1&1&2\end{bmatrix} and the target b=(2,3,5)\mathbf{b}=(2,3,5). The null line, labelled N(A)N(\mathbf{A}), through the origin in the direction (−1,−1,1)(-1,-1,1), is drawn first. A copy of it then slides out, parallel to itself, until it passes through the point xpart=(2,3,0)\mathbf{x}_\text{part}=(2,3,0), which an arrow from the origin marks; the original stays behind as a dashed guide. Five points along the shifted line are then marked one by one, and the newest carries the label Ax=(2,3,5)\mathbf{A}\mathbf{x}=(2,3,5). Readouts give b\mathbf{b} and the solutions: “a line” or “none”. One control: a slider for the third entry of b\mathbf{b}, from 3 to 7 in steps of 0.5. While it equals 5, the sum of the first two, the line stays; move it off 5 and the line fades, because there is no solution.

One answer, then all of them

Take the matrix from The null space, the one that crushes the line of (−1,−1,1)(-1,-1,1), and ask it to produce b=(2,3,5)\mathbf{b}=(2,3,5). One answer is easy to check:

[101011112][230]=[235].\begin{bmatrix}1&0&1\\0&1&1\\1&1&2\end{bmatrix}\begin{bmatrix}2\\3\\0\end{bmatrix}=\begin{bmatrix}2\\3\\5\end{bmatrix}.

Now add any multiple of the crushed direction. The matrix sends that part to zero, so the output does not change:

A((2,3,0)+c (−1,−1,1))=(2,3,5)+c 0=(2,3,5).\begin{aligned} &\mathbf{A}\big((2,3,0)+c\,(-1,-1,1)\big)\\ &\quad=(2,3,5)+c\,\mathbf{0}=(2,3,5). \end{aligned}

Every point of the line through (2,3,0)(2,3,0) in the direction (−1,−1,1)(-1,-1,1) is a solution. That is the shifted line in the picture.

Are there any others? Suppose x1\mathbf{x}_1 and x2\mathbf{x}_2 both solve Ax=b\mathbf{A}\mathbf{x}=\mathbf{b}. Then A(x1−x2)=b−b=0\mathbf{A}(\mathbf{x}_1-\mathbf{x}_2)=\mathbf{b}-\mathbf{b}=\mathbf{0}, so any two solutions differ by a vector of the null space. So once you have one solution, you have them all:

x=xpart+xnull.\mathbf{x}=\mathbf{x}_\text{part}+\mathbf{x}_\text{null}.

Here xpart\mathbf{x}_\text{part} is any one particular solution, and xnull\mathbf{x}_\text{null} runs over the whole null space. This is the complete solution. When the null space is only 0\mathbf{0}, the solution is unique; otherwise there are infinitely many.

Finding a particular solution

Run elimination on A\mathbf{A} and b\mathbf{b} together, written side by side as one wide table [ A∣b ][\,\mathbf{A}\mid\mathbf{b}\,], and go on to the reduced form of the null space page. For the matrix above:

[101201131125]→  [101201130000].\begin{aligned} &\left[\begin{array}{ccc|c}1&0&1&2\\0&1&1&3\\1&1&2&5\end{array}\right]\\ \to\;&\left[\begin{array}{ccc|c}1&0&1&2\\0&1&1&3\\0&0&0&0\end{array}\right]. \end{aligned}

The simplest particular solution sets every free variable to 0. Here x3x_3 is free, so x3=0x_3=0, and the pivot rows give x1=2x_1=2 and x2=3x_2=3: xpart=(2,3,0)\mathbf{x}_\text{part}=(2,3,0), the point the line slid out to.

When there is no solution

The last row of the reduced table says 0=00=0. That came from 5−2−35-2-3: the third entry of b\mathbf{b} minus the first two. For a general b\mathbf{b} the same steps leave

0=b3−b1−b20=b_3-b_1-b_2

in the last row. If b3≠b1+b2b_3\ne b_1+b_2, that row says 0 equals something that is not 0, and no x\mathbf{x} can fix it. In the picture, drag the third entry of b\mathbf{b} off 5 and the line of solutions fades away.

This is the column space test of Vector spaces and subspaces, now worked out by elimination: every zero row of the reduced matrix gives one condition that b\mathbf{b} must meet to be in C(A)C(\mathbf{A}).

Rank and the four cases

The rank rr is the number of pivots. An m×nm\times n matrix has mm rows and nn columns, and each pivot needs its own row and its own column, so r≤mr\le m and r≤nr\le n. Comparing rr with mm and nn sorts every system into one of four cases.

  • Zero rows come from r<mr<m. There are m−rm-r of them, and each puts a condition on b\mathbf{b}.
  • Free variables come from r<nr<n. There are n−rn-r of them, and each adds a direction of freedom to the solution.

Four cases

Rank r, rows m, columns n: what the solutions of Ax = b look like.

r = m = n: the 2 × 2 matrix [1 0; 0 1] has rank 2. One solution, for every b.

0.00 / 9.20 s
Describe this picture

Four tiles side by side (two by two on a phone), appearing one after another. Each names its case, shows an example matrix in brackets with its rank, sketches the solutions in a small pair of axes, and says what they are. r=m=nr=m=n: the identity [1001]\begin{bmatrix}1&0\\0&1\end{bmatrix}, rank 2, a single point: one solution for every b\mathbf{b}. r=n<mr=n<m: the 3×23\times2 matrix [100111]\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}, rank 2, a point beside a crossed-out circle: one solution or none; the caption says there is one when b3=b1+b2b_3=b_1+b_2. r=m<nr=m<n: the 2×32\times3 matrix [101011]\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}, rank 2, a line: a line of solutions for every b\mathbf{b}. r<mr<m and r<nr<n: [1122]\begin{bmatrix}1&1\\2&2\end{bmatrix}, rank 1, a line beside a crossed-out circle: a line of solutions or none; the caption says there is a line when b2=2b1b_2=2b_1. There is no control.

CaseSolutionsExample
r=m=nr=m=nexactly one, for every b\mathbf{b}the identity
r=n<mr=n<mone, or none[100111]\begin{bmatrix}1&0\\0&1\\1&1\end{bmatrix}, needs b3=b1+b2b_3=b_1+b_2
r=m<nr=m<ninfinitely many, for every b\mathbf{b}[101011]\begin{bmatrix}1&0&1\\0&1&1\end{bmatrix}
r<mr<m, r<nr<ninfinitely many, or none[1122]\begin{bmatrix}1&1\\2&2\end{bmatrix}, needs b2=2b1b_2=2b_1

Watch out

More unknowns than equations does not make a system solvable. The 2×32\times3 system x+y+z=1x+y+z=1, 2x+2y+2z=32x+2y+2z=3 has three unknowns and two equations, but its rank is 1, not 2. Twice the first equation says 2x+2y+2z=22x+2y+2z=2, so the second can never hold. Only r=mr=m guarantees a solution.

In signal processing · natural plus forced

Differential equations and analog systems, in the signal processing course, writes every response of a circuit as a forced part plus a natural part. The natural part solves the equation with no input, which is its null space; the forced part is one particular solution. That is x=xpart+xnull\mathbf{x}=\mathbf{x}_\text{part}+\mathbf{x}_\text{null} for an equation in time.

Worked example

1. Two equations, four unknowns. Reduce the table for A=[12132438]\mathbf{A}=\begin{bmatrix}1&2&1&3\\2&4&3&8\end{bmatrix} and b=(2,5)\mathbf{b}=(2,5):

[1213224385]→  [1201100121].\begin{aligned} &\left[\begin{array}{cccc|c}1&2&1&3&2\\2&4&3&8&5\end{array}\right]\\ \to\;&\left[\begin{array}{cccc|c}1&2&0&1&1\\0&0&1&2&1\end{array}\right]. \end{aligned}

With the free variables x2=x4=0x_2=x_4=0, the pivot rows give x1=1x_1=1 and x3=1x_3=1: xpart=(1,0,1,0)\mathbf{x}_\text{part}=(1,0,1,0). Check: Axpart=(1+1,  2+3)=(2,5)\mathbf{A}\mathbf{x}_\text{part}=(1+1,\;2+3)=(2,5).

Add the null space from the null space page, with weights cc and dd:

x=(1,0,1,0)+c (−2,1,0,0)+d (−1,0,−2,1).\begin{aligned} \mathbf{x}&=(1,0,1,0)\\ &\quad+c\,(-2,1,0,0)\\ &\quad+d\,(-1,0,-2,1). \end{aligned}

With c=d=1c=d=1 this is (−2,1,−1,1)(-2,1,-1,1), and Ax=(−2+2−1+3,  −4+4−3+8)=(2,5)\mathbf{A}\mathbf{x}=(-2+2-1+3,\;-4+4-3+8)=(2,5), as it should be.

2. One equation, two unknowns. All solutions of x+y=3x+y=3: the particular solution (3,0)(3,0) plus the null line of (−1,1)(-1,1), so (3,0)+c (−1,1)(3,0)+c\,(-1,1).

3. A condition on b. [1122]x=b\begin{bmatrix}1&1\\2&2\end{bmatrix}\mathbf{x}=\mathbf{b} has a solution only when b2=2b1b_2=2b_1.

4. Counting. A 3×53\times5 matrix of rank 3 has r=mr=m, so every b\mathbf{b} works, with 5−3=25-3=2 free variables. A 3×23\times2 matrix of rank 2 is the case r=n<mr=n<m.

Predict before you drag: what happens to the line of solutions if the third entry of b\mathbf{b} becomes 6? It vanishes, since 2+3≠62+3\ne6.

Where you’ll meet this

Natural and forced responses. A circuit or filter driven by an input settles into a forced response, but the way it starts depends on its natural response, the part that solves the equation with no input. Matching the starting values picks one point on the line of solutions.

Too few sensors. A structure with five unknown forces and three strain gauges gives three equations in five unknowns. If the rank is 3, every reading has a solution, but a whole two-dimensional family of forces fits it. The measurements alone can’t pick one; extra knowledge, such as a preference for the smallest forces, must.

Reference card

QuantityFormulaNotes
Complete solutionx=xpart+xnull\mathbf{x}=\mathbf{x}_\text{part}+\mathbf{x}_\text{null}one particular solution plus the null space
Particular solutionfree variables set to 0read the pivot rows of the reduced table
Two solutionsx1−x2∈N(A)\mathbf{x}_1-\mathbf{x}_2\in N(\mathbf{A})they differ by a null vector
Solvableb∈C(A)\mathbf{b}\in C(\mathbf{A})each zero row gives one condition on b\mathbf{b}
Rank boundsr≤mr\le m, r≤nr\le none pivot per row and per column at most
Always solvabler=mr=mno zero rows
Unique when solvabler=nr=nno free variables

Keep reading with a free account.

By creating an account you accept the terms of use.

Sign in

Already have an account? Use the service you signed up with.

Or keep reading: get new lessons by email

Are you 13 or over?

Accounts and email updates are for people aged 13 or over. We keep only your answer, never your date of birth.

End of the lesson

Where to go next.

Phasorium

Account

Sign inKeep your place on any device

Subjects

Site

Look