Gaussian Elimination Calculator
Solve a linear system by row reduction and back substitution.
What it does
Gaussian elimination solves a system of linear equations by turning its augmented matrix into row echelon form. The procedure uses elementary row operations: swapping two rows, multiplying a row by a nonzero number, and adding a multiple of one row to another.
MIT OpenCourseWare describes the method as a sequence of elementary row operations that lead to a reduced system with the same solutions. Cornell's matrix algebra notes give the same four steps: write the augmented matrix, use row operations to reach row echelon form, rewrite the system, then use back substitution.
Forward elimination clears the entries below each pivot. The pivot is the first nonzero entry in the current row. Once every pivot is in place, the last equation contains only one unknown, so it can be solved first, and the earlier rows follow in reverse order.
This tool carries out those steps for a 2 by 2 or 3 by 3 system. It shows the multiplier used for each row operation, the final pivots and the solution. If a pivot is zero, it tries one row swap before reporting that the system is singular.
Elimination is the standard direct method for small dense systems. For very large or sparse systems, specialised iterative or factorisation methods are usually faster.
How to use
- Write each equation with the unknowns in the same order, x then y then z.
- Choose the system size and enter the coefficients in the matching rows.
- Enter the number on the right side of each equation.
- Read x, y and z in the main results. A dash in z means a 2 by 2 system.
- Check the pivots, which are the diagonal entries after elimination.
- Open the row operations note to see each multiplier used.
Formula
- A
- The augmented coefficient matrix, with the right side as the last column.
- pivot
- The first nonzero entry of the current row after earlier eliminations.
- factor
- The multiplier that zeros one entry below a pivot.
- back substitution
- Solving the last equation first, then moving upward.
The engine looks for a row to swap when a pivot is zero. If no row below has a nonzero entry in that column, the matrix is singular and the tool reports that there is no unique solution. Entries are limited to 1e9 in magnitude.
Worked example
Example: 2x + y = 5 and x + 3y = 11
Enter row 1 as 2, 1, right side 5 and row 2 as 1, 3, right side 11.
- The augmented matrix starts as [[2, 1, 5], [1, 3, 11]].
- The first pivot is 2. The multiplier for row 2 is 1/2 = 0.5.
- Row 2 becomes [1, 3, 11] - 0.5 x [2, 1, 5] = [0, 2.5, 8.5].
- The pivots are 2.0000 and 2.5000.
- Back substitution gives y = 8.5 / 2.5 = 3.400000.
- Then x = (5 - 1 x 3.4) / 2 = 0.800000.
- The row operations note reads R2 = R2 - 0.5000 R1.
Reference table
| Stage | Row 1 | Row 2 |
|---|---|---|
| Start | [2, 1, 5] | [1, 3, 11] |
| After eliminating below pivot 1 | [2, 1, 5] | [0, 2.5, 8.5] |
| Solution | x = 0.800000 | y = 3.400000 |
Limits
- Only 2 by 2 and 3 by 3 systems are supported.
- A singular system produces an error instead of infinitely many answers.
- Pivoting is limited to one swap choice per column.
- Results are floating point estimates shown to six decimal places.
Common mistakes
- Putting the right side values into the coefficient columns.
- Using a different order of unknowns in different rows.
- Assuming any zero pivot means the system has no solution at all, when a row swap may fix it.
- Rounding the multiplier before applying it to the row.
- Forgetting to divide by the pivot during back substitution.
Try it yourself
Quick checks. Answers sit tucked under each question.
Solve 2x + y = 5 and x + 3y = 11.
x = 0.8 and y = 3.4. The row operation is R2 = R2 - 0.5 R1 and the pivots are 2 and 2.5.
What is the multiplier for row 2 when the pivot is 2 and the entry below it is 1?
0.5. The row operation subtracts 0.5 times the pivot row from row 2.
What happens if both entries in a pivot column are zero?
The tool reports a singular system, because there is no unique solution.
Questions
What is Gaussian elimination?
A step by step method that uses row operations to reduce a linear system to triangular form and then solves it by back substitution.
Why are row operations allowed?
Each operation produces a new system with exactly the same solution set, so reducing the matrix does not lose information.
What is a pivot?
The first nonzero entry in a row after earlier eliminations. It is used as the divisor when clearing the column below it.
How is this different from Cramer's rule?
Cramer's rule uses determinants, while elimination uses row operations. Elimination is faster for larger systems.
What if a pivot is zero?
The tool looks for a nonzero entry below and swaps rows. Without one, the system has no unique solution.
Does the tool show every step?
It shows the multiplier and row label for each elimination step, plus the final pivots.
Sources
- MIT OpenCourseWare, 18.700 Linear Algebra: Gaussian Elimination
- Cornell University, Math 023 Matrix Algebra notes