In a system of linear equations, the variables are mixed together across every row, so we use row operations to reshape the matrix into a staircase that isolates one variable at a time from the bottom up.
1
Row Echelon Form and Pivots
We want to solve this system of three equations without guessing how to combine the rows:
x+2y+z2x+5y+4zx+y−2z=9=25=0
A pivot is the first non-zero number in a row of the staircase, and Row Echelon Form (REF) is the staircase shape we get when we use each pivot to turn the numbers below it into zeros.
Row Echelon Form and Pivots
x2xx+++2y5yy++−z4z2z===9250
(x,y,z)=?
Text solution
Use the first pivot in column 1 to clear the numbers below itSubtract multiples of Row 1 from Rows 2 and 3 so x disappears from the bottom two rows.
Step down and right to the second pivot to clear below itAdd Row 2 to Row 3 so the −1 in column 2 becomes zero without changing the zero we just created in column 1.
Back-substitute from the bottom row upSolve the bottom equation for z first, then plug each known value into the row above it.
−zy+2(2)x+2(3)+2=−2=7=9⟹z=2⟹y=3⟹x=1
So the system has the single solution (x,y,z)=(1,3,2).
In the second step, clearing column 2 with Row 2 keeps the zero in column 1 because Row 2 already has a zero there, while using Row 1 puts a non-zero number right back into Row 3's first column.
Clearing the second column only keeps Row 3's first zero if the row you add also has a zero in the first column.
2
Reduced Row Echelon Form
Instead of stopping at the staircase and doing back-substitution by hand, we can scale every pivot to 1 and clear the numbers above the pivots too. That puts the matrix into Reduced Row Echelon Form (RREF), where each variable sits by itself in its own row.
Reduced Row Echelon Form
Text solution
Scale the bottom pivot to 1 and clear the numbers above itMultiply Row 3 by −1, then subtract multiples of Row 3 from Rows 1 and 2 to clear the rest of column 3.
Reading straight across the rows gives the same solution x=1,y=3, and z=2 without any back-substitution.
Reordering the starting rows produces different numbers in Row Echelon Form, but the pivots always land in the exact same spots, and every path reduces to the exact same Reduced Row Echelon Form.
Reordering the starting rows gives different Row Echelon Forms, but the pivot positions never move and every starting order gives the same Reduced Row Echelon Form.
3
Spotting REF and RREF
To check whether a matrix is in REF, RREF, or neither, find the first non-zero number in each row and check where those pivots sit and what else is in their columns.
Spotting REF and RREF
Watch out for columns that do not have a pivot: RREF only requires zeros above and below the pivots, so in a column without a pivot, the numbers above the staircase can be anything at all.
Sometimes a row operation turns the next pivot spot and every number below it into zero at the same time. When that happens, we slide right to the next column for our pivot, leaving behind a skipped column whose variable is a free variable.
Skipped Columns and Free Variables
Text solution
Clear below the first pivot in column 1Subtracting multiples of Row 1 clears both column 1 and column 2 in the bottom two rows.
Slide right to the next non-zero column and clear above and below the second pivotBecause column 2 has only zeros from Row 2 down, the second pivot moves to column 3, and we use it to clear the rest of column 3.
Solve for the pivot variables in terms of the free variableWrite the non-zero rows back as equations and move the skipped variable y to the right side.
xz=1−2y=3(y is free)
Any number we pick for the free variable y gives a valid solution for (x,y,z), such as (1,0,3) when y=0 or (−9,5,3) when y=5.
When a system starts with more unknowns than equations, such as 3 equations in 5 unknowns, there are not enough rows to give every variable a pivot. Reducing to RREF clears the pivot columns so each pivot variable sits alone on the left with only the skipped free variables on the right:
100200010−34000151−2⟹x1x3x5=5−2x2+3x4=1−4x4=−2(x2,x4 are free)
The columns with pivots give the pivot variables on the left side of the equations, while any skipped columns keep their non-zero numbers in RREF and move to the right as free variables.
In Reduced Row Echelon Form, the columns with pivots get their variables alone, while the skipped columns keep their numbers and become the free variables.
5
A Pivot in the Answer Column
There is one last place a pivot can land: if all the variables in a row cancel out to zero while the right-hand side stays non-zero, the row's first non-zero number sits in the answer column.
A Pivot in the Answer Column
Text solution
Clear below the first and second pivotsChanging the bottom-right number from 10 to 11 leaves a 1 in the answer column of Row 3 after all the variables cancel.
Row 3 says 0x+0y+0z=1, or 0=1, which is never true, so the system has no solution.
Key concepts
Everything here comes down to finding the pivots: the first non-zero number in each row once the matrix is in staircase form.
REF vs. RREF (and when to stop)
A matrix is in Row Echelon Form (REF) when all-zero rows are at the bottom and each pivot sits to the right of the pivot above it, leaving only zeros below every pivot. Stopping at REF is enough if you just want to see how many solutions there are or back-substitute by hand. Continue to Reduced Row Echelon Form (RREF), scaling every pivot to 1 and clearing above the pivots too, when you want each variable solved for directly, especially when there are free variables.
Don't clear non-pivot columns
Only pivot columns need zeros above and below their 1s. In [10200113], the 2 sits in a skipped column without a pivot, so the matrix is already in RREF.
How the pivot positions decide the solutions
Because pivot positions never depend on which row operations you choose, you can tell what kind of solutions the system has as soon as the matrix reaches REF:
A pivot in the answer column ([0001]) means 0=1, so there is no solution.
No pivot in the answer column, and a pivot in every variable column fixes every unknown as a pivot variable, giving exactly one solution.
No pivot in the answer column, and at least one skipped variable column gives infinitely many solutions: the pivot columns are pivot variables and the skipped columns are free variables. In RREF, solve for each pivot variable on the left in terms of the free variables on the right (x=1−2y).
6
Practice
1
For each matrix, state whether it is in Row Echelon Form (REF), Reduced Row Echelon Form (RREF), or neither:
Mark the first non-zero number in each row first, then check the staircase order and look above and below only in the columns that hold those pivots.
In A, the pivots are the 1s in columns 1 and 2, with the all-zero row at the bottom and only zeros above and below both pivots. (Watch out: a common slip is calling A "REF" because of the −2,5,3,−1 in columns 3 and 4, but those columns have no pivots so their numbers do not affect RREF.) A is in RREF.
In B, Row 2 is all zeros while Row 3 is non-zero, breaking the rule that all-zero rows go at the bottom. B is neither.
In C, the pivots 1,2, and 5 step to the right with zeros below them, but the pivots are not all 1 and have non-zero numbers above them. C is in REF.
In D, the pivots in columns 1, 2, and 3 are all 1 and step to the right with zeros below. (Watch out: it is easy to call D "RREF" because all three pivots are 1, but Row 2 has a non-zero 2 sitting right above the third pivot in column 3.) D is in REF.
2
Two students start with the same augmented matrix. The first student stops at the Row Echelon Form 20041023−285−4. (a) Identify the pivots and solve the system by back-substitution. (b) If the second student used different row operations and continued all the way to Reduced Row Echelon Form (RREF), what are the pivot positions and the exact RREF matrix the second student must get?
After finding (x,y,z) in part (a), remember that every path to RREF gives the exact same solution in the rows of the matrix.
(a) The first non-zero numbers in each row give the pivots: 2 in (row 1, column 1), 1 in (row 2, column 2), and −2 in (row 3, column 3). Back-substituting from the bottom row up:
−2zy+3(2)2x+4(−1)+2(2)=−4⟹z=2=5⟹y=−1=8⟹2x=8⟹x=4
(Watch out: in Row 1, forgetting to divide by the first pivot 2 at the end gives the wrong answer x=8.) The solution is (4,−1,2).
(b) Because pivot positions and RREF never depend on which steps you take, the second student must have pivots in (row 1, column 1), (row 2, column 2), and (row 3, column 3), and must get
1000100014−12
3
Reduce the system x+2y+z=3,2x+4y+4z=12,x+3y=−1 to Reduced Row Echelon Form (RREF) and find its solution.
When you set up the augmented matrix, notice that z is missing from the third equation; then after clearing column 1, look below the 0 in the second pivot spot before deciding what to do next.
Write the system as an augmented matrix (putting 0 in column 3 of Row 3 since z does not appear there) and clear below the first pivot:
(Watch out: do not skip column 2 here! Column 2 is only skipped when the pivot spot and every number below it are zero; here Row 3 has a non-zero 1 in column 2.) Swap Row 2 and Row 3 to put that 1 into the second pivot spot:
R2↔R31002101−123−46
Scale the third pivot to 1 and clear above the pivots from right to left:
Reduce the augmented matrix 12−1−3−6313122−6 to RREF. Identify the pivot columns of the original matrix, the pivot variables, and the free variables (using variables x,y,z), and find the solution when the free variable is set to 2.
Clear column 1 below the first pivot and see what happens to column 2 in both Row 2 and Row 3.
Because both Row 2 and Row 3 have 0 in column 2, slide right to column 3 for the second pivot and clear below and above it:
R3←R3−2R2R1←R1−R2100−3000104−20
Pivot columns of the original matrixcolumns 1 and 3.
Pivot variablesx and z.
Free variabley.
Writing the rows as equations gives x−3y=4⟹x=4+3y and z=−2. (Watch out: keeping the minus sign when moving −3y to the right side gives x=4−3y, which gives the wrong answer (−2,2,−2) when y=2.) Setting y=2 gives x=4+3(2)=10, so the solution is (10,2,−2).
5
A system of 3 equations in 5 unknowns (x1,x2,x3,x4,x5) reduces to the RREF matrix
100−2000103−40−1204−30
Identify the pivot variables and the free variables, and write the general solution by solving for each pivot variable in terms of the free variables.
Find the first non-zero number in each row first: does Row 3 have a pivot?
Row 3 is all zeros, so there are only two pivots: the 1 in column 1 and the 1 in column 3. (Watch out: do not assume 3 rows always give 3 pivots; column 5 has non-zero numbers only in Rows 1 and 2, which already have their pivots in columns 1 and 3.)
Pivot variablesx1 and x3.
Free variablesx2,x4, and x5.
Write each non-zero row as an equation and move the free variables to the right side (remembering to flip the sign of every term moved to the other side, rather than copying the matrix signs directly as x1=4−2x2+3x4−x5):
x1x3=4+2x2−3x4+x5=−3+4x4−2x5(x2,x4,x5 are free)
6
Reduce the augmented matrix 12113225a38b to Row Echelon Form. Use the pivot positions to find all values of a and b for which the system has (a) no solution, (b) exactly one solution, and (c) infinitely many solutions.
Carry a and b through the row operations until Row 3 has zeros in columns 1 and 2, then check which values of a and b put a pivot in column 3, put a pivot in the answer column, or make Row 3 all zeros.
Clear below the first pivot in column 1, then clear below the second pivot in column 2:
(a) No solutionRow 3's pivot lands in the answer column when the z number is zero (a−3=0) and the right-hand side is non-zero (b−5=0), so a=3 and b=5.
(b) Exactly one solutionEvery variable column gets a pivot as long as column 3's spot is non-zero (a−3=0). (Watch out: do not write "a=3 and b=5". When a=3,b=5 just makes the bottom equation (a−3)z=0⟹z=0, which still gives a single solution.) So a=3 (for any b).
(c) Infinitely many solutionsColumn 3 is skipped with no pivot in the answer column when Row 3 becomes all zeros, so a=3 and b=5.