Gauss Elimination Method

Last Updated : 7 Aug, 2025

The Gaussian Elimination Method is a fundamental algorithm in linear algebra used to solve systems of linear equations. By transforming a system into an upper triangular matrix through a series of row operations. It allows us to find the values of unknowns (like x, y, z) using a series of row operations.

This method is a cornerstone of computational mathematics, with applications spanning engineering, physics, economics, and computer science.

Categories of Linear Equation Systems:

These categories depend on the relationship between the number of equations, variables, and their coefficients.

  • Consistent Independent System: Has exactly one solution.
  • Consistent Dependent System: Has infinite solutions.
  • Inconsistent System: Has no solution.

How to Solve an Equation using Gauss Elimination?

Gauss Elimination is a step-by-step procedure for solving systems of linear equations by reducing the system to row echelon form and then applying back-substitution.

Steps of Gaussian Elimination

  1. Form the Augmented Matrix: Represent the system as an augmented matrix combining coefficients and constants.
  2. Forward Elimination: Use row operations—swapping rows, scaling rows, or adding multiples of one row to another—to convert the matrix into row echelon (upper triangular) form.
  3. Back-Substitution: Solve the resulting triangular system from the bottom up to find the values of the variables.

Example: Consider the system:

  • ( 2x + y - z = 8 )
  • ( -3x - y + 2z = -11 )
  • ( -2x + y + 2z = -3 )

The augmented matrix is: \begin{bmatrix} 2 & 1 & -1 &| \ 8 \\ -3 & -1 & 2 &|\ -11 \\ -2 & 1 & 2 & |\ -3 \end{bmatrix}

  • Step 1: Eliminate ( x ) from rows 2 and 3 using row 1. Multiply row 1 by 1.5 and add to row 2, then add row 1 to row 3.
  • Step 2: Eliminate ( y ) from row 3 using the new row 2.
  • Result: An upper triangular matrix, solved via back-substitution to yield ( x = 2, y = 3, z = -1 ).

Use of Gauss Elimination in Maths

We can use this method to estimate either of the following:

  • Computing Determinants: It simplifies finding the determinant of a square matrix by reducing it to row echelon form. The determinant is calculated by multiplying the diagonal elements and adjusting for row swaps and scalar multiplications.
  • Finding the Inverse of a Matrix: Gauss–Jordan elimination, a variant of Gaussian elimination, is used to find the inverse of a matrix. By augmenting the matrix with the identity matrix and applying row operations, the matrix is transformed into the inverse if it exists.
  • Computing Ranks and Bases: It can be applied to any matrix to determine its rank and the basis for its column space. The row echelon form reveals information about the number of linearly independent rows and the columns that form a basis for the matrix's column space.

Applications of Gaussian Elimination Method

Gaussian elimination is used in CS, especially in foundational areas involving linear systems.

Numerical Analysis / Scientific Computing

  • Solving systems of linear equations.
  • Used in simulation, modeling, and engineering applications (e.g., finite element methods, physics engines).

Computer Graphics

  • Linear systems arise when transforming 3D models, projecting images, or solving for lighting equations (e.g., radiosity).

Machine Learning / Data Science

  • While rarely used directly (due to inefficiency), Gaussian elimination forms the basis of linear algebra solvers.
  • Libraries like NumPy, PyTorch, or MATLAB use optimized versions or decompositions based on similar principles.

Cryptography / Coding Theory

  • Solving linear systems over finite fields (e.g., GF(2)) using Gauss-Jordan elimination, often in error correction codes.

Computer Vision

  • Solving least squares problems, such as for camera calibration, using systems of equations.

Robotics / Control Systems

  • Kinematics and dynamics often involve solving systems of linear equations.

Solved Questions on Gauss Elimination

Question 1: Solve this Equation

x + 2y = 8
3x + 4y = 18

Solution :

x + 2y = 8
3x + 4y = 18

\left[\begin{array}{cc|c}1 & 2 & 8 \\3 & 4 & 18\end{array}\right]

R_2 \rightarrow R_2 - 3 \cdot R_1\left[\begin{array}{cc|c}1 & 2 & 8 \\0 & -2 & -6\end{array}\right]

Now solving the equation:

- 2y = - 6
= y = 3

Substitute into x + 2y = 8

x + 2(3) = 8
x + 6 = 8
x = 2

So, x = 2 and y = 3

Question 2: Solve using Gauss Elimination:

x + y + z = 6
2x + y + z = 14
x + 2y + 3z = 14

Solution:

x + y + z = 6
2x + y + z = 14
x + 2y + 3z = 14

\left[\begin{array}{ccc|c}1 & 1 & 1 & 6 \\ 2 & 1 & 1 & 14 \\ 1 & 2 & 3 & 14\end{array}\right]

Estimate below the first 1

R2 → 2R1 - R2

R3 → 1R - R3

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

R2 → R2​/-1 (dividing Row 2 by -1)​

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

R1 → 1 R2 - R1

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

R2 → R3 - R1

\left[\begin{array}{ccc|c}1 & 0 & 0 & 8 \\0 & 1 & 0 & -12 \\0 & 0 & 1 & 10\end{array}\right]

  • x = 8
  • y = -12
  • z = 10

Unsolved Questions on Gauss Elimination Method

Question 1: Solve the following system of equations using Gauss Elimination Method:
3x + 2y = 16
4x - y = 9

Question 2: Solve the following system of equations using Gauss Elimination Method:
2x + 5y = 11
6x - 3y = 9

Question 3: Solve the following system of equations using Gauss Elimination Method:
2x + y - z = 1
4x - 6y = -2
-2x + 7y + 2z = 9

Question 4: Solve the following system of equations using Gauss Elimination Method:
x + y + z = 9
2x - 3y + 4z = 13
3x + 2y - z = 3

Comment

Explore