Gaussian Elimination & Gauss-Jordan Method: Solve Linear Systems Step by Step
Gaussian elimination and the Gauss-Jordan method are systematic techniques for solving systems of linear equations using augmented matrices. Gaussian elimination produces a row echelon form, while Gauss-Jordan elimination goes further to produce a reduced row echelon form — which reads off the solution directly without back-substitution.
These methods generalize the elementary elimination method and are fundamental tools in linear algebra. Beyond solving systems, Gauss-Jordan elimination can compute the inverse of a matrix, determinants, matrix rank, and express matrices via elementary matrices.
You can verify your work using the online Row Reduce Augmented Matrices Calculator. A review of augmented matrices and reduced row echelon form is helpful before proceeding.
Table of Contents
Gaussian Elimination (Row Echelon Form of an Augmented Matrix)
Example 1: Solving a 3×3 System via Row Echelon Form
Solve the following system of linear equations by reducing its augmented matrix to row echelon form:
\[ \begin{cases} x + y - z = -3 \\ 2x + 3y - 8z = -18 \\ 5x + 6y - 10z = -25 \end{cases} \]Solution
The augmented matrix of the system is:
\[ \begin{bmatrix} 1 & 1 & -1 & | & -3 \\ 2 & 3 & -8 & | & -18 \\ 5 & 6 & -10 & | & -25 \end{bmatrix} \]Step 1: Create a pivot in column 1. Add \(-2R_1\) to \(R_2\) and \(-5R_1\) to \(R_3\):
\[ \begin{matrix} \\ R_2 - 2R_1 \\ R_3 - 5R_1 \end{matrix} \begin{bmatrix} \color{blue}1 & 1 & -1 & | & -3 \\ \color{red}0 & 1 & -6 & | & -12 \\ \color{red}0 & 1 & -5 & | & -10 \end{bmatrix} \]Step 2: Create a pivot in column 2. Add \(-R_2\) to \(R_3\):
\[ \begin{matrix} \\ \\ R_3 - R_2 \end{matrix} \begin{bmatrix} \color{blue}1 & 1 & -1 & | & -3 \\ \color{red}0 & \color{blue}1 & -6 & | & -12 \\ \color{red}0 & \color{red}0 & \color{blue}1 & | & 2 \end{bmatrix} \quad \text{(I)} \]Note: Step 2 also produced a pivot in column 3. The matrix is now in row echelon form.
The corresponding system is:
\[ \begin{cases} x + y - z = -3 \\ y - 6z = -12 \\ z = 2 \end{cases} \]Solve by back-substitution, starting from the last equation:
- \( z = 2 \)
- \( y = 6z - 12 = 6(2) - 12 = 0 \)
- \( x = -y + z - 3 = 0 + 2 - 3 = -1 \)
The solution is:
\[ \begin{cases} x = -1 \\ y = 0 \\ z = 2 \end{cases} \]Gauss-Jordan Method (Reduced Row Echelon Form)
A matrix is in reduced row echelon form (RREF) if it is in row echelon form and every leading 1 (pivot) has zeros both above and below it. The process of obtaining this form is called the Gauss-Jordan method.
Continuing with row operations on matrix (I) from Example 1 to eliminate entries above the pivots:
Step 3: Create zeros above the pivot in column 3. Add \(6R_3\) to \(R_2\), and add \(R_3\) to \(R_1\):
\[ \begin{matrix} R_1 + R_3 \\ R_2 + 6R_3 \\ \\ \end{matrix} \begin{bmatrix} \color{blue}1 & 1 & \color{red}0 & | & -1 \\ \color{red}0 & \color{blue}1 & \color{red}0 & | & 0 \\ \color{red}0 & \color{red}0 & \color{blue}1 & | & 2 \end{bmatrix} \]Step 4: Create a zero above the pivot in column 2. Add \(-R_2\) to \(R_1\):
\[ \begin{matrix} R_1 - R_2 \\ \\ \\ \end{matrix} \begin{bmatrix} \color{blue}1 & \color{red}0 & \color{red}0 & | & -1 \\ \color{red}0 & \color{blue}1 & \color{red}0 & | & 0 \\ \color{red}0 & \color{red}0 & \color{blue}1 & | & 2 \end{bmatrix} \]The reduced row echelon form yields the solution directly, with no back-substitution needed:
\[ \begin{cases} x = -1 \\ y = 0 \\ z = 2 \end{cases} \]Example 2: Solving a 4×4 System via Gauss-Jordan Elimination
Write the augmented matrix of the system below in reduced row echelon form and find its solution:
\[ \begin{cases} 2x - y - z + w = -2 \\ -x + y + 2z + 2w = -5 \\ 3x + y - z - 3w = 8 \\ 2x + 2y - 2z - w = 6 \end{cases} \]Solution
The augmented matrix is:
\[ \begin{bmatrix} 2 & -1 & -1 & 1 & | & -2 \\ -1 & 1 & 2 & 2 & | & -5 \\ 3 & 1 & -1 & -3 & | & 8 \\ 2 & 2 & -2 & -1 & | & 6 \end{bmatrix} \]Step 1: Create a pivot in column 1. Swap \(R_1 \leftrightarrow R_2\), multiply the new \(R_1\) by \(-1\), then clear entries below:
\[ \begin{matrix} \\ R_2 - 2R_1 \\ R_3 - 3R_1 \\ R_4 - 2R_1 \end{matrix} \begin{bmatrix} \color{blue}1 & -1 & -2 & -2 & | & 5 \\ \color{red}0 & 1 & 3 & 5 & | & -12 \\ \color{red}0 & 4 & 5 & 3 & | & -7 \\ \color{red}0 & 4 & 2 & 3 & | & -4 \end{bmatrix} \]Step 2: Create a pivot in column 2 and clear entries below:
\[ \begin{matrix} \\ \\ R_3 - 4R_2 \\ R_4 - 4R_2 \end{matrix} \begin{bmatrix} \color{blue}1 & -1 & -2 & -2 & | & 5 \\ \color{red}0 & \color{blue}1 & 3 & 5 & | & -12 \\ \color{red}0 & \color{red}0 & -7 & -17 & | & 41 \\ \color{red}0 & \color{red}0 & -10 & -17 & | & 44 \end{bmatrix} \]Step 3: Create a pivot in column 3. Multiply \(R_3\) by \(-\tfrac{1}{7}\), then clear the entry below using \(R_4 - 10R_3\):
\[ \begin{bmatrix} 1 & -1 & -2 & -2 & | & 5 \\ 0 & 1 & 3 & 5 & | & -12 \\ 0 & 0 & 1 & 17/7 & | & -41/7 \\ 0 & 0 & -10 & -17 & | & 44 \end{bmatrix} \xrightarrow{R_4 + 10R_3} \begin{bmatrix} 1 & -1 & -2 & -2 & | & 5 \\ 0 & 1 & 3 & 5 & | & -12 \\ 0 & 0 & 1 & 17/7 & | & -41/7 \\ 0 & 0 & 0 & 51/7 & | & -102/7 \end{bmatrix} \]Step 4: Create a pivot in column 4 by multiplying \(R_4\) by \(\tfrac{7}{51}\):
\[ \begin{bmatrix} \color{blue}1 & -1 & -2 & -2 & | & 5 \\ \color{red}0 & \color{blue}1 & 3 & 5 & | & -12 \\ \color{red}0 & \color{red}0 & \color{blue}1 & 17/7 & | & -41/7 \\ \color{red}0 & \color{red}0 & \color{red}0 & \color{blue}1 & | & -2 \end{bmatrix} \]The matrix is now in row echelon form.
Steps 5–7: Eliminate entries above the pivots to reach reduced row echelon form:
\[ \begin{matrix} R_1 + 2R_4 \\ R_2 - 5R_4 \\ R_3 - \tfrac{17}{7}R_4 \\ \\ \end{matrix} \begin{bmatrix} \color{blue}1 & -1 & -2 & \color{red}0 & | & 1 \\ \color{red}0 & \color{blue}1 & 3 & \color{red}0 & | & -2 \\ \color{red}0 & \color{red}0 & \color{blue}1 & \color{red}0 & | & -1 \\ \color{red}0 & \color{red}0 & \color{red}0 & \color{blue}1 & | & -2 \end{bmatrix} \]Clear column 3 and column 2 entries above their pivots:
\[ \begin{bmatrix} \color{blue}1 & \color{red}0 & \color{red}0 & \color{red}0 & | & 0 \\ \color{red}0 & \color{blue}1 & \color{red}0 & \color{red}0 & | & 1 \\ \color{red}0 & \color{red}0 & \color{blue}1 & \color{red}0 & | & -1 \\ \color{red}0 & \color{red}0 & \color{red}0 & \color{blue}1 & | & -2 \end{bmatrix} \]The solution is read directly from the final column:
\[ x = 0, \quad y = 1, \quad z = -1, \quad w = -2 \]Practice Questions with Detailed Solutions
Practice Problems & Solutions
Use the Gauss-Jordan method to solve each system of equations.
-
System 1: \( \begin{cases} x + y = -1 \\ -x + y = 5 \end{cases} \)
Solution:
Augmented matrix:
\[ \begin{bmatrix} 1 & 1 & | & -1 \\ -1 & 1 & | & 5 \end{bmatrix} \xrightarrow{R_2 + R_1} \begin{bmatrix} 1 & 1 & | & -1 \\ 0 & 2 & | & 4 \end{bmatrix} \xrightarrow{\tfrac{1}{2}R_2} \begin{bmatrix} 1 & 1 & | & -1 \\ 0 & 1 & | & 2 \end{bmatrix} \xrightarrow{R_1 - R_2} \begin{bmatrix} 1 & 0 & | & -3 \\ 0 & 1 & | & 2 \end{bmatrix} \]Solution: \((x, y) = (-3, 2)\).
-
System 2: \( \begin{cases} x + y = -2 \\ 2x + 2z = -6 \\ x + y + 2z = -4 \end{cases} \)
Solution:
Augmented matrix reduces step-by-step to RREF:
\[ \begin{bmatrix} 1 & 1 & 0 & | & -2 \\ 2 & 0 & 2 & | & -6 \\ 1 & 1 & 2 & | & -4 \end{bmatrix} \xrightarrow{R_2 - 2R_1,\; R_3 - R_1} \begin{bmatrix} 1 & 1 & 0 & | & -2 \\ 0 & -2 & 2 & | & -2 \\ 0 & 0 & 2 & | & -2 \end{bmatrix} \xrightarrow{-\tfrac{1}{2}R_2,\; \tfrac{1}{2}R_3} \begin{bmatrix} 1 & 1 & 0 & | & -2 \\ 0 & 1 & -1 & | & 1 \\ 0 & 0 & 1 & | & -1 \end{bmatrix} \] \[ \xrightarrow{R_1 - R_2,\; R_2 + R_3} \begin{bmatrix} 1 & 0 & 1 & | & -3 \\ 0 & 1 & 0 & | & 0 \\ 0 & 0 & 1 & | & -1 \end{bmatrix} \xrightarrow{R_1 - R_3} \begin{bmatrix} 1 & 0 & 0 & | & -2 \\ 0 & 1 & 0 & | & 0 \\ 0 & 0 & 1 & | & -1 \end{bmatrix} \]Solution: \((x, y, z) = (-2, 0, -1)\).
-
System 3: \( \begin{cases} x + y = -3 \\ 2x + 2y - w = -2 \\ x + z = -2 \\ x + y + z + 2w = -13 \end{cases} \)
Solution:
Starting augmented matrix:
\[ \begin{bmatrix} 1 & 1 & 0 & 0 & | & -3 \\ 2 & 2 & 0 & -1 & | & -2 \\ 1 & 0 & 1 & 0 & | & -2 \\ 1 & 1 & 1 & 2 & | & -13 \end{bmatrix} \]Applying row operations \(R_2 - 2R_1\), \(R_3 - R_1\), \(R_4 - R_1\), then further reduction leads to:
\[ \begin{bmatrix} 1 & 0 & 0 & 0 & | & 0 \\ 0 & 1 & 0 & 0 & | & -3 \\ 0 & 0 & 1 & 0 & | & -2 \\ 0 & 0 & 0 & 1 & | & -4 \end{bmatrix} \]Solution: \((x, y, z, w) = (0, -3, -2, -4)\).
Related Lessons and References
- Linear Algebra — Main Topics
- Write a Matrix in Reduced Row Echelon Form
- The Three Row Operations on Augmented Matrices
- Solve a System of Linear Equations by Elimination
- Inverse of a Matrix Using Gauss-Jordan
- Elementary Matrices and Row Operations
- Row Echelon Form (Wikipedia)
- Gaussian Elimination (Wikipedia)