Linear AlgebraLinear Systems3 of 8
Linear Systems · 3

Gaussian Elimination

We need a systematic way to solve a system of linear equations when there are too many variables to find by guessing and plugging in.

Suppose we want to find the values of xx, yy, and zz that make all three of these equations true at the same time:

x+2y+z=82x+5y+3z=21x+4y+4z=21\displaystyle \begin{aligned} x + 2y + z &= 8 \\ 2x + 5y + 3z &= 21 \\ x + 4y + 4z &= 21 \end{aligned}

Instead of jumping straight into algebra, let's look at the staircase shape we wish this system had and the three legal moves that let us reshape equations without changing their solution.

The Staircase System and the Three Legal Moves
x+2y+z=82x+5y+3z=21x+4y+4z=21\displaystyle \begin{alignedat}{4} x &{}+{}& 2y &{}+{}& z &{}={}& 8 \\ 2x &{}+{}& 5y &{}+{}& 3z &{}={}& 21 \\ x &{}+{}& 4y &{}+{}& 4z &{}={}& 21 \end{alignedat}
x\displaystyle x =?y\displaystyle = {?} \qquad y =?z\displaystyle = {?} \qquad z =?\displaystyle = {?}
xx
++
2y2y
++
zz
==
88
2x2x
++
5y5y
++
3z3z
==
2121
xx
++
4y4y
++
4z4z
==
2121
x\htmlClass{lc-blue}{x}
++
2y2y
++
zz
==
88
y\htmlClass{lc-blue}{y}
++
zz
==
55
z\htmlClass{lc-blue}{z}
==
33
original system\text{original system}
staircase system\text{staircase system}
x+2y+z=82x+5y+3z=21x+4y+4z=21⏟original system⟶x+2y+z=8y+z=5z=3⏟staircase system\displaystyle \underbrace{\begin{aligned} x + 2y + z &= 8 \\ 2x + 5y + 3z &= 21 \\ x + 4y + 4z &= 21 \end{aligned}}_{\text{original system}} \rowop{\longrightarrow} \underbrace{\begin{aligned} \pivot{x} + 2y + z &= 8 \\ \pivot{y} + z &= 5 \\ \pivot{z} &= 3 \end{aligned}}_{\text{staircase system}}

Once a system is in staircase form, the bottom equation gives z=3z = 3 right away, and plugging upwards gives y+3=5  ⟹  y=2y + 3 = 5 \implies y = 2 and x+2(2)+3=8  ⟹  x=1x + 2(2) + 3 = 8 \implies x = 1.

1

Building the Staircase in an Augmented Matrix

Now we want to turn our original system into that staircase using the three legal moves, without rewriting xx, yy, zz, and == at every step.

Building the Staircase in an Augmented Matrix
xx
yy
zz
11
22
11
88
22
55
33
2121
11
44
44
2121
Text solution
Write the numbers in an augmented matrixKeep only the coefficients and right-hand numbers in a grid, with a vertical line for the equals signs.
1x+2y+1z=82x+5y+3z=211x+4y+4z=21⟶[12182532114421]⏟augmented matrix\displaystyle \begin{aligned} 1x + 2y + 1z &= 8 \\ 2x + 5y + 3z &= 21 \\ 1x + 4y + 4z &= 21 \end{aligned} \quad \longrightarrow \quad \underbrace{\left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & 1 & 8 \\ 2 & 5 & 3 & 21 \\ 1 & 4 & 4 & 21 \end{array}\right]}_{\text{augmented matrix}}
Clear Column 1 below the first pivotCircle the top-left pivot 1\pivot{\mathbf{1}} in Row 1, subtract twice Row 1 from Row 2 (R2←R2−2R1R_2 \leftarrow R_2 - \rowop{2R_1}), and subtract Row 1 from Row 3 (R3←R3−R1R_3 \leftarrow R_3 - \rowop{R_1}) so every entry below the first pivot becomes 00.
[12182532114421]→R2←R2−2R1R3←R3−R1[1218011502313]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & 1 & 8 \\ 2 & 5 & 3 & 21 \\ 1 & 4 & 4 & 21 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{2R_1} \\ R_3 \,\leftarrow\, R_3 - \rowop{R_1}}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & 1 & 8 \\ 0 & \pivot{\mathbf{1}} & 1 & 5 \\ 0 & 2 & 3 & 13 \end{array}\right] \end{aligned}
Step diagonally down to the Row 2 pivot and clear Column 2Move to the pivot 1\pivot{\mathbf{1}} in Row 2, Column 2 and subtract twice Row 2 from Row 3 (R3←R3−2R2R_3 \leftarrow R_3 - \rowop{2R_2}) to finish the triangle of zeros in the bottom-left corner.
[1218011502313]→R3 ← R3−2R2[121801150013]⏟Row Echelon Form (staircase)\displaystyle \begin{gathered} \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & 1 & 8 \\ 0 & \pivot{\mathbf{1}} & 1 & 5 \\ 0 & 2 & 3 & 13 \end{array}\right] \\[6pt] \xrightarrow{R_3 \,\leftarrow\, R_3 - \rowop{2R_2}} \\[6pt] \underbrace{\left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & 1 & 8 \\ 0 & \pivot{\mathbf{1}} & 1 & 5 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right]}_{\text{Row Echelon Form (staircase)}} \end{gathered}

