Solve the 3x3 linear system using Gaussian elimination (row reduction to reduced row echelon form). Each row operation is shown as a single step: eliminate below the pivot, then back-substitute to isolate each variable. The augmented matrix updates after every operation.

Example

Use row operations on the augmented matrix until the system is solved.

highlighted = computed this step

Step 1 — Set up

Start with the augmented matrix.

[2118312112123]\left[\begin{array}{ccc|c}2&1&-1&8\\-3&-1&2&-11\\-2&1&2&-3\end{array}\right]

Step 2 — Eliminate below pivot 1

Update row 2 using row 1: r2 <- r2 + 3/2*r1; update row 3 using row 1: r3 <- r3 + r1.

[211801/21/210215]\left[\begin{array}{ccc|c}2&1&-1&8\\\hl{0}&\hl{1/2}&\hl{1/2}&\hl{1}\\\hl{0}&\hl{2}&\hl{1}&\hl{5}\end{array}\right]

Step 3 — Eliminate below pivot 2

Update row 3 using row 2: r3 <- r3 - 4*r2.

[211801212100-11]\left[\begin{array}{ccc|c}2&1&-1&8\\0&\frac{1}{2}&\frac{1}{2}&1\\\hl{0}&\hl{0}&\hl{-1}&\hl{1}\end{array}\right]

Step 4 — Normalize pivot row 3

Scale row 3: r3 <- -1*r3.

[2118012121001-1]\left[\begin{array}{ccc|c}2&1&-1&8\\0&\frac{1}{2}&\frac{1}{2}&1\\\hl{0}&\hl{0}&\hl{1}&\hl{-1}\end{array}\right]

Step 5 — Eliminate x3 above

Update row 1 using row 3: r1 <- r1 + r3; update row 2 using row 3: r2 <- r2 - 1/2*r3.

[210701/203/20011]\left[\begin{array}{ccc|c}\hl{2}&\hl{1}&\hl{0}&\hl{7}\\\hl{0}&\hl{1/2}&\hl{0}&\hl{3/2}\\0&0&1&-1\end{array}\right]

Step 6 — Normalize pivot row 2

Scale row 2: r2 <- 2*r2.

[210701030011]\left[\begin{array}{ccc|c}2&1&0&7\\\hl{0}&\hl{1}&\hl{0}&\hl{3}\\0&0&1&-1\end{array}\right]

Step 7 — Eliminate x2 above

Update row 1 using row 2: r1 <- r1 - r2.

[200401030011]\left[\begin{array}{ccc|c}\hl{2}&\hl{0}&\hl{0}&\hl{4}\\0&1&0&3\\0&0&1&-1\end{array}\right]

Step 8 — Normalize pivot row 1

Scale row 1: r1 <- 1/2*r1.

[100201030011]\left[\begin{array}{ccc|c}\hl{1}&\hl{0}&\hl{0}&\hl{2}\\0&1&0&3\\0&0&1&-1\end{array}\right]

Step 9 — Result

Read the solution: x1 = 2, x2 = 3, x3 = -1.

[100201030011],solution: x1=2, x2=3, x3=1\left[\begin{array}{ccc|c}1&0&0&2\\0&1&0&3\\0&0&1&-1\end{array}\right],\quad \text{solution: }x1=2,\ x2=3,\ x3=-1
row-operation Replace a row with a linear combination of itself and another row to create a zero in the pivot column. This preserves the solution set.
pivot The leading nonzero entry in a row used to eliminate entries above and below it in the same column.
back-substitution After forward elimination produces an upper-triangular matrix, work upward row by row to find each variable's value.