Determinants and Cramer's Rule Advanced. This lesson goes beyond core Algebra II. You can skip it.
Learning goals
- Find in elimination, and use to test uniqueness
- Compute a determinant, and a determinant by cofactor expansion
- Apply Cramer's rule to two- and three-variable systems, replacing a column with the constants
- Choose row reduction over Cramer's rule for large systems
Solving the general two-variable system
Watch the pattern appear on real numbers before meeting the letters. Solve
To clear , multiply the first equation by (the -coefficient of the second equation) and the second equation by (the -coefficient of the first). That is the same move you are about to see done with letters:
Subtract the second line from the first. The terms cancel, and is left with the coefficient :
Where did that come from? From the four coefficients , combined as . Hold on to that combination. It is about to reappear, unchanged, when the same two steps are repeated with letters instead of numbers.
Take the most general system of two linear equations in two unknowns. Write the coefficients as letters so the result works for every system at once:
Solve it by elimination, with one thing to watch for. The multipliers about to appear, and , are letters standing for coefficients that could themselves be for some particular system, unlike the nonzero multiplier the row operations of the last lesson required. That is not a problem here, because at this stage all that is needed is a one-way fact: multiply both sides of a true equation by any number, zero included, and the result is still a true equation. So whatever the actual solution turns out to be, it must satisfy the combination about to be built, whether or not or happens to be zero. Whether the reverse holds, whether the values this process produces actually solve the system, is checked separately below, and only for the case where the process can be completed, . To clear , multiply the first equation by and the second by , so the terms match:
Subtract the second line from the first. The terms cancel, and is left with the coefficient :
Check it against the numbers you already found: with , , , , this coefficient is exactly the you computed by hand above.
Now do the mirror image to clear . Multiply the first equation by and the second by , letting the same one-way reasoning cover and whether or not either happens to be zero, then subtract the first from the second, and the same coefficient reappears in front of :
Look at what these two results share. The quantity sits in front of both and , which means it becomes the denominator the moment you divide to solve:
One combination of the four coefficients controls both answers. If it is not zero, you can divide and the system has a clean solution. If it is zero, the division is illegal, and that tells you the two equations no longer pin down one single point. A number that important should not stay nameless.
The determinant and its bar notation
The shared quantity is the determinant of the four coefficients, arranged in the square grid in which they appear:
The straight bars are the determinant symbol. The rule they stand for is short: multiply down the main diagonal ( times ), then subtract the product up the other diagonal ( times ). We write the coefficient determinant of our system as , so .
Check your understanding
Evaluate the determinant .
Multiply down the main diagonal, then subtract the anti-diagonal product.
The answer is negative, which is fine. A determinant is a signed number, not an absolute value.
Cramer’s rule for a two-variable system
Look again at the answers we derived,
and notice that every numerator is itself a determinant. The denominator is in both. The numerator for is , which is the determinant you get from by a single column replacement. You take and replace its first column (the -column, and ) with the constants and . The numerator for is , the determinant from replacing the second column (the -column, and ) with the same constants. Name these column-replacement determinants and :
With that naming, the whole solution collapses into a pattern worth memorizing. This is Cramer’s rule:
Why Cramer's rule gives the exact solution when #
Look back at the elimination. Starting from the two original equations, honest algebra produced and , so every solution of the system must satisfy those two relations. When we may divide, and the relations force
No other values are possible, so the system has at most this one solution. It remains to check that this pair actually solves the system, since forcing the values does not by itself guarantee they work. Substitute them into the first equation and clear the denominator:
The middle step used , so those terms drop and factors out of what remains. The same computation on returns . The pair therefore satisfies both equations, and it is the only pair that can, so it is the unique solution.
Worked example 1 Solve and by Cramer's rule
Read the coefficients straight off the equations. The coefficient determinant is
Since , the system has a unique solution and Cramer’s rule applies. For , replace the -column with the constants and :
For , replace the -column with the constants instead:
Now divide:
The solution is . A quick check confirms it: and . Notice was negative the whole way through, which never caused trouble, because a determinant is allowed to be negative.
Check your understanding
Solve and with Cramer's rule. What is ?
Build all three determinants.
So and , giving . swaps the two answers. comes from computing with the diagonals reversed, instead of . divides by instead of by .
The determinant test for a unique solution
The derivation quietly answered a deeper question than “what is the solution.” It told us exactly when a solution exists and is unique. Everything hinged on whether we were allowed to divide by , so answers one specific question: does this system have exactly one solution, or not?
A two-variable system has a unique solution exactly when #
We prove both directions, since “exactly when” is a claim in both. Throughout, recall the two relations that hold for any solution: and .
First, if , the previous proof already produced one and only one solution, and . So gives a unique solution.
Now the other direction: suppose , and show the solution cannot be unique. With the two relations read and , and both must hold for any solution to exist at all. Two cases cover it.
If either or , then one of the relations says , which nothing can make true. The system then has no solution.
If instead and as well, look at the two equations directly, and sort them by how many variable coefficients are zero.
Suppose both equations have every variable coefficient equal to zero, so each reads . If either constant is nonzero, that one equation alone is already false, so the system has no solution. If both constants are zero, every point satisfies both equations, which is still infinitely many solutions, just not confined to a single line.
Suppose instead exactly one equation has every variable coefficient equal to zero, so it reads while the other equation keeps a nonzero coefficient. A nonzero constant in the degenerate equation contradicts itself, so the system has no solution. A zero constant there says nothing at all, so the solution set is exactly the line the other, nondegenerate equation describes: infinitely many solutions.
Suppose finally that neither equation is degenerate; both keep a nonzero coefficient on at least one variable. Since , the coefficient rows and are proportional. Because forces the constants to scale by that same factor as well, one equation is a constant multiple of the other. The two therefore impose at most one line’s worth of constraint, so the solution set is never a single point. In the consistent case that set is a whole line, giving infinitely many solutions.
Either way, a system with has no solution or infinitely many, never exactly one. Combined with the first direction, a system has a unique solution precisely when .
This is the tidy end of the one-none-infinitely-many trichotomy you met at the start of the chapter. The determinant is a single number that detects which case you are in:
- : the two lines cross at one point, so there is exactly one solution.
- : for two variables, the two lines are parallel (no solution) or the same line (infinitely many). The determinant cannot tell those two apart by itself, only that the system is degenerate. This two-line picture is specific to two variables; with three variables the same test still correctly signals “no solution or infinitely many,” but the geometry has more shapes than “parallel or the same plane,” since three planes can also fail to share a common point without any two of them being parallel.
Be careful with that last point, because it is the easiest thing to overstate. A zero determinant does not mean “no solution.” It means “not a unique solution,” which is either no solution or infinitely many. You need one more look at the constants to decide which.
See the difference on numbers. Pair with : the second equation is the first one doubled, so every point on the line satisfies both, and every determinant is zero, . That is infinitely many solutions. Now pair the same with instead. The coefficients still double, and , so again, but the constant does not match that doubling, , so , which is not zero. The two lines are parallel and never meet: no solution.
Check your understanding
For which values of does the system have exactly one solution?
A unique solution happens exactly when the coefficient determinant is nonzero, so find where is zero.
This is zero when or , so the system has a unique solution for every other value, that is and .
Determinants of three-variable systems
For three unknowns the coefficients form a array, and its determinant is built out of determinants. Expand along the first row: multiply each top entry by the determinant left after crossing out that entry’s own row and column. Then attach the alternating signs to those products in order: plus, minus, plus.
Each small determinant is the minor of the entry in front of it. The middle term carries a minus sign, which is the single most common slip, so watch for it. This method is called cofactor expansion, and it reduces any determinant to three easy ones.
Worked example 2 Evaluate a 3 by 3 determinant by cofactor expansion
Expand along the first row of
Take the three top entries , , in turn, each with its minor and its sign:
Evaluate each determinant:
Now combine with the signs, and mind the minus on the middle term:
The determinant equals .
Check your understanding
Evaluate by expanding along the first row.
Expand along the top row, with signs plus, minus, plus. The top-right entry is , so its term drops out.
So the determinant is .
Cramer’s rule for a three-variable system
Cramer’s rule extends to three unknowns with no new ideas, only more columns. The two-variable version came from combining the equations to make one variable’s coefficient match and cancel, then recording only what that combination implies about any solution, the same one-way reasoning as above, valid whether or not a multiplier lands on zero. Isolating one unknown among three runs through that same combining process, just applied twice instead of once, and lands on the identical pattern: each numerator swaps the constants into one column, with staying the shared denominator throughout. As before, this only pins down what any solution must satisfy; checking that those values actually work, when , is the same substitution argument as the two-variable proof, just with one more variable. Writing out that longer elimination and check in full would not teach anything the two-variable case has not already shown, so the pattern is stated here rather than rederived from scratch.
Let be the coefficient determinant of
Form , , and by replacing the -, -, or -column with the constant column . Then, as long as ,
Worked example 3 Solve a 3 by 3 system with Cramer's rule
Solve
Start with the coefficient determinant, expanding along the first row:
Because , the system has a unique solution. Replace the -column with the constants :
Replace the -column instead:
And the -column:
Divide each by :
The solution is , which checks in all three equations. Had you wanted only , you could have computed just and and skipped the other two determinants entirely.
Check your understanding
For the system , , , which determinant equals under Cramer's rule?
is formed by replacing the -column, the middle column of coefficients , with the constant column , leaving the - and -columns unchanged. That is the first option. The second option replaces the -column instead, which is , not . The third replaces the -column, which is . The fourth is the original coefficient determinant , with no column replaced at all.
Cramer’s rule or row reduction?
Cramer’s rule and the row reduction from the previous lesson both handle a square system, the same number of equations as unknowns, so on that common ground, which should you reach for? Row reduction still reaches further: it also handles a system with more equations than unknowns or fewer, the kind Matrices and Systems solved, where Cramer’s rule does not apply at all, since there is no single coefficient determinant to divide by. Restricted to square systems, though, the two have opposite strengths, and the honest answer is that it depends on what you want.
Cramer’s rule is a closed formula: it writes each unknown as one determinant over another, with no back-substitution and no bookkeeping of row swaps. That makes it excellent in two situations. First, when you need only one unknown, you compute just and that variable’s numerator and stop, no matter which unknown it is. Row reduction cannot promise that: how much extra work it costs depends on where the unknown you want sits in the elimination order. Ask for the last variable eliminated and forward elimination alone hands it to you, no back-substitution needed at all; ask for an early one instead and you must first pin down every variable below it, climbing the whole staircase to reach it. Cramer’s rule pays the same one extra determinant regardless of which unknown you picked. Second, for theory, the formula shows plainly how the answer depends on the numbers in the system, which is why reads off the unique-solution condition at a glance.
Row reduction wins on scale. A cofactor expansion of an determinant fans out into smaller determinants and the work grows explosively with , and Cramer needs of these determinants. Row reduction grows far more gently, which is why it, not Cramer, is what people and computers use to solve large systems.
| Situation | Better tool | Why |
|---|---|---|
| You need only one of the unknowns, and it could be any of them | Cramer’s rule | One fixed cost, a second determinant, no matter which unknown you pick |
| You need only the last unknown in elimination order | Either one | Forward elimination reaches it directly, with no back-substitution needed |
| You want a formula in the coefficients | Cramer’s rule | Each unknown is a ratio of determinants |
| A full solve of a system | Either one | The effort is about the same |
| A full solve of a system | Row reduction | Cramer needs four determinants; row reduction is usually less arithmetic |
| A large system ( and up) | Row reduction | Determinant cost grows explosively |
Check your understanding
You need the complete solution to a system with equations in unknowns. Which method should you use?
For a system, Cramer's rule needs seven determinants, and each one expands into a fan of smaller determinants. That cost grows explosively as the system grows, which is why row reduction, not Cramer's rule, is what people and computers use for a large system. Cramer's rule's no-back-substitution advantage matters most when you want only one unknown, not a full solve of a large one, and the two methods are close in effort only for a system.