Cramer’s Rule Calculator (2×2 and 3×3 Systems, Free)

Cramer’s Rule Calculator (2×2 and 3×3 Systems, Free)

A Cramer’s rule calculator solves a square linear system with determinants: each unknown equals Dx/D, where D is the coefficient determinant and Dx replaces the x-column with the constants. For 2x + 3y = 8 and x − y = −1, D = −5, Dx = −5 and Dy = −10, so x = 1 and y = 2.

Cramer’s rule calculator

xyconstantEq 1

=

Eq 2

=

Coefficients can be whole numbers, decimals (0.25) or fractions (3/4). Use 0 for a missing variable.
Try:
Unique solution by Cramer’s rule
x = 1y = 2

D = −5 ≠ 0, so the system has exactly one solution: x = Dx/D = −5/(−5) = 1; y = Dy/D = −10/(−5) = 2.
Determinant D−5
Dx−5
Dy−10
x (decimal)1
y (decimal)2
The determinants
D =
2 3
1 −1

= −5

Dx =
8 3
−1 −1

= −5

Dy =
2 8
1 −1

= −10

Each Dv uses the coefficient matrix with the column of that variable (shaded) replaced by the constants.
Graph of the two lines

Graph of 2x + 3y = 8 and x − y = −1, crossing at (1, 2).-6-6-5-5-4-4-3-3-2-2-1-1112233445566

2x + 3y = 8x − y = −1solution (1, 2)
The solution is the point where the two lines cross.
Show steps
  1. Write the system: 2x + 3y = 8; x − y = −1. The coefficient matrix A holds the coefficients of x, y and B holds the constants.
  2. Find the coefficient determinant: D = 2 × (−1) − 3 × 1 = −2 − 3 = −5. D ≠ 0, so Cramer’s rule applies.
  3. Replace column 1 (the x column) with the constants: Dx = 8 × (−1) − 3 × (−1) = −8 − (−3) = −5.
    8 3
    −1 −1
  4. Replace column 2 (the y column) with the constants: Dy = 2 × (−1) − 8 × 1 = −2 − 8 = −10.
    2 8
    1 −1
  5. Divide: x = Dx / D = −5 / (−5) = 1; y = Dy / D = −10 / (−5) = 2.
  6. Check by substituting: Eq 1: 2(1) + 3(2) = 8 ✓; Eq 2: 1(1) + (−1)(2) = −1 ✓.

How to use the Cramer’s rule calculator

  1. Pick the size: a 2 × 2 system (x, y), a 3 × 3 system (x, y, z) or a 4 × 4 system (w, x, y, z).
  2. Enter each equation’s coefficients and constant in the grid, writing 0 for a missing variable. Whole numbers, decimals and fractions such as −3/4 all work. You can also type the equations, for example 2x + 3y = 8; x − y = −1, and press Fill grid.
  3. Press Solve (the answer also updates as you type). You get D, every replaced-column determinant, the solution as exact fractions with decimals, the graph of the two lines for a 2 × 2 system, and full steps with a check.

How Cramer’s rule works

Write the system as AX = B, where A is the square matrix of coefficients and B is the column of constants. Cramer’s rule says that when D = det(A) ≠ 0, each variable is

xi = Di / D, where Di is the determinant of A with column i replaced by B.

For a 2 × 2 system a₁x + b₁y = c₁ and a₂x + b₂y = c₂:

  • D = a₁b₂ − b₁a₂
  • Dx = c₁b₂ − b₁c₂ (the x-column replaced by the constants)
  • Dy = a₁c₂ − c₁a₂ (the y-column replaced by the constants)
  • x = Dx/D and y = Dy/D

For a 3 × 3 system you need four determinants (D, Dx, Dy, Dz), and for 4 × 4 five. The calculator expands each 3 × 3 determinant along the first row, a(ei − fh) − b(di − fg) + c(dh − eg), and each 4 × 4 determinant into four 3 × 3 minors, using exact fraction arithmetic so no rounding creeps in.

Worked examples

2 × 2 system

Solve 2x + 3y = 8 and x − y = −1. D = 2(−1) − 3(1) = −5. Dx = 8(−1) − 3(−1) = −5 and Dy = 2(−1) − 8(1) = −10. So x = −5/−5 = 1 and y = −10/−5 = 2. Check: 2(1) + 3(2) = 8 and 1 − 2 = −1.

2 × 2 system with a fraction answer

For 3x + 2y = 7 and 4x − 5y = 3: D = 3(−5) − 2(4) = −23, Dx = 7(−5) − 2(3) = −41 and Dy = 3(3) − 7(4) = −19. So x = 41/23 ≈ 1.7826 and y = 19/23 ≈ 0.8261. Cramer’s rule gives these exact fractions directly.

3 × 3 system

Solve 2x + y − z = 8, −3x − y + 2z = −11 and −2x + y + 2z = −3. Expanding along the first row, D = 2(−4) − 1(−2) + (−1)(−5) = −1. Replacing one column at a time gives Dx = −2, Dy = −3 and Dz = 1, so x = 2, y = 3 and z = −1.

When D = 0

