VectorLab

Visualize vectors, solve algebra & calculus step by step, with guides

← Back to the tools

Gaussian Elimination: Solving Linear Systems

Gaussian elimination solves a system of linear equations by reducing it to a triangular form and then back-substituting. A full worked example with a check.

The idea

Write the system as an augmented matrix, use row operations to make everything below each pivot zero (forward elimination), then solve from the bottom row upward (back-substitution). Unlike Gauss–Jordan elimination, you do not scale pivots to 1 or clear entries above them; the triangular shape is enough.

Worked example

Solve x + y + z = 6, 2x + 3y + z = 14, x − y + 2z = 5.

Forward elimination

  • R₂ − 2R₁: the second equation becomes y − z = 2.
  • R₃ − R₁: the third becomes −2y + z = −1.
  • R₃ + 2R₂: the third becomes −z = 3.

Back-substitution

  • From −z = 3, z = −3.
  • From y − z = 2, y = 2 + z = −1.
  • From x + y + z = 6, x = 6 − (−1) − (−3) = 10.

The solution is (x, y, z) = (10, −1, −3). Check the second equation: 2(10) + 3(−1) + (−3) = 14 ✓. Check the third: 10 + 1 − 6 = 5 ✓.

The three possible outcomes

  • Unique solution: a pivot in every variable column.
  • Infinitely many solutions: at least one free variable, with no contradictory row.
  • No solution: a row of the form (0, 0, 0 | c) with c ≠ 0.

Why pivoting matters

If the number in the pivot position is zero, swap in a lower row. On a computer working in floating point, choosing the largest available entry as the pivot (partial pivoting) keeps rounding error small. The tool offers exact fractions so you can follow every step cleanly.

Common mistakes

  • Forgetting to apply the operation to the right-hand side.
  • Sign errors when subtracting a negative multiple.
  • Not checking the final answer in the original equations, which takes ten seconds.

FAQ

How is this different from Gauss–Jordan?

Gauss–Jordan continues to RREF so the answer can be read off directly. Gaussian elimination stops at triangular form and back-substitutes, which is usually fewer operations.

Does it work for non-square systems?

Yes. Pivot columns give determined variables, and non-pivot columns become free variables.

Beyond solving systems

The same elimination gives the determinant: multiply the pivots together and flip the sign once for each row swap. Recording the multipliers you used also produces the LU factorization, which is how software solves many systems that share a matrix. If any pivot position stays zero after swapping, the matrix is singular and its determinant is zero.

Open the interactive tools →