Skip to content
FiftyCalc Free calculators for all 50 states

Cramer's Rule Calculator

Test cases replayed : 4 of 4 match · Methodology · No outside source listed

Enter the coefficients of two linear equations in x and y, written as ax + by = c.

Result

Sample figures

x = Dx ÷ D—

y = Dy ÷ D —

  • D = a₁b₂ − b₁a₂—
  • Dx = c₁b₂ − b₁c₂—
  • Dy = a₁c₂ − c₁a₂—
  • Solution type—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Cramer's Rule Calculator

Equation 1: coefficient of x (a₁): enter a number. Prefilled example: 4.

Equation 1: coefficient of y (b₁): enter a number. Prefilled example: -2.

Equation 1: right-hand side (c₁): enter a number. Prefilled example: 6.

Equation 2: coefficient of x (a₂): enter a number. Prefilled example: 1.

Equation 2: coefficient of y (b₂): enter a number. Prefilled example: 3.

Equation 2: right-hand side (c₂): enter a number. Prefilled example: 5.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Equation 1: coefficient of x (a₁): enter a number.
  2. Equation 1: coefficient of y (b₁): enter a number.
  3. Equation 1: right-hand side (c₁): enter a number.
  4. Equation 2: coefficient of x (a₂): enter a number.
  5. Equation 2: coefficient of y (b₂): enter a number.
  6. Equation 2: right-hand side (c₂): enter a number.
  7. Read the result: x = Dx ÷ D; the panel also shows D = a₁b₂ − b₁a₂, Dx = c₁b₂ − b₁c₂, Dy = a₁c₂ − c₁a₂, Solution type and y = Dy ÷ D.

How this calculator works

Cramer's rule (Gabriel Cramer, 1750): for a₁x + b₁y = c₁ and a₂x + b₂y = c₂, let D = a₁b₂ − b₁a₂ be the determinant of the coefficients. Replace the x column by the constants to get Dx = c₁b₂ − b₁c₂, and the y column to get Dy = a₁c₂ − c₁a₂. Then x = Dx ÷ D and y = Dy ÷ D.

The rule works only when D ≠ 0. When D = 0 and Dx or Dy is not 0, the system has no solution; when all three are 0 in a 2×2 system with non-zero rows, the two equations describe the same line. The elimination and substitution methods give the same x and y.

The formula

  1. D=a1×b2−b1×a2+0
  2. Dx=c1×b2−b1×c2+0
  3. X=DxD+0
Symbols used in the formula
SymbolMeaning
a1Equation 1: coefficient of x (a₁)
b1Equation 1: coefficient of y (b₁)
c1Equation 1: right-hand side (c₁)
a2Equation 2: coefficient of x (a₂)
b2Equation 2: coefficient of y (b₂)
c2Equation 2: right-hand side (c₂)
DD = a₁b₂ − b₁a₂
DxDx = c₁b₂ − b₁c₂
Xx = Dx ÷ D

Worked example

Equation 1: coefficient of x (a₁)4
Equation 1: coefficient of y (b₁)-2
Equation 1: right-hand side (c₁)6
Equation 2: coefficient of x (a₂)1
Equation 2: coefficient of y (b₂)3
Equation 2: right-hand side (c₂)5
D = a₁b₂ − b₁a₂14
Dx = c₁b₂ − b₁c₂28
Dy = a₁c₂ − c₁a₂14
Solution typeOne solution
y = Dy ÷ D1
  1. D=4×3−−2×1+0=14
  2. Dx=6×3−−2×5+0=28
  3. X=2814+0=2

x = Dx ÷ D 2

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

How do you solve 4x − 2y = 6 and x + 3y = 5 with Cramer's rule?

D = 4 × 3 − (−2) × 1 = 14, Dx = 6 × 3 − (−2) × 5 = 28, Dy = 4 × 5 − 6 × 1 = 14, so x = 2 and y = 1.

What if D = 0?

The lines are parallel or the same line, so there is no single solution; for 3x + 2y = 7 and 6x + 4y = 14, D, Dx and Dy are all 0 (same line).

Related calculators