What Cramer's rule does
Cramer's rule solves a square system of linear equations by writing each unknown as a ratio of two determinants. For the system Ax = b with A square and det A ≠ 0, the i-th unknown is
xᵢ = det(Aᵢ) / det(A)
where Ai is the coefficient matrix with its i-th column replaced by the constants b. Nothing is eliminated, nothing is substituted; you compute n + 1 determinants and divide.
That makes it the tidiest hand method for 2 × 2 and 3 × 3 systems, which is why it survives in statics, circuit analysis and analytic geometry courses. Solve a truss joint for three unknown member forces, or a two-loop circuit for its mesh currents, and Cramer's rule gets you there with less bookkeeping than elimination and with no chance of losing a sign while swapping rows.
It also does something elimination does not: it tells you immediately how sensitive the answer is. The determinant of the coefficient matrix sits in every denominator, so a small determinant means every unknown is a ratio with a small denominator, and small changes in the data produce large changes in the answer. You see the conditioning of the problem before you see the solution.
The determinants, and what det A = 0 means
For a 2 × 2 system
a₁x + b₁y = c₁, a₂x + b₂y = c₂
the three determinants are D = a₁b₂ − a₂b₁, Dₓ = c₁b₂ − c₂b₁ and Dₖ = a₁c₂ − a₂c₁, giving x = Dₓ/D and y = Dₖ/D. For a 3 × 3 system the same recipe applies with 3 × 3 determinants, expanded by cofactors along any row or column.
Geometrically, det A is the signed volume of the parallelepiped spanned by the rows of A - or the area of the parallelogram, in two dimensions. When that volume is zero, the rows are linearly dependent: the planes described by the equations either share a whole line, or are parallel and never meet. Either way there is no single point to return.
The two failure cases are worth distinguishing, and this calculator does distinguish them. If det A = 0 and at least one replaced determinant is non-zero, the system is inconsistent and has no solution whatever. If det A = 0 and every replaced determinant is also zero, Cramer's rule gives no information: the system is dependent, and it may have infinitely many solutions or none at all. The 0/0 pattern is genuinely indeterminate, and the only way to settle it is to row-reduce the augmented matrix and look for a contradictory row. Any source that tells you 0/0 means infinitely many solutions is wrong - the system x + y = 1, x + y = 2, 2x + 2y = 3 has every determinant zero and no solution.
Why does the rule work? Multiply Ax = b on the left by the adjugate of A. Since adj(A)·A = det(A)·I, this gives det(A)·x = adj(A)·b, and the i-th entry of the right-hand side is exactly the cofactor expansion of det(Aᵢ). Cramer's rule is the adjugate formula for the inverse, written one component at a time.
Worked example: a 3 × 3 system
Solve
2x + y − z = 8−3x − y + 2z = −11−2x + y + 2z = −3
- det A. Expand along the first row: 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. Non-zero, so there is a unique solution.
- det Aₓ - replace column 1 with the constants: 8[(−1)(2) − (2)(1)] − 1[(−11)(2) − (2)(−3)] + (−1)[(−11)(1) − (−1)(−3)] = 8(−4) − 1(−16) − 1(−14) = −32 + 16 + 14 = −2.
- det Aₖ - replace column 2: 2[(−11)(2) − (2)(−3)] − 8[(−3)(2) − (2)(−2)] + (−1)[(−3)(−3) − (−11)(−2)] = 2(−16) − 8(−2) − 1(−13) = −32 + 16 + 13 = −3.
- det A₣ - replace column 3: 2[(−1)(−3) − (−11)(1)] − 1[(−3)(−3) − (−11)(−2)] + 8[(−3)(1) − (−1)(−2)] = 2(14) − 1(−13) + 8(−5) = 28 + 13 − 40 = 1.
- Divide. x = −2/−1 = 2, y = −3/−1 = 3, z = 1/−1 = −1.
Check by substitution into the first equation: 2(2) + 3 − (−1) = 4 + 3 + 1 = 8. Second: −3(2) − 3 + 2(−1) = −6 − 3 − 2 = −11. Third: −2(2) + 3 + 2(−1) = −4 + 3 − 2 = −3. All three hold, which is the substitution check the calculator prints automatically.
Reading the determinants
The first number to look at is det A, not the solution. It answers the yes-or-no question - is there a unique solution - before any division happens, and its size tells you how much to trust the answer.
Compare |det A| with the size of the coefficients. For a 3 × 3 matrix whose entries are around 10, a determinant of a few hundred is healthy and a determinant of 0.001 is a warning: the rows are nearly dependent, the planes nearly parallel, and the intersection point is poorly defined. The calculator flags that case. In numerical work the proper measure is the condition number rather than the determinant, because scaling every equation by 1,000 multiplies a 3 × 3 determinant by 109 without changing the problem at all - but for hand-sized systems with comparable coefficients, a small determinant is a reliable warning.
The substitution check is worth reading every time. The differences it reports should be zero to within rounding - typically below 10−12 for well-scaled input. Anything larger means a coefficient was mistyped, because Cramer's rule cannot produce a solution that fails its own equations except through arithmetic error.
Signs carry information too. Because each unknown is a ratio, changing the sign of det A alone would flip every unknown; in practice both determinants change together when you reorder rows, which is why swapping two equations leaves the solution untouched even though it flips the sign of every determinant involved.
What each determinant pattern tells you
| det A | Replaced determinants | Verdict | Geometry (3 × 3) |
|---|---|---|---|
| ≠ 0 | Any values | Exactly one solution | Three planes meeting at a single point |
| = 0 | At least one ≠ 0 | No solution | Planes forming a prism, or parallel planes |
| = 0 | All = 0 | Indeterminate - row-reduce to decide | Planes sharing a line or a plane, or an inconsistent dependent set |
| ≠ 0 but tiny | Any values | One solution, poorly conditioned | Planes meeting at a very shallow angle |
| = 0 with b = 0 | All = 0 | Infinitely many (homogeneous) | A line or plane of solutions through the origin |
The third row is the case most references get wrong: all-zero determinants do not guarantee infinitely many solutions. x + y = 1 together with x + y = 2 has every determinant zero and no solution at all.
Pitfalls
- Writing the equations in different variable orders. Every row must list the coefficients in the same order, with a zero wherever a variable is absent.
2x − z = 5enters as2, 0, -1. - Forgetting to move everything to the standard form. All variables on the left, all constants on the right, before you read off any coefficient.
- Concluding infinitely many solutions from 0/0. All determinants zero means Cramer's rule is silent, not that the system is consistent. Row-reduce to settle it.
- Using it on a large system. Cramer's rule costs O(n!) work if the determinants are expanded by cofactors, against O(n³) for Gaussian elimination. At n = 10 that is the difference between a few hundred operations and a few million.
- Trusting it near singularity. Both numerator and denominator are computed as sums of products with cancellation, so a nearly singular system loses precision in the determinant before it loses it anywhere else.
- Applying it to a non-square system. Cramer's rule needs as many equations as unknowns. For an over-determined system, least squares is the right tool; for an under-determined one, the solution set is a subspace and there is no single answer to report.
When to use something else
For anything larger than 3 × 3 by hand, or for any system solved by machine, elimination wins. Gauss-Jordan elimination solves the system and simultaneously tells you the rank, which is what actually settles the dependent case that Cramer's rule leaves open. LU decomposition does the same work in a form you can reuse across many right-hand sides.
If you need to solve the same coefficient matrix against several different constant vectors, computing the matrix inverse once and multiplying is usually more efficient than repeating Cramer's rule - though in production numerical work you factorise rather than invert, because forming an explicit inverse costs more and is less accurate than a triangular solve.
The determinant itself has uses well beyond solving systems. The determinant calculator covers the expansion rules in detail, and the same quantity appears as the scale factor in a change of variables, as the characteristic polynomial in the eigenvalue problem, and as the scalar triple product a · (b × c) in vector geometry, which is why three vectors are coplanar exactly when that determinant vanishes.
Gabriel Cramer published the rule in 1750 in his treatise on algebraic curves, using it to fit a curve through a set of prescribed points - a linear system in the unknown coefficients. Colin Maclaurin had written down the 2 × 2 and 3 × 3 cases earlier, in work published posthumously in 1748. The rule predates matrix notation by a century; determinants came first, and matrices were invented later to organise them.
