# How do I use Cramer's rule?

Solves a system of 2 or 3 linear equations by Cramer's rule: the determinants D, Dx, Dy and Dz and each unknown as an exact fraction, with the working shown.

- Page: https://www.acalculator.org/math/cramers-rule-calculator
- JSON spec: https://www.acalculator.org/math/cramers-rule-calculator.json
- Version: 59f61fe3f98d

## Default answer

Example with the default inputs (Equations [1, 1, −1, 6; 3, −2, 1, −5; 1, 3, −2, 14]): The solution is (1, 3, −2).

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| m | Equations | One row per equation: the coefficients of x, y (and z), then the constant after the equals sign in the last column. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| solution | Solution | The values of the unknowns as exact fractions: (x, y) or (x, y, z). |
| d | D | The determinant of the coefficients. |
| dx | Dx | The determinant with the x column replaced by the constants. |
| dy | Dy | The determinant with the y column replaced by the constants. |
| dz | Dz | The determinant with the z column replaced by the constants. |
| decimals | In decimals | Each unknown rounded half up to 10 significant figures. |
| steps | Working | Each determinant and each division. |

## Method

D = det(A); Dx, Dy, Dz replace the x, y, z column of A with the constants; x = Dx ÷ D, y = Dy ÷ D, z = Dz ÷ D when D ≠ 0.

## Assumptions

- Each cell is read as an exact fraction (0.1 is 1/10, a cell typed as 1/3 is 1/3).
- When D = 0 there is no unique solution, and the page says so.

## Worked examples

1. m = 1 or 1 or 3 or -2 gives solution = (1, 3, −2), d = −3, dx = −3, dy = −9, dz = 6. Source: OpenStax, Algebra and Trigonometry 2e, §11.8 Solving Systems with Cramer's Rule, Example 4 (x + y − z = 6, 3x − 2y + z = −5, x + 3y − 2z = 14 gives (1, 3, −2)), https://openstax.org/books/algebra-and-trigonometry-2e/pages/11-8-solving-systems-with-cramers-rule.
2. m = 12 or 3 or 2 or -3 gives solution = (2, −3), d = −42, dx = −84, dy = 126, steps = D = det [12, 3; 2, −3] = −42; Dx = det [15, 3; 13, −3] = −84; Dy = det [12, 15; 2, 13] = 126; x = Dx ÷ D = −84 ÷ (−42) = 2; y = Dy ÷ D = 126 ÷ (−42) = −3. Source: OpenStax, Algebra and Trigonometry 2e, §11.8 Solving Systems with Cramer's Rule, Example 2 (12x + 3y = 15, 2x − 3y = 13 gives (2, −3)), https://openstax.org/books/algebra-and-trigonometry-2e/pages/11-8-solving-systems-with-cramers-rule.
3. m = 2 or 3 or 1 or -1 gives solution = (1/2, 0), decimals = x = 0.5, y = 0.
4. m = 1 or 1 or 1 or -1 gives solution = (3/2, 3/2), decimals = x = 1.5, y = 1.5.

## FAQ

### What is Cramer's rule?

A way to solve a system of linear equations with determinants. For each unknown, replace its column in the coefficient matrix with the constants, take the determinant, and divide by the determinant D of the coefficient matrix: x = Dx ÷ D, y = Dy ÷ D, z = Dz ÷ D.

### How do I use Cramer's rule for a 2 × 2 system?

For ax + by = e and cx + dy = f: D = ad − bc, Dx = ed − bf, Dy = af − ec. For 12x + 3y = 15 and 2x − 3y = 13, D = −42, Dx = −84, Dy = 126, so x = 2 and y = −3.

### What if D = 0?

Then Cramer's rule cannot be used: the system has either no solution or infinitely many. Use elimination or row reduction (the system of equations or RREF calculator) to tell which.

### How do I find a 3 × 3 determinant?

Expand along the first row: det = a₁(b₂c₃ − b₃c₂) − a₂(b₁c₃ − b₃c₁) + a₃(b₁c₂ − b₂c₁), where the second and third rows are b and c. The determinant calculator shows the full working for larger matrices.

### How do I enter the equations?

One row per equation, with the unknowns in the same order in every row. Write 0 for a missing unknown. x + y − z = 6 is the row 1, 1, −1, 6. Use 2 rows and 3 columns for 2 equations, 3 rows and 4 columns for 3 equations.

### Is Cramer's rule better than elimination?

For 2 or 3 equations it is quick and gives each unknown on its own. For larger systems it needs many determinants, so elimination is faster.

## Sources

- OpenStax, Algebra and Trigonometry 2e, §11.8 Solving Systems with Cramer's Rule (x = Dx ÷ D, y = Dy ÷ D, z = Dz ÷ D with D ≠ 0; D = 0 means no solution or infinitely many; Example 2: 12x + 3y = 15, 2x − 3y = 13 gives (2, −3); Example 4: x + y − z = 6, 3x − 2y + z = −5, x + 3y − 2z = 14 gives (1, 3, −2)). https://openstax.org/books/algebra-and-trigonometry-2e/pages/11-8-solving-systems-with-cramers-rule (retrieved 2026-10-05)
