🧮
🧮 Math & statistics

System of Equations Solver (2 variables)

Results update as you type.

Your numbers

Understanding the 2 × 2 system of equations solver — concept and principle

A system of two linear equations in two unknowns, a₁x + b₁y = c₁ and a₂x + b₂y = c₂, asks for the pair (x, y) that satisfies both equations at the same time. Geometrically each equation is a straight line, and the solution is the point where the lines cross. Such systems come up in mixture and pricing problems, break-even comparisons, supply and demand, and any situation with two unknown amounts linked by two conditions.

Two-variable system solved by Cramer's rule2x + 3y = 8 and x − y = −1 cross at (1, 2); D = −5, so x = −5 ÷ −5 = 1 and y = −10 ÷ −5 = 2.Two lines meet at (1, 2)(1, 2)2x + 3y = 8x − y = −1Solutionx = 1y = 2Cramer's ruleD = 2·(−1) − 3·1 = −5x = (8·(−1) − 3·(−1)) ÷ D = −5 ÷ −5 = 1y = (2·(−1) − 8·1) ÷ D = −10 ÷ −5 = 2
The solution is the crossing point of the two lines; Cramer’s rule finds it with three determinants.

How it is calculated

The solver uses Cramer's rule:

If D = 0 the calculator reports "no unique solution". The numerators are themselves determinants: replace the x-column (for x) or the y-column (for y) of the coefficient matrix with the right-hand sides c₁, c₂.

The principle

Eliminate y: multiply the first equation by b₂ and the second by b₁ and subtract. The y terms cancel and you get (a₁b₂ − b₁a₂)x = c₁b₂ − b₁c₂, which is exactly Cramer's formula for x; eliminating x in the same way gives y. The determinant D measures whether the two lines have different slopes. If D ≠ 0 they cross at exactly one point. If D = 0 the lines are parallel (no solution) or identical (infinitely many solutions). Geometrically, |D| is the area of the parallelogram spanned by the coefficient columns, and a zero area means the columns point in the same direction.

Worked example

  1. Inputs: 2x + 3y = 8 and x − y = −1 (a₁ = 2, b₁ = 3, c₁ = 8, a₂ = 1, b₂ = −1, c₂ = −1).
  2. D = 2 × (−1) − 3 × 1 = −2 − 3 = −5.
  3. x numerator = 8 × (−1) − 3 × (−1) = −8 + 3 = −5, so x = −5 ÷ −5 = 1.
  4. y numerator = 2 × (−1) − 8 × 1 = −2 − 8 = −10, so y = −10 ÷ −5 = 2.
  5. Result: x = 1, y = 2. Check: 2 + 6 = 8 and 1 − 2 = −1.

How to read the result

Substitute the pair into both original equations; both must hold. The sign of D has no meaning for the solution itself, but its size does: when |D| is very small compared with the coefficients, the lines are nearly parallel and the solution is very sensitive to small changes or rounding in the inputs (an ill-conditioned system).

Common mistakes

Keep in mind: "No unique solution" covers two different cases, no solution and infinitely many; check whether one equation is a multiple of the other to tell them apart.

Frequently asked questions

How do I know whether there is no solution or infinitely many when D = 0?

If the right-hand sides scale the same way as the coefficients (for example x + y = 2 and 2x + 2y = 4), the lines coincide and there are infinitely many solutions; otherwise there is none.

Is Cramer's rule better than substitution?

For 2 × 2 systems it is quick and gives a formula. For larger systems, elimination (Gauss-Jordan) is far more efficient.

Can I use it for three unknowns?

Yes, with 3 × 3 determinants, but a general n × n solver is more practical.

Sources: G. Cramer, Introduction à l'analyse des lignes courbes algébriques, Geneva, 1750 · G. Strang, Introduction to Linear Algebra, Wellesley-Cambridge Press

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →