Math

Solve 2x2 Systems with Cramer's Rule

Calculator Free · Private
Was this calculator helpful?

Cramer's Rule is a closed-form method for solving systems of linear equations using determinants. For a 2×2 system of the form ax + by = e and cx + dy = f, it expresses each unknown directly as a ratio of two determinants: x = (ed − bf) / (ad − bc) and y = (af − ce) / (ad − bc). The denominator, D = ad − bc, is the determinant of the coefficient matrix. If D ≠ 0, the system has exactly one unique solution. If D = 0, the system is either inconsistent (no solution) or dependent (infinitely many solutions). Cramer's Rule is especially useful in analytic geometry, engineering, economics, and any field where symbolic, exact solutions are required without matrix row-reduction.

Last reviewed: May 12, 2026 Verified by Hacé Cuentas Team Source: Wikipedia EN – Cramer's Rule, NIST Digital Library of Mathematical Functions – Linear Algebra 100% private

When to use this calculator

  • Finding the exact intersection point of two straight lines in coordinate geometry (e.g., supply and demand curves in economics)
  • Solving electrical circuit equations from Kirchhoff's Voltage Law where two loop currents are unknown
  • Computing 2D affine transformation coefficients (scale/shear) when two control-point pairs are given
  • Determining break-even quantities for two competing products with shared resource constraints in operations research

Example Calculation

  1. System: x+y=5, 2x+3y=13
  2. Solution: x=2, y=3
Result: x=2, y=3

How it works

3 min read

How It's Calculated

Given the 2×2 linear system:

a·x + b·y = e
c·x + d·y = f

Step 1 — Compute the coefficient determinant (D):

D = |a  b| = a·d − b·c
    |c  d|

Step 2 — Compute Dₓ (replace the x-column with constants):

Dₓ = |e  b| = e·d − b·f
     |f  d|

Step 3 — Compute D_y (replace the y-column with constants):

D_y = |a  e| = a·f − e·c
      |c  f|

Step 4 — Apply Cramer's Rule:

x = Dₓ / D = (e·d − b·f) / (a·d − b·c)
y = D_y / D = (a·f − e·c) / (a·d − b·c)

If D = 0 and Dₓ ≠ 0 or D_y ≠ 0 → the system is inconsistent (parallel lines, no solution).
If D = 0 and Dₓ = 0 and D_y = 0 → the system is dependent (same line, infinitely many solutions).

---

Reference Table

D valueDₓ / D_yGeometric interpretationSolution type
D ≠ 0AnyLines intersect at exactly one pointUnique solution
D = 0Dₓ = 0, D_y = 0Lines are identical (coincident)Infinite solutions
D = 0Dₓ ≠ 0 or D_y ≠ 0Lines are parallel (never meet)No solution

Common 2×2 system structures and their determinants:

System typeExampleDResult
Identity-likex=1, y=2 → 1x+0y=1, 0x+1y=21x=1, y=2
Proportional (inconsistent)x+y=3, 2x+2y=80No solution
Proportional (dependent)x+y=3, 2x+2y=60∞ solutions
Standardx+y=5, 2x+3y=131x=2, y=3
Negative D3x−y=4, x+2y=77x=3, y=5

---

Typical Cases

Case 1 — Classic textbook system


