Skip to content
LoveToCalc

Theorem — what does that mean?

Cramer's rule for two equations

Two linear equations, two unknowns, and a quotient of determinants for each.

In Swedish: Cramers regel

Cramer's rule

The relation

x=ebfdabcd

Two linear equations in two unknowns solved with determinants: x = (ed − bf)/(ad − bc) and y = (af − ec)/(ad − bc), when ad − bc is not 0.

x=4

x equals (the determinant with rows (27, 5) and (40, 4)) divided by (the determinant with rows (3, 5) and (7, 4)), equals −92 divided by (−23), equals 4

Working3 steps

Practice questions

You are given

  • e=0
  • b=-3
  • f=23
  • d=-2
  • a=-4
  • c=5

What the rule says

Take two linear equations in x and y:

The solution is

Holds when ad − bc ≠ 0.

The bottom is the determinant of the coefficients, the same for both unknowns. Each top is that determinant with one column replaced by the right-hand sides e and f: the x-column (a, c) is replaced for x, and the y-column (b, d) for y.

Books use other letters for the same system. A common one is a₁x + b₁y = c₁ and a₂x + b₂y = c₂, which gives x = (c₁b₂ − b₁c₂) / (a₁b₂ − b₁a₂). This page uses a to f so that the determinant matches the one on its own page.

Where it comes from

It is elimination, done once for all numbers. To remove y, multiply the first equation by d and the second by b, and subtract:

Divide by ad − bc and x appears. To remove x instead, multiply the first equation by c and the second by a, subtract, and (ad − bc)y = af − ec. The division is only possible when ad − bc is not 0, which is where the condition comes from.

Worked examples

A system with a negative determinant. 3x + 5y = 27 and 7x + 4y = 40. Here a = 3, b = 5, c = 7, d = 4, e = 27, f = 40. The determinant is ad − bc = 3 · 4 − 5 · 7 = 12 − 35 = −23. Then

Check: 3 · 4 + 5 · 3 = 27 and 7 · 4 + 4 · 3 = 40. The same system in the equation system calculator.

Negative numbers throughout. 4x − 3y = −41 and 5x − 5y = −60. The determinant is 4 · (−5) − (−3) · 5 = −20 + 15 = −5, and

When the determinant is 0. x + 2y = 4 and 2x + 4y = 8 give ad − bc = 1 · 4 − 2 · 2 = 0, and the rule cannot be used. Here the second equation is twice the first, so every point on the line x + 2y = 4 is a solution. Change the right-hand side to 2x + 4y = 7 and the determinant is still 0, but now the equations contradict each other and there is no solution. The rule stops at the same place in both cases; elimination shows which one it is.

The part to get right: which column is replaced

The mistake is in the top. For 3x + 5y = 27 and 7x + 4y = 40:

Top used for x Value Verdict
ed − bf 27 · 4 − 5 · 40 = −92 correct, gives x = 4
eb − fd 27 · 5 − 40 · 4 = −25 wrong, gives x ≈ 1.09
ad − bc in the top too −23 wrong, gives x = 1

The top for x is the determinant of the matrix with rows (e, b) and (f, d): e and f stand where a and c were. Cramer’s rule for y has them in the second column instead, which is why y has af − ec on top and not ed − bf.

Common mistakes

Where to go next

The determinant of a 2×2 matrix page has the bottom of the fraction. The elimination method and the substitution method solve the same systems step by step, and the system of equations calculator does it with your own numbers.

Common questions

Is Cramer’s rule faster than elimination? For two equations it is about the same, and it gives a closed formula, which helps when the coefficients are letters. For larger systems, elimination needs far fewer operations than working out the determinants by expansion.

What happens with three equations? The same idea works with 3×3 determinants: the bottom is the determinant of the coefficients and each top replaces one column with the right-hand sides.

What does ad − bc = 0 mean for the lines? Each equation is a line, and ad − bc = 0 means the two lines have the same direction. They are either parallel and different, which gives no solution, or the same line, which gives infinitely many.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
xebfdabcd27540435744

Last reviewed October 7, 2026 ·How pages are reviewed

Calculate it in practice

Linear algebraAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.