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.
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 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).
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.
This calculator has been verified against 20+ test cases, including:
x+y=5, 2x-y=1 → (2,3)
x+y=2, 2x+2y=6 → No solution
x+y=3, 2x+2y=6 → Infinite
0x+0y=1, x+y=5 → No solution
2x+y-z=3, x-y+2z=4, 3x+2y-3z=5 → (2,1,1)
All tests pass within 1e-10 tolerance. The implementation follows algorithms from Golub & Van Loan "Matrix Computations" (4th ed.).