Linear Systems Solvers
Choose a solver below
Solving Systems
Decompositions
Vector Spaces
Need Help?
Check the educational content below each solver for detailed explanations.
View all tutorials →Gaussian Elimination Calculator: Solve Linear Systems Step-by-Step
Gaussian elimination (also known as row reduction) is a method for solving systems of linear equations. It transforms the system's augmented matrix into row echelon form (REF) using elementary row operations, making it easy to find solutions through back-substitution.
Calculator
Enter your matrix below and click "Calculate" to see the step-by-step solution.
1/2 or decimals like 0.5. The last column (b) is the constants.
Learn About Gaussian_Elimination
Understanding the concepts behind the calculations.
📑 Quick Navigation
- What is Gaussian Elimination?
- The Three Elementary Row Operations
- Row Echelon Form vs Reduced Row Echelon Form
- Step-by-Step Algorithm
- Types of Solutions
- Solving Systems: Complete Examples
- Special Cases and Edge Conditions
- Real-World Applications
- Computational Complexity
- Common Mistakes to Avoid
- Frequently Asked Questions
- Practice Problems
- Related Topics
What is Gaussian Elimination?
Definition
Gaussian elimination (also called row reduction) is a systematic algorithm for solving systems of linear equations. Named after the mathematician Carl Friedrich Gauss, this method transforms a system into an equivalent but simpler form using elementary row operations.
The Core Idea
Any system of linear equations can be written as an augmented matrix. Instead of writing them horizontally, we stack them vertically:
Gaussian elimination transforms this matrix into Row Echelon Form (REF), where:
- All zero rows are at the bottom.
- The leading coefficient (pivot) of each non-zero row is strictly to the right of the pivot above it.
- All entries below a pivot are zero.
The Three Elementary Row Operations
These operations preserve the solution set of the system (they do not change the answers):
1. Row Swap (Interchange)
Swap any two rows: R_i ↔ R_j
Example:
2. Row Scaling (Multiplication)
Multiply a row by a non-zero constant k: R_i ← k · R_i, k ≠ 0
Example:
3. Row Addition (Replacement)
Add a multiple of one row to another: R_i ← R_i + k·R_j
Example:
Row Echelon Form vs Reduced Row Echelon Form
Row Echelon Form (REF)
Conditions:
- All zero rows are at the bottom.
- Leading coefficient (pivot) is strictly to the right of the pivot above.
- All entries below a pivot are zero.
Reduced Row Echelon Form (RREF)
Additional Conditions:
- Each pivot is 1.
- All entries above and below each pivot are zero.
Which One to Use?
| Method | Stops At | Best For | Back-substitution? |
|---|---|---|---|
| Gaussian Elimination | REF | Solving systems efficiently | Yes (required) |
| Gauss-Jordan Elimination | RREF | Finding inverses, theoretical clarity | No |
Step-by-Step Algorithm
Forward Elimination (Creating REF)
- Start with the leftmost column.
- Find a pivot (non-zero entry) in this column. If the current row has a zero, swap with a row below that has a non-zero entry.
- Eliminate all entries below the pivot using row addition
(Rᵢ ← Rᵢ - k·Rₚᵢᵥₒₜ). - Move to the next row and next column. Repeat until no more rows or columns remain.
Back-Substitution (Solving from REF)
- Start from the last non-zero row.
- Solve for the pivot variable.
- Substitute this value into the row above.
- Repeat upwards until all variables are found.
Types of Solutions
1. Unique Solution (Consistent, Full Rank)
Characteristics: Number of pivots = number of variables. No free variables. Exactly one solution exists.
2. No Solution (Inconsistent)
Characteristics: A row of the form [0 0 ... 0 | c] where c ≠ 0. This represents the impossible equation 0 = c.
Last row implies 0 = 5, which is impossible.
3. Infinite Solutions (Underdetermined)
Characteristics: Number of pivots < number of variables. Free variables exist (columns without pivots).
Variables corresponding to columns 3 and 4 are free.
Solving Systems: Complete Examples
Example 1: 2×2 System (Unique Solution)
System:
Step 1: Augmented Matrix
Step 2: Eliminate below pivot (Col 1)R₂ ← R₂ - 2R₁
Step 3: Back-Substitution
- From Row 2:
-7y = -14 → y = 2 - From Row 1:
2x + 3(2) = 8 → 2x = 2 → x = 1
x = 1, y = 2Example 2: 2×2 System (No Solution)
System:
Step 1: Augmented Matrix
Step 2: EliminateR₂ ← R₂ - 2R₁
0 = -1, which is a contradiction. No solution.Example 3: 3×3 System (Unique Solution)
System:
Step 1: Augmented Matrix
Step 2: Eliminate Column 1R₂ ← R₂ - 2R₁ and R₃ ← R₃ - R₁
Step 3: Eliminate Column 2R₃ ← R₃ + (1/3)R₂
Step 4: Back-Substitution
z = -6 / (-7/3) = 18/7-3y - 18/7 = -9 → y = 15/7x + 15/7 + 18/7 = 6 → x = 9/7
x = 9/7, y = 15/7, z = 18/7Example 4: 3×4 System (Infinite Solutions)
System:
Step 1: Augmented Matrix
Step 2: Eliminate Column 1 & 2
Step 3: Interpret
- Pivots in Column 1 (
x) and Column 2 (y). - Free variables:
zandw. Letz = s,w = t.
Special Cases and Edge Conditions
Case 1: Zero Pivot
If the pivot position is 0, you must swap rows with a row below that has a non-zero entry in that column. If no such row exists, move to the next column (this creates a free variable).
Case 2: Singular Matrix
A square matrix is singular if its determinant is 0. During elimination, this manifests as a row of zeros in the coefficient matrix.
- If the augmented part is also 0: Infinite solutions
- If the augmented part is non-zero: No solution
Case 3: Ill-Conditioned Systems
Small changes in input lead to large changes in output.
Example:
This system is sensitive to rounding errors. Using exact fractions (as our calculator does) avoids this issue.
Real-World Applications
🔧 Engineering: Structural Analysis
Calculating forces in truss bridges. Each joint creates equilibrium equations (∑F_x = 0, ∑F_y = 0), forming a large linear system solved by elimination.
⚡ Electrical Engineering: Circuit Analysis
Using Kirchhoff's Laws (KVL/KCL) to find currents in complex circuits. Each loop or node generates a linear equation.
📊 Statistics: Linear Regression
Finding the best-fit line y = mx + b involves solving the "Normal Equations," which are derived using linear algebra techniques rooted in elimination.
💰 Economics: Input-Output Models
The Leontief Input-Output model uses linear systems to predict how changes in demand for one industry affect production levels in all other industries.
🔬 Chemistry: Balancing Equations
Balancing chemical reactions (e.g., C₂H₆ + O₂ → CO₂ + H₂O) is essentially solving a homogeneous linear system for the stoichiometric coefficients.
Computational Complexity
| Matrix Size (n × n) | Approximate Operations |
|---|---|
| 2×2 | ~8 |
| 3×3 | ~30 |
| 10×10 | ~720 |
| 100×100 | ~666,000 |
| n × n | ≈ (2/3)n³ |
Note: Gaussian elimination is O(n³). For very large systems (n > 10,000), iterative methods are preferred. Our calculator handles up to 6×6 instantly with exact arithmetic.
Common Mistakes to Avoid
- Forgetting the Augmented Column: Always carry the right-hand side values through every row operation.
- Sign Errors: Be careful when subtracting rows.
R₂ - 3R₁means subtracting every element. - Dividing by Zero: Never scale a row by 0.
- Stopping Early: Ensure all entries below the pivot are zero before moving to the next column.
- Misidentifying Free Variables: Only columns without pivots correspond to free variables.
Frequently Asked Questions
Q: What is the difference between Gaussian and Gauss-Jordan elimination?
A: Gaussian elimination stops at Row Echelon Form (REF) and requires back-substitution. Gauss-Jordan continues to Reduced Row Echelon Form (RREF), where the solution is visible directly without back-substitution.
Q: Can I use Gaussian elimination for non-square matrices?
A: Yes! It works for any m × n system. It will determine if the system is consistent and identify free variables if n > m.
Q: What is a pivot?
A: The first non-zero entry in a row after elimination. Pivots determine the rank of the matrix and the basic variables.
Q: Why do we need row swaps?
A: To avoid dividing by zero. If a pivot position is 0, we swap with a row below that has a non-zero entry. This is called pivoting.
Q: How do I know if a system has infinite solutions?
A: If you get a row of all zeros (0 = 0) AND there are fewer pivots than variables, the system has infinite solutions.
Practice Problems
Beginner
-
Solve:
$$ \begin{cases} 2x + y = 5 \\\\ x - y = 1 \end{cases} $$ -
Determine if consistent:
$$ \begin{cases} x + 2y = 3 \\\\ 2x + 4y = 7 \end{cases} $$
Intermediate
-
Solve:
$$ \begin{cases} x + 2y - z = 4 \\\\ 2x - y + 3z = 7 \\\\ -x + y + 2z = 3 \end{cases} $$ -
Find the general solution:
$$ \begin{cases} x + y + z = 3 \\\\ 2x + 2y + 2z = 6 \end{cases} $$
Advanced
-
For what value of
kdoes this system have no solution?$$ \begin{cases} x + 2y = 3 \\\\ 2x + ky = 6 \end{cases} $$
Click to reveal solutions
1. x = 2, y = 1
2. No solution (Row 2 becomes 0 = 1)
3. x = 1, y = 2, z = 1
4. x = 3 - t, y = t, z = 0 (t free)
5. k = 4
Summary
Key Takeaways
- Goal: Transform augmented matrix to Row Echelon Form (REF).
- Operations: Swap, Scale, Add rows.
- Unique Solution: n pivots for n variables.
- No Solution: Row like
[0 ... 0 | c]withc ≠ 0. - Infinite Solutions: Fewer pivots than variables (free variables exist).
When to Use This Calculator
- ✅ Solving small to medium systems (up to 6×6).
- ✅ Learning the step-by-step algorithm.
- ✅ Checking homework with exact fraction arithmetic.
- ❌ Very large systems (>1000 variables) → Use numerical software.
Try It Yourself!
Use the calculator above to master Gaussian elimination:
- Enter your system as an augmented matrix.
- Click "Calculate" to see complete step-by-step elimination.
- Study each operation to understand how the matrix transforms.
Test these systems:
- Unique:
2x + y = 5, x - y = 1 - No Solution:
x + y = 2, x + y = 3 - Infinite:
x + y = 2, 2x + 2y = 4
Pro Tip: Use fractions (e.g., 1/2) for exact arithmetic. Avoid decimals to prevent rounding errors!