Putting xx, yy, and zz back into the rows gives the staircase system x+2y+z=8\pivot{x} + 2y + z = 8, y+z=5\pivot{y} + z = 5, and z=3\pivot{z} = 3, so z=3z = 3, y=2y = 2, and x=1x = 1.

Once Column 1 is cleared in [1218011502313]\left[\begin{array}{ccc|c} \pivot{1} & 2 & 1 & 8 \\ 0 & \pivot{1} & 1 & 5 \\ 0 & 2 & 3 & 13 \end{array}\right], see what happens to our zero in Row 3, Column 1 if we try to cancel the 22 in Column 2 using Row 1 instead of Row 2.

Either row above can cancel the 2 in the third row, but only the second row has a zero in the first column to leave your earlier work untouched.
2

Clearing Above the Pivots

Once we reach the staircase, we can either plug numbers back into the equations from the bottom up (back-substitution) or stay inside the matrix and use the pivots to clear the numbers above them too.

Clearing Above the Pivots
xx
yy
zz
11
22
11
88
00
11
11
55
00
00
11
33
x+2y+z=8\htmlClass{lc-blue}{x} + 2y + z = 8
x+2y+z=5\hphantom{x + 2}\htmlClass{lc-blue}{y} + z = 5
x+2y+z=3\hphantom{x + 2y + {}}\htmlClass{lc-blue}{z} = 3
11
22
11
88
00
11
11
55
00
00
11
33
11
00
00
11
00
11
00
22
00
00
11
33
Reduced\text{Reduced}
Row Echelon Form\text{Row Echelon Form}
Row Echelon Form\text{Row Echelon Form}
Text solution
Clear Column 3 above the bottom-right pivotStarting at the pivot 1\pivot{\mathbf{1}} in Row 3, Column 3, subtract Row 3 from Row 2 (R2←R2−R3R_2 \leftarrow R_2 - \rowop{R_3}) and from Row 1 (R1←R1−R3R_1 \leftarrow R_1 - \rowop{R_3}).
[121801150013]→R2←R2−R3R1←R1−R3[120501020013]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{1} & 2 & 1 & 8 \\ 0 & \pivot{1} & 1 & 5 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{R_3} \\ R_1 \,\leftarrow\, R_1 - \rowop{R_3}}} \quad & \left[\begin{array}{ccc|c} \pivot{1} & 2 & 0 & 5 \\ 0 & \pivot{\mathbf{1}} & 0 & 2 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right] \end{aligned}
Clear Column 2 above the middle pivotUse the pivot 1\pivot{\mathbf{1}} in Row 2, Column 2 to eliminate the 22 above it in Row 1 (R1←R1−2R2R_1 \leftarrow R_1 - \rowop{2R_2}).
[120501020013]→R1 ← R1−2R2[100101020013]⏟Reduced Row Echelon Form\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{1} & 2 & 0 & 5 \\ 0 & \pivot{\mathbf{1}} & 0 & 2 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right] \\[6pt] \xrightarrow{R_1 \,\leftarrow\, R_1 - \rowop{2R_2}} \quad & \underbrace{\left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 0 & 0 & 1 \\ 0 & \pivot{\mathbf{1}} & 0 & 2 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right]}_{\text{Reduced Row Echelon Form}} \end{aligned}

Putting the variables back into the rows gives 1x=1\pivot{1}x = 1, 1y=2\pivot{1}y = 2, and 1z=3\pivot{1}z = 3, so x=1x = 1, y=2y = 2, and z=3z = 3 without any back-substitution.

3

Pivots That Aren't 11, Negative Numbers, and Fractions

