About this calculator
Simultaneous linear equations appear whenever several conditions must hold at once — forces at a joint, currents in a circuit (Kirchhoff’s laws), mixing problems. Enter the coefficients of 2 equations in x and y, or 3 equations in x, y and z. The calculator finds the unique solution if there is one; otherwise it tells you whether there is no solution (contradictory equations) or infinitely many (dependent equations).
Formula
2 equations (x, y)
a₁x + b₁y = d₁ a₂x + b₂y = d₂
det = a₁b₂ − a₂b₁ x = (d₁b₂ − d₂b₁) ÷ det y = (a₁d₂ − a₂d₁) ÷ det
(Cramer’s rule.) The calculator itself uses Gaussian elimination with partial pivoting, which gives the same answer and is more robust.
3 equations (x, y, z)
A x = d, A = 3 × 3 coefficient matrix
Gaussian elimination with partial pivoting reduces the equations step by step; a unique solution exists exactly when det(A) ≠ 0. If det(A) = 0, comparing the rank of A with the rank of [A | d] decides between no solution and infinitely many.
Worked example
- 2x + 3y = 8 and x − y = −1: det = 2 × (−1) − 1 × 3 = −5; x = (8 × (−1) − (−1) × 3) ÷ (−5) = 1, y = (2 × (−1) − 1 × 8) ÷ (−5) = 2.
- x + y + z = 6, 2x − y + 3z = 9, −x + 4y − z = 4 → x = 1, y = 2, z = 3 (det = −5).
- x + y = 2 and 2x + 2y = 5 → no solution (parallel lines).
Assumptions and limitations
- Linear equations with real coefficients.
- A pivot smaller than 10⁻¹² × n × (largest coefficient) is treated as zero, so a system that is singular only because of rounding is reported as having no unique solution.
- The check substitutes the solution back into each equation; values near 10⁻¹⁵ are normal floating-point rounding.
References
- Golub, G. H. & Van Loan, C. F. Matrix Computations — Gaussian elimination with partial pivoting.
- Kreyszig, E. Advanced Engineering Mathematics — linear systems, rank and Cramer’s rule.