System: x + y = 5 and 2x + 3y = 13

  • D = (1)(3) − (1)(2) = 3 − 2 = 1

  • Dₓ = (5)(3) − (1)(13) = 15 − 13 = 2 → x = 2/1 = 2

  • D_y = (1)(13) − (5)(2) = 13 − 10 = 3 → y = 3/1 = 3

  • Solution: x = 2, y = 3 ✓ (verify: 2+3=5 ✓, 4+9=13 ✓)
  • Case 2 — Kirchhoff circuit loop equations


    System: 4I₁ − 2I₂ = 12 and −2I₁ + 6I₂ = 0

  • D = (4)(6) − (−2)(−2) = 24 − 4 = 20

  • Dₓ = (12)(6) − (−2)(0) = 72 − 0 = 72 → I₁ = 72/20 = 3.6 A

  • D_y = (4)(0) − (12)(−2) = 0 + 24 = 24 → I₂ = 24/20 = 1.2 A
  • Case 3 — No solution (parallel lines)


    System: 2x + 4y = 6 and x + 2y = 5

  • D = (2)(2) − (4)(1) = 4 − 4 = 0

  • Dₓ = (6)(2) − (4)(5) = 12 − 20 = −8 ≠ 0

  • Result: Inconsistent — no solution (lines are parallel, different intercepts)
  • ---

    Common Mistakes

    1. Swapping rows vs. columns when forming Dₓ and D_y. The constants (e, f) replace the column of the target variable's coefficients, not a row. Mixing this up yields completely wrong answers.
    2. Sign errors in the determinant formula. Remember: D = ad − bc, NOT ad + bc. A single missed minus sign flips the entire solution.
    3. Dividing by zero without checking D first. Always verify D ≠ 0 before computing x and y. Dividing by zero indicates a degenerate system, not a numerical result.
    4. Assuming D = 0 always means no solution. A zero determinant means either no solution or infinitely many — you must check Dₓ and D_y to distinguish the two cases.
    5. Misidentifying coefficients when the system is not in standard form. If the system is written as y + 2x = 7, rewrite it as 2x + y = 7 before extracting a, b, c, d, e, f.

    ---

    Related Calculators

  • 3×3 Linear System Solver (Cramer's Rule)

  • Matrix Determinant Calculator

  • Quadratic Equation Solver

  • Slope and Line Equation Calculator

  • Frequently asked questions

    What is Cramer's Rule and who developed it?

    Cramer's Rule is a theorem in linear algebra published by Swiss mathematician Gabriel Cramer in 1750 in his work Introduction à l'analyse des lignes courbes algébriques. It expresses the solution of a square linear system as ratios of determinants. While computationally inefficient for large systems (O(n!) complexity), it is exact and invaluable for 2×2 and 3×3 systems or symbolic derivations.

    When does a 2×2 system have no solution vs. infinitely many solutions?

    Both cases occur when the determinant D = ad − bc = 0. If D = 0 and at least one of Dₓ or D_y is non-zero, the system is inconsistent (parallel lines, no intersection). If D = 0 and both Dₓ = 0 and D_y = 0, the system is dependent (the two equations represent the same line, giving infinitely many solutions). You must check both auxiliary determinants before drawing a conclusion.

    Is Cramer's Rule the most efficient way to solve a 2×2 system?

    For exactly 2×2 systems, Cramer's Rule and substitution/elimination have comparable speed — all require roughly the same number of arithmetic operations. However, for n×n systems with n ≥ 4, Gaussian elimination (O(n³)) drastically outperforms Cramer's Rule (O(n·n!)), which is why numerical software like MATLAB or NumPy uses LU decomposition instead. Cramer's Rule excels when you need a clean, symbolic closed-form expression for one variable at a time.

    How do I verify my solution is correct after using the calculator?

    Substitute the computed (x, y) back into both original equations. For the example x+y=5, 2x+3y=13 with solution x=2, y=3: check 2+3=5 ✓ and 2(2)+3(3)=4+9=13 ✓. If both equations balance, the solution is correct. A single equation passing is not enough — always verify in both.

    Can Cramer's Rule handle systems where the variables have no coefficient written (implied 1)?

    Yes. An implied coefficient of 1 is still the number 1. For example, the equation x + 3y = 7 is entered as a=1, b=3, e=7. Similarly, −y = 2 means 0·x + (−1)·y = 2, so a=0, b=−1, e=2. Always make every coefficient explicit before inputting values into the calculator.

    What does the determinant D physically represent in geometry?

    For a 2×2 matrix with row vectors u = (a, b) and v = (c, d), the absolute value |D| = |ad − bc| equals the area of the parallelogram spanned by those two vectors. When D = 0 the vectors are collinear (linearly dependent), meaning the two lines either overlap or are parallel — matching exactly the degenerate system cases. This geometric interpretation connects Cramer's Rule to cross products and area calculations in physics and engineering.

    Why does the calculator show a determinant of 0 for the system 2x+4y=10, x+2y=5?

    Because D = (2)(2) − (4)(1) = 4 − 4 = 0. In this specific case, the second equation is exactly half the first (multiply x+2y=5 by 2 to get 2x+4y=10), so both equations describe the same line. Since Dₓ = (10)(2) − (4)(5) = 0 and D_y = (2)(5) − (10)(1) = 0 as well, the system is dependent with infinitely many solutions of the form y = (5−x)/2 for any real x.

    Is Cramer's Rule applicable to systems with decimal or fractional coefficients?

    Absolutely. Cramer's Rule is purely algebraic and works for any real-number coefficients. For example, 0.5x + 1.5y = 4 and 2x − y = 1 gives D = (0.5)(−1) − (1.5)(2) = −0.5 − 3 = −3.5, Dₓ = (4)(−1) − (1.5)(1) = −5.5, Dy = (0.5)(1) − (4)(2) = −7.5, so x = −5.5/−3.5 ≈ 1.571 and y = −7.5/−3.5 ≈ 2.143. The calculator handles all real-valued inputs automatically.

    Sources and references