For 2x + 4y = 6 and x + 2y = 5, D = 2(2) − 4(1) = 0, so Cramer’s rule cannot divide. Here Dx = 6(2) − 4(5) = −8 ≠ 0, which for a 2 × 2 system means the lines are parallel and there is no solution. If D, Dx and Dy were all 0 (as for x + 2y = 3 and 2x + 4y = 6), the equations would describe the same line and there would be infinitely many solutions.

No unique solution: what D = 0 tells you

A zero determinant means the coefficient rows are linearly dependent, so the system has either no solution or infinitely many. Cramer’s rule alone cannot always tell which. For 2 × 2 systems the replaced determinants decide it, as in the example above. For 3 × 3 and larger systems, D = Dx = Dy = Dz = 0 can still happen when the system has no solution (for example x + y + z = 1, x + y + z = 2, x + y + z = 3). That is why the calculator row reduces the augmented matrix [A | B] whenever D = 0: if a row becomes 0 = c with c ≠ 0 there is no solution; otherwise it writes the infinite family in terms of free variables, such as x = 2 − (1/2)z, y = 1 − (1/2)z, z any real number.

Cramer’s rule or elimination?

Situation Better choice
2 × 2 or 3 × 3 system, exact fractions wanted Cramer’s rule: a few determinants and one division per variable
You need only one variable Cramer’s rule: compute D and that one Di
4 × 4 or larger system Elimination usually takes fewer steps by hand
D = 0 Elimination (row reduction), which also finds infinite solution sets
Non-square system (more equations than unknowns) Elimination; Cramer’s rule needs a square matrix

Common mistakes

Mistake What to do instead
Replacing a row instead of a column Dx replaces the x-column (the coefficients of x) with the constants
Forgetting the minus sign on the middle term of a 3 × 3 expansion The signs alternate +, −, + along the first row
Leaving a variable out of an equation Write 0 as its coefficient so the columns line up
Moving constants to the wrong side Rewrite each equation as ax + by + cz = d first
Dividing by D = 0 Stop and use elimination to decide between no and infinitely many solutions
Rounding determinants early Keep exact fractions until the last step

Checking homework with the calculator

Solve the problem by hand first: compute D, then each replaced determinant, then divide. Enter the same system here and compare your D and each Di with the calculator’s values one at a time; the first one that differs shows exactly where the slip happened. The last step substitutes the answer back into every equation, a habit worth copying on tests.

Cramer’s rule practice quiz: 10 questions

Test yourself with 10 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 10
1. For 3x + 2y = 12 and x − y = −1, what is the coefficient determinant D?

Found a mistake? Let us know!

2. For 3x + 2y = 12 and x − y = −1, what is Dx?

Found a mistake? Let us know!

3. Using D = −5 and Dx = −10 from 3x + 2y = 12 and x − y = −1, what is x?

Found a mistake? Let us know!

4. To form Dy for a 3 × 3 system, what do you replace?

Found a mistake? Let us know!

5. What is det [[2, 0, 0], [0, 3, 0], [0, 0, 4]]?

Found a mistake? Let us know!

6. For 2x + 4y = 6 and x + 2y = 5, D = 0 and Dx = −8. How many solutions are there?

Found a mistake? Let us know!

7. For x + 2y = 3 and 2x + 4y = 6, what are D, Dx and Dy?

Found a mistake? Let us know!

8. How many determinants does Cramer’s rule need for a 3 × 3 system?

Found a mistake? Let us know!

9. For 4x − y = 7 and 2x + 3y = 7, what is y?

Found a mistake? Let us know!

10. Which system can Cramer’s rule NOT solve directly?

Found a mistake? Let us know!

Frequently asked questions

How do you solve a system with Cramer’s rule?

Find the coefficient determinant D. For each variable, replace that variable’s column with the constants and find the determinant, then divide it by D. For 2x + 3y = 8 and x − y = −1, D = −5, Dx = −5 and Dy = −10, so x = 1 and y = 2.

Does Cramer’s rule always work?

Only when the system is square and D ≠ 0. If D = 0 the system has no solution or infinitely many, and you need elimination to tell which. For example, x + y = 2 and 2x + 2y = 4 has D = 0 and infinitely many solutions.

How do you do Cramer’s rule on a TI-84 calculator?

Enter the coefficient matrix as [A] in the matrix editor (2nd, x⁻¹) and use MATH, 1:det( to find D. Then edit [A] so that one column holds the constants (or store a copy as [B]), find its determinant, and divide by D. Repeat for each variable.

How do you use Cramer’s rule for a 3 × 3 system?

Compute four 3 × 3 determinants: D, Dx, Dy and Dz, each by expanding along a row. Then x = Dx/D, y = Dy/D and z = Dz/D. For a triangular system such as x + y + z = 6, y + z = 5, z = 3, D is the product of the diagonal, 1, and the solution is x = 1, y = 2, z = 3.

Can Cramer’s rule be used with complex numbers?

Yes. The determinant formulas work for complex coefficients exactly as for real ones, as long as D ≠ 0. This calculator handles real numbers (whole numbers, decimals and fractions).

Related calculators

Related to This Article

What people say about "Cramer's Rule Calculator: 2x2 and 3x3 (and 4x4) with Steps"?

No one replied yet.

Leave a Reply