In the first system, every pivot happened to be 1\pivot{1}. Now let's solve a system where the pivots are other integers or fractions and negative numbers show up:

2x+y−z=13x+2y+z=10−4x+y+2z=4\displaystyle \begin{aligned} 2x + y - z &= 1 \\ 3x + 2y + z &= 10 \\ -4x + y + 2z &= 4 \end{aligned}
Pivots That Aren't 1, Negative Numbers, and Fractions
xx
yy
zz
22
11
−1-1
11
33
22
11
1010
−4-4
11
22
44
2×?=3\htmlClass{lc-blue}{2} \times \mathord{\htmlClass{lc-violet}{?}} = 3

To eliminate any entry below a pivot, divide the entry you want to cancel by the pivot itself:

Multiplier=Entry to eliminatePivot(because Pivot×EntryPivot=Entry)\displaystyle \begin{gathered} \rowop{\text{Multiplier}} = \frac{\text{Entry to eliminate}}{\pivot{\text{Pivot}}} \\[4pt] \left(\text{because } \pivot{\text{Pivot}} \times \frac{\text{Entry}}{\pivot{\text{Pivot}}} = \text{Entry}\right) \end{gathered}
Text solution
Clear Column 1 using pivot 2\pivot{2}For Row 2, the multiplier is 32\rowop{\frac{3}{2}}, so subtract 32R1\rowop{\frac{3}{2}R_1} from Row 2; for Row 3, the multiplier is −42=−2\frac{-4}{\pivot{2}} = \rowop{-2}, and subtracting −2R1\rowop{-2R_1} is the same as adding 2R1\rowop{2R_1}.
[21−1132110−4124]→R2←R2−32R1R3←R3+2R1[21−11012521720306]\displaystyle \begin{gathered} \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & -1 & 1 \\ 3 & 2 & 1 & 10 \\ -4 & 1 & 2 & 4 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{\frac{3}{2}R_1} \\ R_3 \,\leftarrow\, R_3 + \rowop{2R_1}}} \\[6pt] \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & -1 & 1 \\ 0 & \pivot{\mathbf{\frac{1}{2}}} & \frac{5}{2} & \frac{17}{2} \\ 0 & 3 & 0 & 6 \end{array}\right] \end{gathered}
Clear Column 2 using the fraction pivot 12\pivot{\frac{1}{2}}For the 33 in Row 3, Column 2, the multiplier is 312=6\frac{3}{\pivot{\tfrac{1}{2}}} = \rowop{6}, so subtract 6R2\rowop{6R_2} from Row 3.
[21−11012521720306]→R3 ← R3−6R2[21−110125217200−15−45]\displaystyle \begin{gathered} \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & -1 & 1 \\ 0 & \pivot{\mathbf{\frac{1}{2}}} & \frac{5}{2} & \frac{17}{2} \\ 0 & 3 & 0 & 6 \end{array}\right] \\[6pt] \xrightarrow{R_3 \,\leftarrow\, R_3 - \rowop{6R_2}} \\[6pt] \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & -1 & 1 \\ 0 & \pivot{\mathbf{\frac{1}{2}}} & \frac{5}{2} & \frac{17}{2} \\ 0 & 0 & \pivot{\mathbf{-15}} & -45 \end{array}\right] \end{gathered}
Divide each row by its pivot to make every pivot 1\pivot{1}Divide Row 3 by −15\pivot{-15}, Row 2 by 12\pivot{\frac{1}{2}} (which multiplies Row 2 by 2\rowop{2} and clears its fractions), and Row 1 by 2\pivot{2}.
[21−110125217200−15−45]→R3←R3÷(−15)R2←R2÷(12)R1←R1÷2[112−1212015170013]\displaystyle \begin{gathered} \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & -1 & 1 \\ 0 & \pivot{\mathbf{\frac{1}{2}}} & \frac{5}{2} & \frac{17}{2} \\ 0 & 0 & \pivot{\mathbf{-15}} & -45 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_3 \,\leftarrow\, R_3 \div (\pivot{-15}) \\ R_2 \,\leftarrow\, R_2 \div (\pivot{\frac{1}{2}}) \\ R_1 \,\leftarrow\, R_1 \div \pivot{2}}} \\[6pt] \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & \frac{1}{2} & -\frac{1}{2} & \frac{1}{2} \\ 0 & \pivot{\mathbf{1}} & 5 & 17 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right] \end{gathered}
Clear above the pivots from the bottom upUse the Row 3 pivot to clear Column 3 (R2←R2−5R3R_2 \leftarrow R_2 - \rowop{5R_3} and R1←R1+12R3R_1 \leftarrow R_1 + \rowop{\frac{1}{2}R_3}), then use the Row 2 pivot to clear Column 2 (R1←R1−12R2R_1 \leftarrow R_1 - \rowop{\frac{1}{2}R_2}).
[112−1212015170013]→R2←R2−5R3R1←R1+12R3[1120201020013]→R1 ← R1−12R2[100101020013]\displaystyle \begin{gathered} \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & \frac{1}{2} & -\frac{1}{2} & \frac{1}{2} \\ 0 & \pivot{\mathbf{1}} & 5 & 17 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{5R_3} \\ R_1 \,\leftarrow\, R_1 + \rowop{\frac{1}{2}R_3}}} \\[6pt] \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & \frac{1}{2} & 0 & 2 \\ 0 & \pivot{\mathbf{1}} & 0 & 2 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right] \\[6pt] \xrightarrow{R_1 \,\leftarrow\, R_1 - \rowop{\frac{1}{2}R_2}} \\[6pt] \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 0 & 0 & 1 \\ 0 & \pivot{\mathbf{1}} & 0 & 2 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right] \end{gathered}

