2x2 System of Equations Solver
Solve a 2×2 system of linear equations in the form a₁x + b₁y = c₁ and a₂x + b₂y = c₂ using Cramer's rule. Returns the x-coordinate of the intersection of the two lines; foundational for any problem with two unknowns and two constraints.
Last updated: May 2026
Compare with similar
About this calculator
A 2×2 linear system consists of two equations in two unknowns: a₁x + b₁y = c₁ and a₂x + b₂y = c₂. Each equation is the equation of a line in the xy-plane, and the solution is the (x, y) point where the two lines intersect — geometrically a single point in the generic case. The calculator uses Cramer's rule for the x-coordinate: x = (c₁·b₂ − c₂·b₁) / (a₁·b₂ − a₂·b₁). The denominator is the determinant of the coefficient matrix; the numerator is the determinant of the same matrix with the first column replaced by the constants column. Variables: a₁, b₁, c₁ are the coefficients of the first equation; a₂, b₂, c₂ the second. Edge cases — three things can happen depending on the determinant a₁·b₂ − a₂·b₁: (1) non-zero determinant → unique solution (the two lines intersect at exactly one point); (2) zero determinant with consistent ratios c₁/a₁ = c₂/a₂ → infinitely many solutions (the equations describe the same line); (3) zero determinant with inconsistent ratios → no solution (parallel lines that never meet). This calculator returns NaN or Infinity in the zero-determinant case. For the y-coordinate, the symmetric Cramer's formula is y = (a₁·c₂ − a₂·c₁) / (a₁·b₂ − a₂·b₁) — this calculator returns only x. Solving systems is the backbone of linear algebra, used everywhere from break-even analysis to computer graphics, supply chain optimisation, and the calibration of measurement instruments.
How to use
Example 1 — Standard system. Solve 2x + 3y = 7 and x − y = 1. Enter a1 = 2, b1 = 3, c1 = 7, a2 = 1, b2 = -1, c2 = 1. Compute denominator: 2·(-1) − 1·3 = -2 − 3 = -5. Numerator for x: 7·(-1) − 1·3 = -7 − 3 = -10. x = -10 / -5 = 2. ✓ For y, substitute into either equation: from x − y = 1 with x = 2 → y = 1. Verify: 2(2) + 3(1) = 4 + 3 = 7 ✓ and 2 − 1 = 1 ✓. The lines intersect at (2, 1). Example 2 — Negative coefficients. Solve -x + 4y = 9 and 3x + 2y = 1. Enter a1 = -1, b1 = 4, c1 = 9, a2 = 3, b2 = 2, c2 = 1. Denominator: (-1)·2 − 3·4 = -2 − 12 = -14. Numerator for x: 9·2 − 1·4 = 18 − 4 = 14. x = 14 / -14 = -1. ✓ Substituting back into -x + 4y = 9: -(-1) + 4y = 9 → 4y = 8 → y = 2. Verify in the second equation: 3(-1) + 2(2) = -3 + 4 = 1 ✓. Intersection point: (-1, 2).
Frequently asked questions
What is Cramer's rule and when does it apply?
Cramer's rule is a closed-form formula for solving any n×n linear system Ax = b in terms of determinants. For each unknown xᵢ, replace the i-th column of A with the vector b, take the determinant of the resulting matrix, and divide by det(A). For 2×2 systems this gives x = (c₁b₂ − c₂b₁)/(a₁b₂ − a₂b₁) and y = (a₁c₂ − a₂c₁)/(a₁b₂ − a₂b₁). Cramer's rule applies whenever det(A) ≠ 0 (the system has a unique solution). For larger systems (3×3 and up), Cramer's rule is theoretically valid but computationally expensive — Gaussian elimination is much faster. For 2×2 systems it is elegant and easy to compute by hand or in a single formula, which is why this calculator uses it.
What does it mean when the determinant is zero?
A zero determinant means the two equations are linearly dependent — geometrically, the two lines are parallel or identical. If the lines are identical (the second equation is just a scalar multiple of the first, including the constant terms), the system has infinitely many solutions (every point on the line works). If they are parallel but distinct (same slope, different intercept), the system has no solution (the lines never meet). To distinguish these cases when det = 0, check whether the augmented matrix [A | b] also has zero determinant in extended sense: if c₁/c₂ matches a₁/a₂ and b₁/b₂, the equations represent the same line; if not, they are parallel and inconsistent. This calculator returns NaN or Infinity for zero-determinant inputs — interpret it manually using these criteria.
How do I solve systems by substitution or elimination instead?
Substitution: solve one equation for one variable, then substitute into the other. For 2x + 3y = 7 and x − y = 1, solve the second for x = y + 1, then plug into the first: 2(y + 1) + 3y = 7 → 5y + 2 = 7 → y = 1, so x = 2. Elimination: multiply equations by constants to align coefficients, then add or subtract. For the same system, multiply the second by 2: 2x − 2y = 2; subtract from the first: 5y = 5 → y = 1, then x = 2. Both methods produce the same answer; substitution is best when one variable is already isolated, elimination is best when both equations are in standard form. Cramer's rule (used by this calculator) is essentially a formalised version of elimination.
What are the most common mistakes people make solving 2×2 systems?
The first is mis-identifying the coefficients — entering 2x + 3y = 7 as a₁ = 2, b₁ = 7, c₁ = 3 instead of a₁ = 2, b₁ = 3, c₁ = 7 (b and c swapped). The second is sign errors in the determinant: a₁b₂ − a₂b₁ is easy to compute as a₁b₂ + a₂b₁ by accident, flipping the sign of the answer. The third is forgetting to check for zero determinant before dividing — produces silent NaN that propagates downstream. The fourth is solving for x and stopping; the system has two unknowns and you usually want both x and y. The fifth is not verifying the answer in both original equations — a single substitution can pass by coincidence while the other equation fails, indicating an arithmetic mistake somewhere. Always plug back into both equations.
When should I not use this calculator?
Skip it for systems with more than two unknowns (3×3, 4×4, etc.) — use a system-equations-solver that handles arbitrary size, or a matrix calculator with Gaussian elimination. Do not use it for systems where one or both equations are non-linear (quadratic, exponential, etc.); those need substitution or numerical methods, not Cramer's rule. It is the wrong tool when the determinant is zero — the calculator cannot distinguish "infinite solutions" from "no solution", so handle those cases manually. Avoid it for symbolic algebra (solve for x and y in terms of a₁, a₂, etc.); use a computer algebra system. Finally, do not use it for inequalities or systems mixing equations and inequalities — those need linear programming or a feasible-region solver, not Cramer's rule.