Understanding the system of linear equations solver (Gauss-Jordan) — concept and principle
This solver handles any number of linear equations in any number of unknowns. You enter the augmented matrix [A | b], one row per equation, with the coefficients of x₁, x₂, … followed by the right-hand side, and the calculator reduces it to reduced row echelon form (RREF). It reports a unique solution, "infinitely many solutions" or "no solution", together with the rank of the matrix. Such systems appear in circuit analysis, chemical equation balancing and curve fitting.
How it is calculated
Gauss-Jordan elimination applies three row operations, none of which changes the solution set:
- swap two rows;
- multiply a row by a non-zero number;
- add a multiple of one row to another row.
Working column by column, the method makes a pivot of 1 and clears every other entry in that column to 0. At the end, each pivot row reads xᵢ = value. The rank is the number of pivots.
- If a row becomes [0 0 … 0 | non-zero], the system is inconsistent: no solution.
- If the rank is smaller than the number of unknowns, at least one variable is free: infinitely many solutions.
- Otherwise there is exactly one solution.
The principle
Each row operation replaces the equations with an equivalent set: anything that solves the old system solves the new one, and the steps can be reversed. So the RREF is just the same system written in the simplest possible way. The rank counts how many equations are truly independent. A square system with full rank has an invertible A and the unique solution x = A⁻¹b.
Worked example
- Input rows: [2 1 −1 | 8], [−3 −1 2 | −11], [−2 1 2 | −3].
- R1 ÷ 2 gives [1 ½ −½ | 4]. Then R2 + 3R1 → [0 ½ ½ | 1] and R3 + 2R1 → [0 2 1 | 5].
- R2 × 2 → [0 1 1 | 2]. Then R1 − ½R2 → [1 0 −1 | 3] and R3 − 2R2 → [0 0 −1 | 1].
- R3 × (−1) → [0 0 1 | −1]. Then R1 + R3 → [1 0 0 | 2] and R2 − R3 → [0 1 0 | 3].
- Result: x1 = 2, x2 = 3, x3 = −1, rank 3. Check in row 1: 2·2 + 3 − (−1) = 8.
How to read the result
Rank equal to the number of unknowns means every variable is pinned down. A lower rank means some equations are combinations of others.
Common mistakes
- Forgetting the right-hand side, so each row has one number too few.
- Leaving out a zero coefficient when a variable is missing from an equation; write 0 in its place.
- Mixing up row and column order.
Frequently asked questions
What is the difference between Gaussian and Gauss-Jordan elimination?
Gaussian elimination stops at row echelon form and finishes by back-substitution; Gauss-Jordan continues until every pivot column is clear above and below.
Can there be more equations than unknowns?
Yes. The system is solvable only if the extra equations are consistent; otherwise the solver reports no solution.
What does the rank tell me?
It is the number of independent equations.
Sources: G. Strang, Introduction to Linear Algebra, Wellesley-Cambridge Press · G. H. Golub and C. F. Van Loan, Matrix Computations, Johns Hopkins University Press