Reading across the rows gives the solution x=1x = 1, y=2y = 2, and z=3z = 3. You don't have to save dividing by the pivots until the end: if a row like [0,12,52  |  172]\left[0, \pivot{\frac{1}{2}}, \frac{5}{2} \;\middle|\; \frac{17}{2}\right] has fractions, you can multiply that row by 2\rowop{2} right before using it as a pivot so you only work with whole numbers.

4

Zero in the Pivot Spot, No Solution, and Free Variables

The rule Multiplier=EntryPivot\rowop{\text{Multiplier}} = \frac{\text{Entry}}{\pivot{\text{Pivot}}} works for any pivot except 00, because dividing by 00 is undefined: multiplying 00 by any number still gives 00 and cannot cancel a non-zero entry below it. Here is how to fix a 00 in the pivot spot, and what it means when no non-zero number is available below it and an entire row of variables cancels out.

Zero in the Pivot Spot, No Solution, and Free Variables
xx
yy
zz
11
22
11
88
00
00
33
99
00
22
11
55
[121800390215]→R2 ↔ R3[121802150039]\displaystyle \begin{gathered} \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & 1 & 8 \\ 0 & \mathbf{0} & 3 & 9 \\ 0 & 2 & 1 & 5 \end{array}\right] \\[6pt] \xrightarrow{R_2 \,\rowop{\leftrightarrow}\, R_3} \\[6pt] \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & 1 & 8 \\ 0 & \pivot{\mathbf{2}} & 1 & 5 \\ 0 & 0 & \pivot{\mathbf{3}} & 9 \end{array}\right] \end{gathered}
[0005]⟶0x+0y+0z=5⟹0=5⏟never true (No Solution)\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} 0 & 0 & 0 & \contra{5} \end{array}\right] \\ &\longrightarrow \quad 0x + 0y + 0z = \contra{5} \\ &\Longrightarrow \quad \contra{\underbrace{0 = 5}_{\text{never true (No Solution)}}} \end{aligned}
[102401−130000]⟶{Columns 1 and 2 have pivots (x and y are determined by z)Column 3 has no pivot (z⏟free variable  ⟹  Infinitely Many Solutions)\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 0 & \free{2} & 4 \\ 0 & \pivot{\mathbf{1}} & \free{-1} & 3 \\ 0 & 0 & \free{0} & 0 \end{array}\right] \\[6pt] & \longrightarrow \\ & \quad \left\{\begin{array}{l} \text{Columns 1 and 2 have pivots } \\ (x \text{ and } y \text{ are determined by } \free{z}) \\[4pt] \text{Column 3 has no pivot } \\ (\free{\underbrace{z}_{\text{free variable}}} \implies \\ \free{\text{Infinitely Many Solutions}}) \end{array}\right. \end{aligned}

When a 00 lands in the Row 2, Column 2 pivot spot, what happens next depends entirely on the third row.

A zero in a pivot spot is fixed by swapping when a non-zero number sits below it, while all zeros below it clear the bottom row into either a true statement or an impossible one.
5

Gaussian Elimination from Start to Finish

Now let's put all the steps together from the starting equations to the final answer.

Gaussian Elimination from Start to Finish
xx
yy
zz
11
22
11
88
22
55
33
2121
11
44
44
2121
x=?x = {?}
y=?y = {?}
z=?z = {?}

Key concepts

Building the staircase (Row Echelon Form)

Write the system as an augmented matrix and work column by column from left to right, stepping diagonally down from one pivot to the next so the zeros to the left of each new pivot keep the columns you already cleared at zero. To cancel an entry below a pivot, subtract Multiplier×(Pivot Row)\rowop{\text{Multiplier} \times (\text{Pivot Row})} using

Multiplier\displaystyle \rowop{\text{Multiplier}} =Entry to eliminatePivot\displaystyle = \frac{\text{Entry to eliminate}}{\pivot{\text{Pivot}}}
For example, to eliminate −4-4 below a pivot of 2\pivot{2}, the multiplier is −42=−2\frac{-4}{\pivot{2}} = \rowop{-2}, so you subtract −2R1\rowop{-2R_1}, which adds 2R1\rowop{2R_1} (R3←R3+2R1R_3 \leftarrow R_3 + \rowop{2R_1}).

When a 00 lands in the pivot spot

Do not use EntryPivot\frac{\text{Entry}}{\pivot{\text{Pivot}}}. Look below the 00 in that same column: if there is a non-zero entry below it (like a 22 in Row 3 beneath a 00 in Row 2), swap those two rows (R2↔R3R_2 \rowop{\leftrightarrow} R_3) and keep going.

Two ways to finish from the staircase

If you just want the values of xx, yy, and zz quickly, stop as soon as you have the staircase (Row Echelon Form) and use back-substitution from the bottom equation up (z=3  ⟹  y+3=5z = 3 \implies y + 3 = 5   ⟹  x+2(2)+3=8{}\implies x + 2(2) + 3 = 8). Only divide each row by its pivot and clear above the pivots from the bottom-right pivot upwards (Gauss-Jordan elimination) when you want the matrix in Reduced Row Echelon Form [100x010y001z]\left[\begin{array}{ccc|c} \pivot{1} & 0 & 0 & x \\ 0 & \pivot{1} & 0 & y \\ 0 & 0 & \pivot{1} & z \end{array}\right].

When a row of variables cancels out

Write the bottom row back as an equation. A row like [0    0    0∣5]\left[0 \;\; 0 \;\; 0 \mid \contra{5}\right] means 0=5\contra{0 = 5}, so there is No Solution. A row of all zeros [0    0    0∣0]\left[0 \;\; 0 \;\; 0 \mid 0\right] means 0=00 = 0, which adds no new information and leaves a column without a circled pivot. That column's variable is a free variable, so the system has Infinitely Many Solutions.

6

Practice

1

Write the augmented matrix for the system x+y+z=7x + y + z = 7, 2x+3y+3z=192x + 3y + 3z = 19, x+3y+4z=21x + 3y + 4z = 21, eliminate below the pivots to reach a staircase (Row Echelon Form), and solve by back-substitution.

Once Column 1 is cleared below the top-left 1\pivot{1}, which row's pivot has a 00 in Column 1 that keeps your zeros unchanged when you eliminate the 22 in Row 3, Column 2?

Write the system as an augmented matrix and clear Column 1 using the pivot 1\pivot{\mathbf{1}} in Row 1:
[11172331913421]→R2←R2−2R1R3←R3−R1[1117011502314]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & 1 & 7 \\ 2 & 3 & 3 & 19 \\ 1 & 3 & 4 & 21 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{2R_1} \\ R_3 \,\leftarrow\, R_3 - \rowop{R_1}}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & 1 & 7 \\ 0 & \pivot{\mathbf{1}} & 1 & 5 \\ 0 & 2 & 3 & 14 \end{array}\right] \end{aligned}
Step diagonally down to the pivot 1\pivot{\mathbf{1}} in Row 2, Column 2 and clear the 22 below it:
[1117011502314]→R3 ← R3−2R2[111701150014]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & 1 & 7 \\ 0 & \pivot{\mathbf{1}} & 1 & 5 \\ 0 & 2 & 3 & 14 \end{array}\right] \\[6pt] \xrightarrow{R_3 \,\leftarrow\, R_3 - \rowop{2R_2}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & 1 & 7 \\ 0 & \pivot{\mathbf{1}} & 1 & 5 \\ 0 & 0 & \pivot{\mathbf{1}} & 4 \end{array}\right] \end{aligned}
(Watch out: remember to multiply the right-hand side of Row 2 by 2\rowop{2} as well, doing 14−2(5)=414 - \rowop{2(5)} = 4; forgetting to double the 55 gives 14−5=914 - 5 = 9, which leads to the wrong answer z=9,y=−4,x=2z = 9, y = -4, x = 2.)
Back-substituting from the bottom row up:
z=4y+4=5  ⟹  y=1x+1+4=7  ⟹  x=2\displaystyle \begin{aligned} z &= 4 \\ y + 4 &= 5 \implies y = 1 \\ x + 1 + 4 &= 7 \implies x = 2 \end{aligned}
2

