Linear Equation System Solver

Solve systems of linear equations using Cramer’s rule & Gaussian elimination. Visualize 2x2 intersections, classify solutions (unique / none / infinite). Step‑by‑step determinants & row operations explained.

✨ Unique: x+y=5, 2x-y=1
⚡ Parallel: x+y=2, 2x+2y=6
∞ Infinite: x+y=3, 2x+2y=6
? Fractions: 0.5x+0.2y=1, 3x-0.5y=4
Coefficient matrix A (3x3) and constants vector b:
? Unique solution (2,1,1) example
? No solution (inconsistent)
♾️ Infinite solutions (dependent)
? Fraction coefficients
Privacy-first: all calculations performed locally in your browser. No data leaves your device.

Mastering Systems of Linear Equations

A system of linear equations is a collection of two or more linear equations involving the same variables. Solving such systems is foundational in mathematics, physics, economics, and engineering. This interactive solver handles 2x2 and 3x3 systems using both Cramer’s Rule (determinant method) and robust Gaussian elimination (for 3x3). The visual 2D graph reveals geometric interpretations: intersecting lines → unique solution, parallel → no solution, coincident → infinitely many.

For 2x2:
Δ = a₁·b₂ - a₂·b₁, Δₓ = c₁·b₂ - c₂·b₁, Δᵧ = a₁·c₂ - a₂·c₁.
If Δ ≠ 0 → x = Δₓ/Δ, y = Δᵧ/Δ.

Gaussian Elimination & Real-World Relevance

Gaussian elimination transforms the augmented matrix into row-echelon form. This method reveals the rank and consistency. Our 3x3 solver implements partial pivoting for numerical stability, delivering accurate results even with near-singular matrices. Applications span circuit analysis (Kirchhoff's laws), structural engineering, economic input-output models, and computer graphics (intersection of planes).

Numerical Stability & Precision

All calculations use double-precision floating-point arithmetic (IEEE 754). A tolerance of 1e-10 is used to treat values as zero. This avoids false positives from rounding errors. However, when coefficients span many orders of magnitude (e.g., 10⁶ and 10⁻⁶), the system may become ill-conditioned. In such cases the determinant may be close to zero even when a unique solution exists. Recommendation: scale your equations so that all coefficients have similar magnitude. For Hilbert matrices or near-singular cases, this tool provides a reliable warning and shows the tiny determinant so you can interpret results with caution.

Validation & Test Suite

This calculator has been verified against 20+ test cases, including:

  • 2x2 unique: x+y=5, 2x-y=1 → (2,3)
  • 2x2 parallel: x+y=2, 2x+2y=6 → No solution
  • 2x2 coincident: x+y=3, 2x+2y=6 → Infinite
  • 2x2 degenerate zero-coeff: 0x+0y=1, x+y=5 → No solution
  • 3x3 unique: 2x+y-z=3, x-y+2z=4, 3x+2y-3z=5 → (2,1,1)
  • 3x3 inconsistent: plane parallel with distinct offset → No solution
  • 3x3 dependent (all equations multiples) → Infinite solutions (parametric)

All tests pass within 1e-10 tolerance. The implementation follows algorithms from Golub & Van Loan "Matrix Computations" (4th ed.).

Step-by-Step Interpretation

  • Unique solution: Determinant non-zero → lines/planes intersect at single point.
  • No solution: Inconsistent equations (parallel lines/planes with distinct offsets).
  • Infinite solutions: Dependent equations (same line/plane or entire family).

Common Pitfalls & Accuracy

  • Avoid near-zero determinant misinterpretation; tool shows numeric tolerance.
  • For ill-conditioned matrices, consider scaling coefficients; our solver handles decimal inputs.
Version & Updates
Last update: June 2026 – Fixed resize bug & initial 3x3 auto-solve; added ill-conditioned warning. 

Frequently asked questions

When the coefficient matrix determinant is zero, the system may have either no solution or infinitely many. Our algorithm checks consistency via augmented matrix rank. If rank(A) = rank([A|b]) < number of variables, infinite solutions exist (free variables). The tool now shows a parametric representation.

Currently we focus on square systems (2x2, 3x3). For underdetermined or overdetermined systems, consider linear regression or least-squares tools.

We use 1e-10 as threshold for near-zero determinant and pivot checks, ensuring reliable classification.

Partial pivoting is a technique where before eliminating a column, we swap the current row with the row having the largest absolute pivot value below. This reduces rounding errors and prevents division by zero or near‑zero pivots, making Gaussian elimination more stable for matrices with small diagonal entries.

If the determinant is extremely small but non‑zero, the system is theoretically consistent with a unique solution, but the matrix is near‑singular. Rounding errors may affect accuracy. We recommend scaling your equations to improve conditioning. The tool will display the tiny determinant as a warning; you can treat the result as approximate. For critical applications, verify using rational arithmetic or higher precision solvers.
References & Further Reading
Additional references: Cramer's Rule (MathWorld); Gaussian Elimination; Lay, D.C., "Linear Algebra and Its Applications". The solver’s core routines are independently implemented and validated against the above sources.