About the Cramer's Rule Calculator
This Cramer's rule calculator solves systems of two or three linear equations by computing determinants. Enter the coefficients of each equation in the form ax + by + cz = d and it returns the main determinant D, the replaced-column determinants Dx, Dy and Dz, and the solution x = Dx/D, y = Dy/D, z = Dz/D — shown as fractions when the answer is not a whole number.
It is designed for algebra and linear-algebra students who are asked to solve a system specifically with Cramer's rule and want to check every determinant, and for engineers and scientists who need a quick exact solution to a small system such as a circuit or mixture problem.
Cramer's rule only works when D ≠ 0. If the determinant is zero the calculator tells you whether the system has no solution (inconsistent) or infinitely many (dependent), by comparing the rank of the coefficient matrix with the rank of the augmented matrix.
How to use the cramer's rule calculator
- 1Choose a 2×2 or 3×3 system.
- 2Write each equation in the form ax + by + cz = d.
- 3Enter the coefficients and the constant for every equation (use 0 for a missing variable).
- 4Read D, Dx, Dy and Dz, then the solution.
- 5If D = 0, read whether the system has no solution or infinitely many.
Formula and method
Write the system as A·X = B. D is the determinant of the coefficient matrix A. Dx is the determinant of A with its first (x) column replaced by the constants B; Dy and Dz replace the second and third columns. Cramer's rule says each variable equals its replaced-column determinant divided by D.
A 2×2 determinant is ad − bc. A 3×3 determinant is expanded along the first row: a(ei − fh) − b(di − fg) + c(dh − eg). If D = 0 the matrix is singular and the system has either no solution or infinitely many; Cramer’s rule cannot decide which, so the calculator compares matrix ranks instead.
- D
- Determinant of the coefficient matrix
- Dx, Dy, Dz
- Determinants with the x, y or z column replaced by the constants
- B
- Column of constants on the right-hand side
Worked examples
3×3 system
For 2x + y − z = 8, −3x − y + 2z = −11 and −2x + y + 2z = −3, D = −1. Replacing each column with (8, −11, −3) gives Dx = −2, Dy = −3 and Dz = 1, so x = 2, y = 3 and z = −1.
2×2 system with a fractional answer
For 3x + 2y = 7 and x − 4y = 3, D = 3(−4) − 2(1) = −14, Dx = 7(−4) − 2(3) = −34 and Dy = 3(3) − 7(1) = 2. So x = −34/−14 = 17/7 and y = 2/−14 = −1/7.
Parallel lines (D = 0)
The second equation’s left side is exactly twice the first, but 9 ≠ 2 × 4, so the lines are parallel and never meet. D = 1·4 − 2·2 = 0, and Cramer’s rule cannot be applied.
Frequently asked questions
What is Cramer's rule?+
Cramer's rule solves a square system of linear equations using determinants: each unknown equals the determinant of the coefficient matrix with that unknown’s column replaced by the constants, divided by the determinant of the coefficient matrix.
When can't you use Cramer's rule?+
When the determinant D of the coefficient matrix is 0, or when the system is not square (different numbers of equations and unknowns). With D = 0 the system has no solution or infinitely many, which needs elimination to tell apart.
How do you find a 3×3 determinant?+
Expand along the first row: a(ei − fh) − b(di − fg) + c(dh − eg) for the matrix with rows (a, b, c), (d, e, f), (g, h, i). The rule of Sarrus — adding the three down-right diagonal products and subtracting the three up-right ones — gives the same answer.
Is Cramer's rule efficient for large systems?+
Not really. For n equations it needs n + 1 determinants, which grows quickly. It is great for 2×2 and 3×3 systems and for theory, but Gaussian elimination or LU decomposition is used for larger systems.
Why do I get fractions as answers?+
Each variable is a ratio of two determinants, so unless D divides Dx exactly the answer is a fraction. The calculator shows it in lowest terms, such as 17/7, along with the decimal value.