Gaussian elimination is the systematic method for solving any system of linear equations. You’ll learn the three row operations, how to reduce a matrix to echelon form, and how to read off the solution.
Gaussian elimination turns a system of equations into an augmented matrix and then uses row operations to simplify it into row echelon form (or reduced row echelon form).
These are the only moves you’re allowed to make on an augmented matrix (they don’t change the solution):
Swap two rows
Multiply a row by a nonzero scalar
Add a multiple of one row to another row
Transform the augmented matrix into this staircase pattern:
[ 1 ∗ ∗ ∣ ∗ 0 1 ∗ ∣ ∗ 0 0 1 ∣ ∗ ] \begin{bmatrix} 1 & * & * & \vert & * \\ 0 & 1 & * & \vert & * \\ 0 & 0 & 1 & \vert & * \end{bmatrix} 1 0 0 ∗ 1 0 ∗ ∗ 1 ∣ ∣ ∣ ∗ ∗ ∗
From here, you can read off the solution by back-substitution. Going further to reduced row echelon form (RREF) means each pivot is 1 and all entries above and below each pivot are zero, so the solution reads directly off the matrix.
Unique solution: one value for each variable
No solution: a row like [ 0 0 0 ∣ 5 ] [0 \; 0 \; 0 \; \vert \; 5] [ 0 0 0 ∣ 5 ] (means 0 = 5 0 = 5 0 = 5 , impossible)
Infinitely many solutions: a row of zeros with free variables
Start 2 4 | 8 3 5 | 11 R1 ÷ 2 Scale R1 1 2 | 4 3 5 | 11 R2 - 3·R1 Eliminate 1 2 | 4 0 -1 | -1 -R2, then R1 - 2·R2 RREF 1 0 | 2 0 1 | 1 x = 2 y = 1
In the diagram: the augmented matrix is reduced step by step. Each arrow shows which row operation was applied. The final RREF form gives the solution directly: x = 2 x = 2 x = 2 , y = 1 y = 1 y = 1 .
Example 1: Full Row Reduction
Solve:
{ 2 x + 4 y = 8 3 x + 5 y = 11 \begin{cases} 2x + 4y = 8 \\ 3x + 5y = 11 \end{cases} { 2 x + 4 y = 8 3 x + 5 y = 11
Start with the augmented matrix:
[ 2 4 8 3 5 11 ] \left[\begin{array}{cc|c} 2 & 4 & 8 \\ 3 & 5 & 11 \end{array}\right] [ 2 3 4 5 8 11 ]
Step 1: Divide R 1 R_1 R 1 by 2:
[ 1 2 4 3 5 11 ] \left[\begin{array}{cc|c} 1 & 2 & 4 \\ 3 & 5 & 11 \end{array}\right] [ 1 3 2 5 4 11 ]
Step 2: R 2 ← R 2 − 3 R 1 R_2 \leftarrow R_2 - 3R_1 R 2 ← R 2 − 3 R 1 :
[ 1 2 4 0 − 1 − 1 ] \left[\begin{array}{cc|c} 1 & 2 & 4 \\ 0 & -1 & -1 \end{array}\right] [ 1 0 2 − 1 4 − 1 ]
Step 3: R 2 ← − R 2 R_2 \leftarrow -R_2 R 2 ← − R 2 :
[ 1 2 4 0 1 1 ] \left[\begin{array}{cc|c} 1 & 2 & 4 \\ 0 & 1 & 1 \end{array}\right] [ 1 0 2 1 4 1 ]
Step 4: R 1 ← R 1 − 2 R 2 R_1 \leftarrow R_1 - 2R_2 R 1 ← R 1 − 2 R 2 :
[ 1 0 2 0 1 1 ] \left[\begin{array}{cc|c} 1 & 0 & 2 \\ 0 & 1 & 1 \end{array}\right] [ 1 0 0 1 2 1 ]
Solution: x = 2 x = 2 x = 2 , y = 1 y = 1 y = 1 .
Example 2: No Solution
[ 1 1 3 1 1 5 ] \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 1 & 1 & 5 \end{array}\right] [ 1 1 1 1 3 5 ]
R 2 ← R 2 − R 1 R_2 \leftarrow R_2 - R_1 R 2 ← R 2 − R 1 :
[ 1 1 3 0 0 2 ] \left[\begin{array}{cc|c} 1 & 1 & 3 \\ 0 & 0 & 2 \end{array}\right] [ 1 0 1 0 3 2 ]
The bottom row says 0 = 2 0 = 2 0 = 2 , which is impossible. No solution.
Example 3: A 3x3 System
{ x + y + z = 6 2 x + 3 y + z = 14 x − y + 2 z = 2 \begin{cases} x + y + z = 6 \\ 2x + 3y + z = 14 \\ x - y + 2z = 2 \end{cases} ⎩ ⎨ ⎧ x + y + z = 6 2 x + 3 y + z = 14 x − y + 2 z = 2
Augmented matrix:
[ 1 1 1 6 2 3 1 14 1 − 1 2 2 ] \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 2 & 3 & 1 & 14 \\ 1 & -1 & 2 & 2 \end{array}\right] 1 2 1 1 3 − 1 1 1 2 6 14 2
R 2 ← R 2 − 2 R 1 R_2 \leftarrow R_2 - 2R_1 R 2 ← R 2 − 2 R 1 , R 3 ← R 3 − R 1 R_3 \leftarrow R_3 - R_1 R 3 ← R 3 − R 1 :
[ 1 1 1 6 0 1 − 1 2 0 − 2 1 − 4 ] \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 2 \\ 0 & -2 & 1 & -4 \end{array}\right] 1 0 0 1 1 − 2 1 − 1 1 6 2 − 4
R 3 ← R 3 + 2 R 2 R_3 \leftarrow R_3 + 2R_2 R 3 ← R 3 + 2 R 2 :
[ 1 1 1 6 0 1 − 1 2 0 0 − 1 0 ] \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -1 & 2 \\ 0 & 0 & -1 & 0 \end{array}\right] 1 0 0 1 1 0 1 − 1 − 1 6 2 0
Back-substitute: − z = 0 -z = 0 − z = 0 so z = 0 z = 0 z = 0 . Then y − 0 = 2 y - 0 = 2 y − 0 = 2 so y = 2 y = 2 y = 2 . Then x + 2 + 0 = 6 x + 2 + 0 = 6 x + 2 + 0 = 6 so x = 4 x = 4 x = 4 .
Solution: x = 4 x = 4 x = 4 , y = 2 y = 2 y = 2 , z = 0 z = 0 z = 0 .
Gaussian elimination (and its computer-optimized versions) is used constantly in:
Game engines: solving for bone positions in inverse kinematics, balancing physics constraints, lighting calculations
Computer graphics: solving large systems for realistic rendering
Machine learning: least squares regression
Engineering: circuit analysis, structural engineering
Example: When a game character grabs an object, inverse kinematics uses Gaussian elimination to figure out the exact joint angles needed to reach the target position. The engine sets up a system of equations and row-reduces it every frame.
You’ve Got This
Gaussian elimination is mechanical. Once you know the three row operations, it’s just a recipe: make zeros below each pivot, then clean up above. The key insight is recognizing what the final form tells you: a clean diagonal means a unique solution, a row of zeros with a nonzero constant means no solution, and extra free variables mean infinitely many solutions. Many students find this lesson satisfying once they see how cleanly it solves systems that look messy at first.
Which is NOT a valid row operation? A. Swap two rows B. Multiply a row by zero C. Add a multiple of one row to another D. Multiply a row by a nonzero scalar
In row echelon form, entries below each pivot are: A. All ones B. All zero C. All negative D. Anything
If row reduction produces a row $[0 \; 0 \; \vert \; 5]$, the system has: A. A unique solution B. Infinitely many solutions C. No solution D. Exactly two solutions
In game development, Gaussian elimination is often used for: A. Only drawing sprites B. Only texture loading C. Only scoring D. Inverse kinematics and physics constraints
RREF differs from REF in that RREF also requires: A. All pivots are 1 and all entries above pivots are 0 B. All entries are positive C. The matrix is square D. No zero rows
Retry Quiz Retrying will remove your ✅ checkmark until you pass again.