Linear Equation Solver (2×2)

Solve for x and y in a 2×2 system.

How it is calculated

The tool solves two equations a1x + b1y = c1 and a2x + b2y = c2 with Cramer's rule. First it computes the determinant D = a1b2 − a2b1. Then x = (c1b2 − c2b1) / D and y = (a1c2 − a2c1) / D. All six numbers must be entered; a missing one gives no result. If D = 0 the lines are parallel or identical, so there is no single solution and the tool returns nothing. Answers are rounded to two decimals.

Worked example

Solve 2x + 3y = 13 and x − y = −1. Here a1=2, b1=3, c1=13, a2=1, b2=−1, c2=−1. D = 2·(−1) − 1·3 = −5. For x: (13·(−1) − (−1)·3) / −5 = −10 / −5 = 2. For y: (2·(−1) − 1·13) / −5 = −15 / −5 = 3. The solution is x = 2.00 and y = 3.00. Check: 2·2 + 3·3 = 13 and 2 − 3 = −1.

Try this example →

Common mistakes

  • Writing the equation in a different form, such as 2x + 3y − 13 = 0, and entering −13 as c. The constant must be on the right side: c = 13.
  • Dropping a sign, especially when a coefficient is negative, as with the −y term.
  • Leaving a field empty when a variable is missing from an equation; every field needs a value, so enter 0 for the absent term.
  • Expecting an answer for dependent equations such as x + y = 2 and 2x + 2y = 4; D is 0 and there are infinitely many solutions.
  • Swapping the x and y coefficients between the two equations.

About this calculator

This solver finds x and y for a system of two linear equations in two unknowns, using elimination/substitution logic equivalent to Cramer's rule with determinants, and flags the system as having no solution (parallel lines) or infinite solutions (identical lines) when that's the case.

It's used by students checking algebra homework, and by anyone solving a real-world two-variable problem that reduces to simultaneous equations, like finding a break-even point, mixing two solutions to a target concentration, or balancing a simple budget with two constraints.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    Each equation has to be written as ax + by = c, so move every term to the left and the constant to the right before typing. When the two lines are parallel or the same line, the determinant is zero and no answer appears; the tool cannot tell you which of the two cases you have. Before relying on the result, substitute x and y back into both original equations. Would you like a version for three unknowns?

Popular calculators

All Calculators