Solving Systems with Gaussian Elimination

April 13, 2026

Problem

Solve the system 2x + y − z = 8, −3x − y + 2z = −11, −2x + y + 2z = −3 using row operations on the augmented matrix.

Explanation

What is Gaussian elimination?

Gaussian elimination is a systematic procedure that uses elementary row operations to transform the augmented matrix [Ab][A \mid \mathbf{b}] of a linear system into row-echelon form (upper triangular), from which the solution is read off by back substitution.

The three elementary row operations

  1. Swap two rows: RiRjR_i \leftrightarrow R_j.
  2. Scale a row: RicRiR_i \to c \, R_i with c0c \ne 0.
  3. Combine: replace RiR_i with Ri+cRjR_i + c \, R_j.

Each operation preserves the solution set — the system before and after has the same solutions.

The augmented matrix

[Ab]=[2118312112123][A \mid \mathbf{b}] = \left[\begin{array}{ccc|c} 2 & 1 & -1 & 8 \\ -3 & -1 & 2 & -11 \\ -2 & 1 & 2 & -3 \end{array}\right]

Step-by-step solution

Step 1 — Create a zero in column 1, row 2. Use R2R2+32R1R_2 \to R_2 + \dfrac{3}{2} R_1: R2=(3,1,2,11)+32(2,1,1,8)=(0,12,12,1)R_2 = (-3, -1, 2, -11) + \tfrac{3}{2}(2, 1, -1, 8) = (0, \tfrac{1}{2}, \tfrac{1}{2}, 1)

Step 2 — Create a zero in column 1, row 3. Use R3R3+R1R_3 \to R_3 + R_1: R3=(2,1,2,3)+(2,1,1,8)=(0,2,1,5)R_3 = (-2, 1, 2, -3) + (2, 1, -1, 8) = (0, 2, 1, 5)

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

Step 3 — Create a zero in column 2, row 3. Use R3R34R2R_3 \to R_3 - 4 R_2: R3=(0,2,1,5)4(0,12,12,1)=(0,0,1,1)R_3 = (0, 2, 1, 5) - 4(0, \tfrac{1}{2}, \tfrac{1}{2}, 1) = (0, 0, -1, 1)

Upper triangular form: [211801/21/210011]\left[\begin{array}{ccc|c} 2 & 1 & -1 & 8 \\ 0 & 1/2 & 1/2 & 1 \\ 0 & 0 & -1 & 1 \end{array}\right]

Step 4 — Back substitution.

From row 3: z=1    z=1-z = 1 \implies z = -1.

From row 2: 12y+12(1)=1    y=3\tfrac{1}{2} y + \tfrac{1}{2}(-1) = 1 \implies y = 3.

From row 1: 2x+3(1)=8    2x=4    x=22x + 3 - (-1) = 8 \implies 2x = 4 \implies x = 2.

Solution: (x,y,z)=(2,3,1)\boxed{(x, y, z) = (2, 3, -1)}.

Verification

  • Eq 1: 2(2)+3(1)=4+3+1=82(2) + 3 - (-1) = 4 + 3 + 1 = 8
  • Eq 2: 3(2)3+2(1)=632=11-3(2) - 3 + 2(-1) = -6 - 3 - 2 = -11
  • Eq 3: 2(2)+3+2(1)=4+32=3-2(2) + 3 + 2(-1) = -4 + 3 - 2 = -3

Common mistakes

  • Forgetting to update the right-hand side. Every row operation applies to the full augmented row, not just the coefficient part.
  • Not following a consistent pivot order. Work column by column from left to right, top to bottom, to avoid re-introducing non-zero entries.
  • Dividing by zero. If the pivot element is 0, swap rows first to get a non-zero pivot.

Try it in the visualization

Each row operation is animated as a transformation of the matrix. Step through operations to see the zeros appearing in the lower triangle and the back-substitution unwinding from bottom to top.

Interactive Visualization

Parameters

0.00
3.00
Your turn

Got your own math or physics problem?

Turn any problem into an interactive visualization like this one — powered by AI, generated in seconds. Free to try, no credit card required.

Sign Up Free to Try It30 free visualizations every day
Solving Systems with Gaussian Elimination | MathSpin