InfyCalculator
➗

System of Two Linear Equations Solver (2×2) with steps

Solve a 2×2 system a₁x + b₁y = c₁ and a₂x + b₂y = c₂ for x and y, with exact fractions, the determinant, the type of system (one, none or infinitely many solutions), a graph of both lines and steps by Cramer’s rule, elimination or substitution.

a₁ (x in eq. 1)
b₁ (y in eq. 1)
c₁ (right side, eq. 1)
a₂ (x in eq. 2)
b₂ (y in eq. 2)
c₂ (right side, eq. 2)
Show steps using
Loading calculator…

How it works

D = a₁b₂ − a₂b₁ · Dx = c₁b₂ − c₂b₁ · Dy = a₁c₂ − a₂c₁ · x = Dx ÷ D · y = Dy ÷ D · D = 0: no solution (parallel) or infinitely many (same line)

A system of two linear equations describes two straight lines; solving it finds the point where they cross. The calculator uses Cramer’s rule: it computes the main determinant D = a₁b₂ − a₂b₁ and the two replaced determinants Dx and Dy, then x = Dx ÷ D and y = Dy ÷ D. It works in exact integer arithmetic, so answers such as 3/7 come out as fractions with their decimal value. When D = 0 the lines have the same slope. If Dx and Dy are also 0 the equations describe the same line (infinitely many solutions, a dependent system); otherwise the lines are parallel and there is no solution (an inconsistent system). You can show the working by Cramer’s rule, by elimination (scale the equations so one variable cancels) or by substitution (solve one equation for y and put it into the other). Every answer is checked by substituting it back, and a graph shows both lines meeting at the solution.

Worked example

For 2x + y = 5 and x − 3y = −8: D = (2)(−3) − (1)(1) = −7, Dx = (5)(−3) − (−8)(1) = −7 and Dy = (2)(−8) − (1)(5) = −21. So x = −7 ÷ −7 = 1 and y = −21 ÷ −7 = 3. Check: 2(1) + 1(3) = 5 and 1(1) − 3(3) = −8. The lines y = −2x + 5 and y = 0.333333x + 2.666667 cross at (1, 3).

Sources: Math is Fun: Systems of linear equations (worked examples and the three cases)

Frequently asked questions

What does a zero determinant mean?

When a₁b₂ − a₂b₁ = 0 the two lines have the same slope. They are either parallel and never meet (no solution) or the same line (infinitely many solutions). For example 2x − y = 4 and 6x − 3y = 3 have no solution, while 2x − y = 4 and 6x − 3y = 12 are the same line.

Is Cramer’s rule the same as elimination?

They give the same answer for a solvable system. Elimination adds or subtracts scaled equations to remove a variable; Cramer’s rule packages the whole process into determinant ratios. Cramer’s rule is tidy for 2×2 and 3×3 systems but slow for large ones, where elimination is preferred.

How do I solve a system by substitution?

Solve one equation for one variable, for example y = 5 − 2x from 2x + y = 5, and put that expression into the other equation. That leaves one equation in x. Solve it, then substitute x back to find y.

Can the coefficients be decimals, fractions or negatives?

Yes. Any real numbers work, including negatives and decimals with up to 6 decimal places. Enter a fraction such as 1/3 as a decimal; the answer is still shown as an exact fraction when it is not a whole number.

How do I write my equations in the a x + b y = c form?

Move every x and y term to the left and the constant to the right. For y = 2x − 1, subtract 2x from both sides to get −2x + y = −1, so a = −2, b = 1 and c = −1. If a variable is missing, its coefficient is 0.

Related calculators

This calculator is for educational purposes. Double-check important results before acting on them.