Linear system solver
Solve a square linear system using exact fractions, with ranks, reduced row-echelon form and a residual, distinguishing unique solutions, infinitely many solutions and inconsistency.
How to use
Choose the number of equations and unknowns. Enter each equation’s coefficients in a row of A and its right-hand side in the corresponding row of b. Calculate, then inspect the status, rank of A, rank of [A|b] and reduced row-echelon form. Infinitely many solutions are represented by a particular solution plus free multiples of basis directions. Copy the complete report or download TXT.
A=[[2,1],[1,−1]] and b=[5,1] represent 2x₁+x₂=5 and x₁−x₂=1. The solution is x=[2,1], both ranks are 2, and A×x−b=[0,0]. With A=[[1,2],[2,4]] and b=[3,6], infinitely many solutions exist; changing b to [3,7] makes the system inconsistent.
Support & limits
Row reduction uses exact reduced fractions rather than approximate decimal arithmetic or a numerical tolerance. The residual is computed from the original A and the solution; for infinite solutions it belongs to the particular solution, and A multiplied by every free direction is also checked to be zero. Free-variable numbering starts at 1. An inconsistent system has no solution or displayed residual. Resizing hides out-of-range cells without including them in calculation or erasing their values; their rejection states return when shown again.
Common questions
Does a singular coefficient matrix always mean there is no solution?
No. When rank([A|b]) exceeds rank(A), there is no solution. If the ranks agree but are below the number of unknowns, infinitely many solutions exist. If both equal the number of unknowns, the solution is unique. The tool does not replace an inconsistent system with a least-squares approximation.
Related tools
Fraction calculator
Add, subtract, multiply or divide fractions with exact integer arithmetic, an intermediate fraction and its greatest common divisor.
Linear and quadratic equation solver
Solve a linear or quadratic equation from exact numeric coefficients, distinguishing real and complex roots, identities and equations with no solution.
Matrix calculator
Add, subtract or multiply matrices, or calculate a transpose, determinant, inverse or rank using exact fractions within bounded dimensions.