This augmented matrix is already in staircase form:

[22−22013800−4−8]\displaystyle \left[\begin{array}{ccc|c} 2 & 2 & -2 & 2 \\ 0 & 1 & 3 & 8 \\ 0 & 0 & -4 & -8 \end{array}\right]

Divide each row by its pivot so every pivot is 11, then clear above the pivots (Gauss-Jordan elimination) to reach Reduced Row Echelon Form and read off xx, yy, and zz.

After dividing Row 3 by −4\pivot{-4} and Row 1 by 2\pivot{2}, start at the bottom-right pivot and work upwards so the zeros to its left keep Columns 1 and 2 unchanged.

Divide Row 3 by −4\pivot{-4} and Row 1 by 2\pivot{2} so all three pivots are 1\pivot{1}:
[22−22013800−4−8]→R3←R3÷(−4)R1←R1÷2[11−1101380012]\displaystyle \begin{gathered} \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 2 & -2 & 2 \\ 0 & \pivot{\mathbf{1}} & 3 & 8 \\ 0 & 0 & \pivot{\mathbf{-4}} & -8 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_3 \,\leftarrow\, R_3 \div (\pivot{-4}) \\ R_1 \,\leftarrow\, R_1 \div \pivot{2}}} \\[6pt] \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & -1 & 1 \\ 0 & \pivot{\mathbf{1}} & 3 & 8 \\ 0 & 0 & \pivot{\mathbf{1}} & 2 \end{array}\right] \end{gathered}
Clear above the Row 3 pivot first, then above the Row 2 pivot:
[11−1101380012]→R2←R2−3R3R1←R1+R3[110301020012]→R1 ← R1−R2[100101020012]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & -1 & 1 \\ 0 & \pivot{\mathbf{1}} & 3 & 8 \\ 0 & 0 & \pivot{\mathbf{1}} & 2 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{3R_3} \\ R_1 \,\leftarrow\, R_1 + \rowop{R_3}}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & 0 & 3 \\ 0 & \pivot{\mathbf{1}} & 0 & 2 \\ 0 & 0 & \pivot{\mathbf{1}} & 2 \end{array}\right] \\[6pt] \xrightarrow{R_1 \,\leftarrow\, R_1 - \rowop{R_2}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 0 & 0 & 1 \\ 0 & \pivot{\mathbf{1}} & 0 & 2 \\ 0 & 0 & \pivot{\mathbf{1}} & 2 \end{array}\right] \end{aligned}
(Watch out: to cancel the −1-1 in Row 1, Column 3, you must add R3\rowop{R_3} (R1←R1+R3R_1 \leftarrow R_1 + \rowop{R_3}, giving 1+2=31 + 2 = 3 on the right); subtracting R3\rowop{R_3} by mistake gives 1−2=−11 - 2 = -1 on the right and leads to x=−3x = -3.)
x\displaystyle x =1,y\displaystyle = 1, \quad y =2,z\displaystyle = 2, \quad z =2\displaystyle = 2
3

