Study and Productivity

How to Solve Simultaneous Equations with Cramer's Rule (2x2 and 3x3)

Learn Cramer's rule step by step: calculate determinants by cofactor expansion, find each unknown as a ratio and handle the case when D equals zero.

Saizul Amin
Saizul Amin3 Nov 2026 · 4 min read
How to Solve Simultaneous Equations with Cramer's Rule (2x2 and 3x3)

How to Solve Simultaneous Equations with Cramer's Rule (2x2 and 3x3)

Cramer's rule, published by Gabriel Cramer in 1750, solves a system of linear equations using only determinants. Each unknown is one determinant divided by another. It is popular in exams because the steps are fixed and easy to show, and it is a good way to understand what a determinant actually measures. This guide explains the method and shows how the free Cramer's rule solver lays out the working.

When you can use it

Cramer's rule needs a square system: as many equations as unknowns. It gives an answer only when the determinant of the coefficients, D, is not zero. If D = 0 the system has either no solution or infinitely many, and you need another method to decide which.

The 2×2 case

Take the system

2x + 3y = 8 x − y = −1

Step 1. Determinant of the coefficients. For a 2×2 matrix with rows (a, b) and (c, d), the determinant is ad − bc.

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

Step 2. Replace the x-column with the constants.

Dx = (8)(−1) − (3)(−1) = −8 + 3 = −5

Step 3. Replace the y-column with the constants.

Dy = (2)(−1) − (8)(1) = −2 − 8 = −10

Step 4. Divide.

x = Dx ÷ D = −5 ÷ −5 = 1 y = Dy ÷ D = −10 ÷ −5 = 2

Step 5. Check by substituting: 2(1) + 3(2) = 8 and 1 − 2 = −1. Both equations hold.

The solver also draws the two lines for a 2×2 system and marks the point (1, 2) where they cross, which makes the meaning of the solution visible.

The 3×3 case

For three unknowns you need four 3×3 determinants: D, Dx, Dy and Dz. Each is found by cofactor expansion along the first row:

det = a₁₁ × M₁₁ − a₁₂ × M₁₂ + a₁₃ × M₁₃

where each M is the 2×2 determinant left after crossing out that entry's row and column. The signs alternate plus, minus, plus.

Example:

2x + y − z = 8 −3x − y + 2z = −11 −2x + y + 2z = −3

D = 2[(−1)(2) − (2)(1)] − 1[(−3)(2) − (2)(−2)] + (−1)[(−3)(1) − (−1)(−2)] = 2(−4) − 1(−2) − 1(−5) = −8 + 2 + 5 = −1

In the same way Dx = −2, Dy = −3 and Dz = 1, so x = 2, y = 3 and z = −1.

The solver writes every one of these lines, with the minors shown in bars, so you can find exactly where a sign slipped in your own work.

Working with fractions

Real exam questions often give fractional answers. Keep fractions exact until the end rather than rounding decimals in the middle, because rounding errors grow when determinants are subtracted. The solver accepts inputs such as 3/4 or 0.25 and turns everything into exact fractions, giving answers like y = 1/2 alongside a decimal.

What D = 0 tells you

When D = 0 the rows of the coefficient matrix are dependent: for two equations, the lines are parallel or identical.

  • If the lines are parallel and different, there is no solution.
  • If they are the same line, there are infinitely many solutions.

For 2×2 systems you can tell from Dx and Dy: if either is non-zero, there is no solution. For 3×3 systems that shortcut is not reliable, so the solver compares the rank of the coefficient matrix with the rank of the augmented matrix. Different ranks mean no solution; equal ranks mean infinitely many.

Is Cramer's rule efficient?

For two unknowns it is as fast as any method. For three it is still reasonable by hand. Beyond that the number of multiplications grows extremely fast, which is why computers use Gaussian elimination instead. Learn Cramer's rule because it is neat, examinable and connected to the inverse matrix, but do not use it for large systems.

Practice

The practice tab generates systems with whole-number answers and asks for one unknown. Use the Show working button only after you have tried the determinants yourself, and print a ten-question sheet with answers for revision.

Limits

The solver handles 2×2 and 3×3 systems with real coefficients. It is meant for learning and checking homework. For larger or ill-conditioned systems use numerical linear algebra software.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages