Home › Reference Information › Mathematics Theory › Gaussian Elimination

Gaussian Elimination

Gaussian elimination is an algorithm for solving systems of linear equations based on the sequential elimination of unknowns. On this page, you will find a step-by-step description of the method, examples of solving 3×3 and 4×4 systems, and an analysis of special cases (systems with no solutions and systems with infinitely many solutions).


Definition of Gaussian elimination

Gaussian elimination is an algorithm for solving systems of linear equations that involves sequentially transforming the system into row-echelon form (triangular or trapezoidal) using elementary row operations.

Key steps of the Gaussian elimination method:

  1. Write down the augmented matrix of the system (equation coefficients + column of constant terms)
  2. Reduce the matrix to row-echelon form (forward elimination):
    • Select a pivot element (the first non-zero element in the row)
    • Eliminate elements below the pivot by subtracting appropriate row combinations
    • Move to the next column and repeat
  3. Back-substitution:
    • Starting from the last row, express basic variables in terms of free variables (if any)
    • If the system is consistent, obtain the solution

Example of solving a 3×3 system

Given system:

{ 2x1+4x2-x3=5 3x1-2x2+2x3=8 x1+3x2-4x3=1 }

Step 1: Write the augmented matrix:

( 24-1|5 3-22|8 13-4|1 )

Step 2: Reduce to row-echelon form:

( 12-12|52 0-872|12 00-258|-258 )

Step 3: Back-substitution:

{ x1=2 x2=1 x3=1 }

Example of a 4×4 system

Given system:

{ a11x1+a12x2+a13x3+a14x4=b1(1) a21x1+a22x2+a23x3+a24x4=b2(2) a31x1+a32x2+a33x3+a34x4=b3(3) a41x1+a42x2+a43x3+a44x4=b4(4) }

1. Write the augmented matrix:

( a11a12a13a14|b1 a21a22a23a24|b2 a31a32a33a34|b3 a41a42a43a44|b4 )

2. Forward elimination (reduction to row-echelon form):

  • Step 1: If the first element is zero, swap rows so that it is non-zero
  • Step 2: Eliminate elements below the pivot:
    • Subtract row (1) multiplied by an appropriate coefficient from row (2)
    • Do the same for rows (3) and (4)
  • Step 3: Move to the second column and repeat the process for the submatrix

After transformations, the matrix takes the form:

( a11a12a13a14|b1 0a22′a23′a24′|b2′ 00a33″a34″|b3″ 000a44″′|b4″′ )

3. Back-substitution:

  • Find the last variable from the last equation
  • Substitute it into the second-to-last equation to find the preceding variable
  • Continue this process until all variables are found

Possible cases:

  • Unique solution: All rows are in row-echelon form; no contradictions
  • Infinitely many solutions: Fewer non-zero rows than variables in row-echelon form
  • No solution: A row appears in the form "zero equals a non-zero number"

The Gaussian elimination method is universal and applicable to any linear system!

Special cases

Infinitely many solutions

If, during the transformation process, a row is obtained where all coefficients are zero and the constant term is also zero, then the system has infinitely many solutions.

( 12-1|3 0112|52 000|0 )

No solutions

If a row is obtained where all coefficients are zero but the constant term is non-zero, then the system has no solutions.

( 1-23|4 01-1|2 000|1 )
  • Quick facts
  • Tables
  • Formulas
  • Geometry formulas
  • Math theory