Everyday Calculators › Linear equation solver › Worked guide

Two linear equations in two variables

A solution is one pair of values, x and y, that satisfies both equations at once. For a system with a unique solution, Cramer’s rule gives those values directly from the six coefficients.

Open the two-equation solver → Enter six coefficients and get x and y instantly.

Write both equations in standard form

Use a₁x + b₁y = c₁ and a₂x + b₂y = c₂. Move constant terms to the right and keep their signs. A missing x or y term has coefficient 0; a term such as −y has coefficient −1.

The calculator accepts these six numerical coefficients and uses Cramer’s rule. It does not parse a typed equation or offer separate substitution, elimination or graphing modes.

Calculate the determinant and the two unknowns

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

Use the division formulas only when D is nonzero. Geometrically, two nonparallel lines intersect at the solution (x, y).

Worked example: 2x + y = 7 and x − y = 2

For the first equation, a₁ = 2, b₁ = 1 and c₁ = 7. For the second, a₂ = 1, b₂ = −1 and c₂ = 2.

  1. Determinant: D = 2 × (−1) − 1 × 1 = −3.
  2. Find x: (7 × (−1) − 2 × 1) ÷ (−3) = (−9) ÷ (−3) = 3.
  3. Find y: (2 × 2 − 1 × 7) ÷ (−3) = (−3) ÷ (−3) = 1.

Check both equations: 2 × 3 + 1 = 7 and 3 − 1 = 2. Both are true, so the solution is x = 3, y = 1. Enter the six coefficients above in the linear-system calculator to reproduce the result; its built-in default example is a different system.

Example with rearrangement: y = 2x + 1 and x + y = 7

Move 2x to the left in the first equation: −2x + y = 1. The second equation is already in standard form. Enter −2, 1, 1 for Eq. 1 and 1, 1, 7 for Eq. 2.

  1. D = (−2) × 1 − 1 × 1 = −3.
  2. x = (1 × 1 − 7 × 1) ÷ (−3) = 2.
  3. y = ((−2) × 7 − 1 × 1) ÷ (−3) = 5.

Check the original equations, before rearrangement: 5 = 2 × 2 + 1 and 2 + 5 = 7. The pair x = 2, y = 5 satisfies both. Reordering terms changes the coefficients you enter, not the solution.

Solve your own system with the calculator

  1. Rewrite each equation in standard form, a x + b y = c.
  2. Open the two-equation solver and enter Eq. 1: the x coefficient a₁, the y coefficient b₁ and the constant c₁.
  3. Enter Eq. 2 the same way: a₂, b₂ and c₂. Type 0 for a missing term and −1 for a term such as −y.
  4. Read x and y, then substitute both values into each original equation to confirm them.

For the worked example above, enter 2, 1, 7 for Eq. 1 and 1, −1, 2 for Eq. 2; the solver returns x = 3 and y = 1.

The six fields accept numerical coefficients, not expressions such as 2x or a complete equation. A decimal coefficient can be entered as a number, for example 0.5. For a fractional coefficient such as 1/2, enter 0.5 or multiply every term in that equation by 2 first. Do not change just one coefficient.

What if the determinant is zero?

For ordinary systems, compare the proportionality of the coefficients and constants instead of dividing by zero. The calculator uses a numerical tolerance of 10⁻¹² for determinant and dependency checks, so extremely small or poorly scaled coefficients can affect its classification; it rounds displayed answers to at most six decimal places.

Avoid common coefficient mistakes

Keep the minus sign in x − y = 2: its y coefficient is −1, not 1. If an equation is 2x + y − 7 = 0, rewrite it as 2x + y = 7. Always substitute the final pair into both original equations, not just one.

This worked example applies the same determinant formulas as the calculator’s existing guide; no new solving method or calculation behavior is introduced.

Solve your two linear equations →