Solve the system 2x+y+z=62x + y + z = 6, 3x+2y+2z=103x + 2y + 2z = 10, −2x+2y+3z=3-2x + 2y + 3z = 3 using Multiplier=EntryPivot\rowop{\text{Multiplier}} = \frac{\text{Entry}}{\pivot{\text{Pivot}}}.

After clearing Column 1 with multipliers 32\rowop{\frac{3}{2}} and −22=−1\frac{-2}{\pivot{2}} = \rowop{-1}, your Row 2 pivot is 12\pivot{\frac{1}{2}}. What do you get when you divide the entry 33 below it by 12\pivot{\frac{1}{2}}?

Write the augmented matrix and clear Column 1 using the pivot 2\pivot{\mathbf{2}} in Row 1 (multiplier 32\rowop{\frac{3}{2}} for Row 2 and −22=−1\frac{-2}{\pivot{2}} = \rowop{-1} for Row 3):
[211632210−2233]→R2←R2−32R1R3←R3+R1[21160121210349]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & 1 & 6 \\ 3 & 2 & 2 & 10 \\ -2 & 2 & 3 & 3 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{\frac{3}{2}R_1} \\ R_3 \,\leftarrow\, R_3 + \rowop{R_1}}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & 1 & 6 \\ 0 & \pivot{\mathbf{\frac{1}{2}}} & \frac{1}{2} & 1 \\ 0 & 3 & 4 & 9 \end{array}\right] \end{aligned}
For Column 2, the pivot is 12\pivot{\mathbf{\frac{1}{2}}} and the entry to eliminate is 33, so Multiplier=312=6\rowop{\text{Multiplier}} = \frac{3}{\pivot{\tfrac{1}{2}}} = \rowop{6}:
[21160121210349]→R3 ← R3−6R2[21160121210013]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & 1 & 6 \\ 0 & \pivot{\mathbf{\frac{1}{2}}} & \frac{1}{2} & 1 \\ 0 & 3 & 4 & 9 \end{array}\right] \\[6pt] \xrightarrow{R_3 \,\leftarrow\, R_3 - \rowop{6R_2}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{2}} & 1 & 1 & 6 \\ 0 & \pivot{\mathbf{\frac{1}{2}}} & \frac{1}{2} & 1 \\ 0 & 0 & \pivot{\mathbf{1}} & 3 \end{array}\right] \end{aligned}
(Watch out: dividing 33 by 12\pivot{\frac{1}{2}} gives 6\rowop{6}, not 32\frac{3}{2}; also, when back-substituting z=3z = 3 into Row 2, 12y+32=1\frac{1}{2}y + \frac{3}{2} = 1 gives 12y=−12  ⟹  y=−1\frac{1}{2}y = -\frac{1}{2} \implies y = -1, whereas adding 1+32=521 + \frac{3}{2} = \frac{5}{2} gives the wrong answer y=5,x=−1y = 5, x = -1.)
Back-substituting from the bottom row up:
z=312y+12(3)=1  ⟹  12y=−12  ⟹  y=−12x−1+3=6  ⟹  2x=4  ⟹  x=2\displaystyle \begin{aligned} z &= 3 \\ \tfrac{1}{2}y + \tfrac{1}{2}(3) &= 1 \implies \tfrac{1}{2}y = -\tfrac{1}{2} \\ &\implies y = -1 \\ 2x - 1 + 3 &= 6 \implies 2x = 4 \\ &\implies x = 2 \end{aligned}
4

