Simultaneous equations solver

Solve two linear equations with two unknowns, x and y, using Cramer's rule.

Enter your values and press Calculate. Your inputs stay in the address, so you can switch language or share the link.

Formula

a₁x + b₁y = c₁, a₂x + b₂y = c₂ → x = (c₁b₂ − c₂b₁) ÷ D, y = (a₁c₂ − a₂c₁) ÷ D, D = a₁b₂ − a₂b₁

How it works

Each equation has the form a·x + b·y = c. Cramer's rule divides a determinant built from the c-values by the determinant of the coefficients to find each unknown directly.

Worked example

The same calculation with the default values:

  • a₁ (equation 1) 2
  • b₁ (equation 1) 1
  • c₁ (equation 1) 8
  • a₂ (equation 2) 1
  • b₂ (equation 2) -1
  • c₂ (equation 2) 1
  1. D = 2 × -1 − 1 × 1 = -3
  2. x = (8 × -1 − 1 × 1) ÷ -3 = 3
  3. y = (2 × 1 − 1 × 8) ÷ -3 = 2

Result: x: 3 · y: 2

If the two equations describe the same line there are infinitely many solutions; if they are parallel but different, there is none.

Common mistakes

  • Forgetting to check the determinant D before trusting the result - when D = 0, the two lines are parallel (no solution) or identical (infinite solutions), and the x/y formulas become meaningless division by zero.
  • Mixing up which coefficient belongs to which equation when entering values - a₁,b₁,c₁ must all come from the first equation and a₂,b₂,c₂ from the second, not mixed between them.
  • Assuming a solution always exists - two real-world constraints can be contradictory (no solution) or redundant (infinitely many), not just a single intersection point.

Related calculators