System of Equations Calculator

Enter the coefficients of two equations to find x and y. The calculator also tells you when there is no solution or infinitely many.

Equation 1: a₁ x + b₁ y = c₁
Equation 2: a₂ x + b₂ y = c₂
Negative numbers are allowed (for example, -3), and so are decimals (up to 6 decimal places). If a coefficient is 0, type 0 (an empty field means nothing has been entered yet).
Solution —
Determinant and solution
Determinant Δ = a₁ b₂ − a₂ b₁—
x—
y—

The value copied is the number for the solution (15 significant digits; a fractional solution is copied as a decimal).

How it is solved (Cramer's rule)

For the system a₁ x + b₁ y = c₁ and a₂ x + b₂ y = c₂, let the determinant be Δ = a₁ b₂ − a₂ b₁.

Decimal coefficients are converted to fractions and calculated exactly, so a rounding error such as 0.1 + 0.2 cannot make the test for Δ = 0 go wrong.

The three kinds of result

Case Meaning Test
One solution The two lines cross at one point Δ ≠ 0
No solution The two lines are parallel and never meet (or there is a contradictory equation other than 0 = 0) Δ = 0 and the constants do not match
Infinitely many solutions The two equations describe the same line. Every point on that line is a solution. If all coefficients and constants are 0, every x and y is a solution Δ = 0 and the constants also match

When Δ = 0, the tool compares the rank of the coefficient matrix (0 or 1) with the rank of the matrix that includes the constants to decide between no solution and infinitely many. Δ = 0 alone is not enough to decide.

Examples

Equation 1 Equation 2 Result
x + y = 3 x − y = 1 x = 2, y = 1
2x + 3y = 8 x − y = −1 x = 1, y = 2
x + y = 1 x + y = 2 No solution (parallel lines)
x + y = 1 2x + 2y = 2 Infinitely many solutions (every point on the line x + y = 1)
0x + 0y = 0 0x + 0y = 0 Every x and y is a solution

Things to know

Frequently asked questions

When is there no solution, or infinitely many?

When Δ = a₁ b₂ − a₂ b₁ is 0. If the two lines are parallel and do not overlap, there is no solution; if they overlap, there are infinitely many.

Why is the answer a fraction?

Because it does not divide evenly. The calculator works with exact fractions and shows the reduced fraction and the decimal.

Can I enter an equation with a coefficient of 0?

Yes. Type 0. An empty field is treated as not yet entered.