Solve the system x+2y−z=3x + 2y - z = 3, 2x+4y+z=92x + 4y + z = 9, x+3y+2z=7x + 3y + 2z = 7.

Write the augmented matrix and clear Column 1 first. What lands in the Row 2, Column 2 pivot spot, and which legal move puts a non-zero pivot there?

Clear Column 1 below the top-left pivot 1\pivot{\mathbf{1}}:
[12−1324191327]→R2←R2−2R1R3←R3−R1[12−1300330134]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & -1 & 3 \\ 2 & 4 & 1 & 9 \\ 1 & 3 & 2 & 7 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{2R_1} \\ R_3 \,\leftarrow\, R_3 - \rowop{R_1}}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & -1 & 3 \\ 0 & \mathbf{0} & 3 & 3 \\ 0 & 1 & 3 & 4 \end{array}\right] \end{aligned}
(Watch out: Row 1 has −1-1 in Column 3, so subtracting 2(−1)\rowop{2(-1)} in Row 2 gives 1−(−2)=31 - \rowop{(-2)} = 3 and subtracting −1\rowop{-1} in Row 3 gives 2−(−1)=32 - \rowop{(-1)} = 3; dropping the negative sign gives −1-1 and 11 in Column 3, which leads to the wrong answer z=−3,y=7,x=−14z = -3, y = 7, x = -14.)
A 00 landed in the Row 2, Column 2 pivot spot with a 11 below it in Row 3, so swap Row 2 and Row 3:
[12−1300330134]→R2 ↔ R3[12−1301340033]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & -1 & 3 \\ 0 & \mathbf{0} & 3 & 3 \\ 0 & 1 & 3 & 4 \end{array}\right] \\[6pt] \xrightarrow{R_2 \,\rowop{\leftrightarrow}\, R_3} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 2 & -1 & 3 \\ 0 & \pivot{\mathbf{1}} & 3 & 4 \\ 0 & 0 & \pivot{\mathbf{3}} & 3 \end{array}\right] \end{aligned}
Back-substituting from the bottom row up:
3z=3  ⟹  z=1y+3(1)=4  ⟹  y=1x+2(1)−1=3  ⟹  x=2\displaystyle \begin{aligned} 3z &= 3 \implies z = 1 \\ y + 3(1) &= 4 \implies y = 1 \\ x + 2(1) - 1 &= 3 \implies x = 2 \end{aligned}
5

