We already know how to find every vector that solves Ax=0, and now we want a formula that gives every solution to Ax=b when the right-hand side is a nonzero target vector b.
Why x = xₚ + xₙ Gives Every Solution
Text solution
Set the free variable to 0 to find one starting solution xpIn x+2y=5,x is the pivot variable and y is the free variable, so setting y=0 gives a single vector that makes x+2y equal to 5.
y=0xp⟹x=5,=[50]
Solve Ax=0 to find the null space part xnAny change from [50] that keeps x+2y at 5 must add 0 to the sum, so it satisfies x+2y=0. Setting the free variable to y=1 gives one direction, and any multiple of it works too.
y=1xn⟹x=−2,=c[−21]
Add xp and xn for the complete solutionEvery vector of this form makes x+2y equal to 5, because xp gives 5 and xn gives 0. And because any other solution x satisfies A(x−xp)=b−b=0, no solution can be missed.
x=particular solution xp(one vector with Axp=b)[50]+null space part xn(all vectors with Axn=0)c[−21]
So the complete solution is the line x=[50]+c[−21].
Let's see how this shifted line looks in the plane.
From a starting solution, the total stays the same only when you step along the null space direction, where the step adds nothing.
1
Why Free Variables Can Be Set to Zero
To see why setting the free variables to 0 always works when a system has a solution, let's look at what the columns of A are doing in a system of three equations and four unknowns:
Because the free columns are built out of the pivot columns, they don't add any new directions in space: if b can be reached at all, the pivot columns can reach it on their own with x2=0 and x4=0, while each free column gives one independent way to combine the columns to get 0.
2
Finding Which Target Vectors b Can Be Reached
Even though the columns of A have three components, the two pivot columns only span a flat 2D plane inside 3D space. We want to find the exact condition on b=b1b2b3 for b to lie on that plane so Ax=b has a solution.
Which Target Vectors b Can Be Reached
Text solution
Clear below the first pivotKeep b1,b2,b3 in the augmented column and subtract multiples of Row 1 from Rows 2 and 3.
Clear below the second pivotColumn 2 has no pivot, so move to the second pivot in Column 3 and subtract Row 2 from Row 3.
100200110320b1b2−b1b3−b1−b2
Set the zero row equal to 0Since the left side of the bottom row is 0x1+0x2+0x3+0x4=0, the right side must also equal 0 for the system to have a solution.
b3−b1−b2=0(or b3=b1+b2)
So Ax=b has a solution exactly when b3=b1+b2: the target b=5810 gives 0=−3 and cannot be reached, whereas b=5813 gives 0=0 and lies on the plane.
Here is how the condition b3=b1+b2 picks out the plane of reachable vectors b in 3D space.
The pivot columns can only reach vectors on their plane, which is right when the bottom zero row ends in zero.
3
Finding the Complete Solution by Row Reduction
Now that we know b=5813 satisfies b3=b1+b2, we want to find the complete solution x=xp+xn for the system.
Finding the Complete Solution by Row Reduction
100200110320530
x=xp+xn=?
Text solution
Finish reducing to RREFPlug b=5813 into the eliminated matrix and subtract Row 2 from Row 1 to clear the entry above the second pivot.
Write the RREF equationsThe pivots are in Columns 1 and 3, so x1 and x3 are pivot variables and x2 and x4 are free variables.
x1+2x2+1x4x3+2x4=2=3
Set the free variables to 0 for xpWith x2=0 and x4=0, the right-hand numbers 2 and 3 go straight into the pivot positions for x1 and x3.
xp=2030
Find the special solutions for xnReplace the right-hand side with 0, then set one free variable at a time to 1 and the other to 0.
first special solutionx2=1,x4=0⟹s1=−2100,second special solutionx2=0,x4=1⟹s2=−10−21
Add xp and xnCombine the particular solution with all linear combinations of the special solutions.
x=xp2030+xnc1−2100+c2−10−21
So the complete solution is a 2D plane in 4D space: the special solutions span a plane xn through the origin where Axn=0, and adding xp shifts that entire plane so it passes through 2030.
0
s1
s2
xn=c1s1+c2s2
xp=2030
x=xp+xn
4
Starting from Any Particular Solution
Because the complete solution is a shifted line or plane, any point on it can serve as the starting point xp. Next, let's find the complete solution when we aren't given the matrix A at all, only that x=412 solves Ax=b and the null space of A is spanned by 110.
Starting from Any Particular Solution
x1
x2
x3
(4,1,2)
A412=b
A110=0
x=?
Text solution
Use the given solution directly as xpBecause 412 already satisfies Ax=b, we don't need a zero in its free position to write the complete solution.
x=412+c110
Shift along the line if you want x2=0Choosing c=−1 moves along the same line to the point whose second component is 0.
xp=412−1110=302
So x=412+c110 and x=302+c110 describe the exact same line of solutions, just starting from two different points on that line.
You can drag the starting point xp anywhere along the solution line without changing the line itself.
Any point on the shifted line can be the starting vector without changing the line of solutions itself, and the one with a zero in the middle is just where that line crosses the plane x2=0.
5
The Three Possible Outcomes for Ax=b
Looking at the zero rows at the bottom together with the free columns gives the three possible outcomes when we row-reduce any system Ax=b.
The Three Possible Outcomes for Ax = b
Ax=b
?
?
?
No solution
b1
b2
b3
b
−2
0=−2
One solution
x1
x2
x3
xp
xn=0
x=xp
Infinitely many solutions
x1
x2
x3
xp
xn
x=xp+xn
Zero solutions: A zero row has a nonzero number on the right (0=nonzero), so b lies off the space spanned by the columns of A.
Exactly one solution (a single point): Every zero row is 0=0 and there are no free variables, so the null space is only xn=0 and the complete solution is
x=xp
Infinitely many solutions (a shifted line, plane, or flat space): Every zero row is 0=0 and at least one free variable remains, giving
x=xp+xn
Key concepts
Every solution to Ax=b has the form x=xp+xn, where xp is one particular solution to Axp=b and xn is the general null space solution to Axn=0.
When you start from an augmented matrix [Ab], row-reduce and look at the zero rows first. If any zero row has a nonzero right-hand side (such as [00−3]), stop right there: the system has no solution, and you don't need to find xp or xn. If you are asked which target vectors b=b1b2b3 can be reached, keep b1,b2,b3 on the right-hand side during elimination and set the right-hand side of every zero row equal to 0 (such as b3−b1−b2=0).
When every zero row is 0=0, finish reducing to RREF. Set all free variables to 0 so the right-hand numbers go into the pivot positions to give xp, and set one free variable at a time to 1 (with the right-hand side set to 0) to get the special solutions in xn. For example, in x1+2x2=5, setting x2=0 gives xp=[50] and setting x2=1 in x1+2x2=0 gives xn=c[−21], so x=[50]+c[−21]. If there are no free variables at all, xn=0 and x=xp is the single solution. And if a problem already gives you a solution vector (like x=412), don't try to force zeros into its entries: use it directly as xp, or if you are given two solutions u and v to Ax=b, subtract them to get a null space vector u−v since A(u−v)=b−b=0.
6
Practice
1
Row-reduce the system to reduced row echelon form and find the complete solution x=xp+xn:
The equations are x1+2x2+3x4=5 and x3+2x4=2, with pivots x1,x3 and free variables x2,x4. Setting x2=0 and x4=0 puts 5 and 2 into the first and third positions to give xp=5020 (be careful not to put 5 and 2 into the top two positions to get 5200, because x2 is free and x3 is the second pivot variable). Setting x2=1,x4=0 in Ax=0 gives s1=−2100, and setting x2=0,x4=1 gives s2=−30−21 (remember to flip the signs when moving the free variables across the equals sign, rather than reading the positive entries directly to get 2100 and 3021):
x=5020+c1−2100+c2−30−21
2
For A=124−2−4−8135, keep b=b1b2b3 on the right-hand side during elimination to find the equation that b1,b2,b3 must satisfy for Ax=b to have a solution, and determine whether b=215 and b=214 can be reached.
In the second step, distribute the minus sign across all of b2−2b1 when computing (b3−4b1)−(b2−2b1)=b3−b2−2b1; adding −4b1 and −2b1 instead of subtracting gives the wrong condition b3−b2−6b1=0.
Clear below the first pivot in Column 1, then use the second pivot in Column 3 to create a zero row at the bottom.
Eliminating down the columns with b=b1b2b3 gives:
(In the second step, distribute the minus sign across all of b2−2b1 when computing (b3−4b1)−(b2−2b1)=b3−b2−2b1; adding −4b1 and −2b1 instead of subtracting gives the wrong condition b3−b2−6b1=0.) Setting the zero row equal to 0 gives the condition for Ax=b to have a solution:
b3−b2−2b1=0(or b3=2b1+b2)
For b=215,5−1−2(2)=0, so 215 can be reached; for b=214,4−1−2(2)=−1=0, so 214 cannot be reached.
3
Suppose x=52−1 is one solution to Ax=b and the null space of A is spanned by 21−1. Write the complete solution to Ax=b, and find the particular solution on this line that has a zero in the second component (x2=0).
Don't simply replace the middle entry with 0 to get 50−1, which isn't on the solution line.
Use the given solution as your starting point for the line, then find the value of c that makes the second component 2+c(1) equal to 0.
Using the given solution directly as xp, the complete solution is:
x=52−1+c21−1
To make the second component 0, we need 2+c(1)=0, so c=−2 (don't simply replace the middle entry with 0 to get 50−1, which isn't on the solution line, and watch the minus-times-minus in the third entry −1+(−2)(−1)=1 so you don't get 10−3):
xp=52−1−221−1=101
4
Suppose A is a matrix with one free variable, and u=321 and v=13−1 are two different solutions to Ax=b. Without knowing A or b, find a nonzero vector in the null space of A and write the complete solution to Ax=b.
Be careful not to use the second solution v=13−1 directly as the null space vector, since Av=b rather than 0.
If Au=b and Av=b, what does A do to the difference u−v?
Because A(u−v)=Au−Av=b−b=0, the difference between the two solutions is a nonzero vector in the null space of A (be careful not to use the second solution v=13−1 directly as the null space vector, since Av=b rather than 0):
xn direction=u−v=321−13−1=2−12
Using u (or v) as xp gives the complete solution:
x=321+c2−12
5
Three systems Ax=b row-reduce to the following augmented matrices: (a) 1000102−10342, (b) 100010001342, (c) 1000102−10340. For each system, state how many solutions it has and write the complete solution if one exists.
Check the bottom row for 0=nonzero first; if every zero row is 0=0, check whether any column has no pivot.
(a)The bottom row reads 0x1+0x2+0x3=2 (0=2), so there are zero solutions (don't ignore the bottom row and write x=340+c−211).
(b)Every column has a pivot and there is no 0=nonzero row, so there are no free variables (xn=0) and there is exactly one solution:
x=342
(c)The bottom row is 0=0 and x3 is a free variable, so there are infinitely many solutions. Setting x3=0 gives xp=340, and setting x3=1 in x1+2x3=0,x2−x3=0 gives s1=−211 (don't forget to put 1 in the third position for x3=1; leaving it out gives −210):