Use Gaussian elimination to determine whether the system x+y+2z=4x + y + 2z = 4, 2x+3y+5z=112x + 3y + 5z = 11, 3x+4y+7z=103x + 4y + 7z = 10 has a unique solution, no solution, or infinitely many solutions.

Clear Column 1, then use the Row 2 pivot to clear Column 2 and write the entire bottom row, including the right-hand side, back as an equation.

Clear Column 1 using the pivot 1\pivot{\mathbf{1}} in Row 1, then clear Column 2 using the pivot 1\pivot{\mathbf{1}} in Row 2:
[11242351134710]→R2←R2−2R1R3←R3−3R1[11240113011−2]→R3 ← R3−R2[11240113000−5]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & 2 & 4 \\ 2 & 3 & 5 & 11 \\ 3 & 4 & 7 & 10 \end{array}\right] \\[6pt] \xrightarrow{\substack{R_2 \,\leftarrow\, R_2 - \rowop{2R_1} \\ R_3 \,\leftarrow\, R_3 - \rowop{3R_1}}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & 2 & 4 \\ 0 & \pivot{\mathbf{1}} & 1 & 3 \\ 0 & 1 & 1 & -2 \end{array}\right] \\[6pt] \xrightarrow{R_3 \,\leftarrow\, R_3 - \rowop{R_2}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & 1 & 2 & 4 \\ 0 & \pivot{\mathbf{1}} & 1 & 3 \\ 0 & 0 & 0 & \contra{-5} \end{array}\right] \end{aligned}
(Watch out: don't stop at the three zeros on the left of the bottom row and call it "Infinitely Many Solutions". Check the number to the right of the line, which is −5\contra{-5}, not 00.)
The bottom row means 0x+0y+0z=−50x + 0y + 0z = \contra{-5}, or 0=−5\contra{0 = -5}, which is never true:
No Solution\displaystyle \text{No Solution}
6

Finish eliminating the augmented matrix

[1−12502−460−24−6]\displaystyle \left[\begin{array}{ccc|c} 1 & -1 & 2 & 5 \\ 0 & 2 & -4 & 6 \\ 0 & -2 & 4 & -6 \end{array}\right]

How many solutions does the system have, and which variable is free?

Use the pivot 2\pivot{2} in Row 2, Column 2 to eliminate the −2-2 below it, then circle your pivots and check which column is missing one.

Using the pivot 2\pivot{\mathbf{2}} in Row 2, Column 2, the multiplier for Row 3 is −22=−1\frac{-2}{\pivot{2}} = \rowop{-1}, so add Row 2 to Row 3 (R3←R3+R2R_3 \leftarrow R_3 + \rowop{R_2}):
[1−12502−460−24−6]→R3 ← R3+R2[1−12502−460000]\displaystyle \begin{aligned} & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & -1 & 2 & 5 \\ 0 & \pivot{\mathbf{2}} & -4 & 6 \\ 0 & -2 & 4 & -6 \end{array}\right] \\[6pt] \xrightarrow{R_3 \,\leftarrow\, R_3 + \rowop{R_2}} \quad & \left[\begin{array}{ccc|c} \pivot{\mathbf{1}} & -1 & \free{2} & 5 \\ 0 & \pivot{\mathbf{2}} & \free{-4} & 6 \\ 0 & 0 & \free{0} & 0 \end{array}\right] \end{aligned}
The bottom row means 0=00 = 0, so the third equation adds no new information. Columns 1 and 2 have pivots (1\pivot{\mathbf{1}} and 2\pivot{\mathbf{2}}) that determine xx and yy once z\free{z} is chosen, while Column 3 has no pivot. (Watch out: 0=00 = 0 is always true, not a false statement like 0=−6\contra{0 = -6}, and the free variable belongs to the column without a pivot: Column 3 (z\free{z}), not xx or yy.)
Infinitely Many Solutions, with z as the free variable\displaystyle \begin{gathered} \text{Infinitely Many Solutions, with } \\ \free{z} \text{ as the free variable} \end{gathered}