Learn
Lesson · Systems and Matrices · Matrices

Determinants and Cramer's Rule

The determinant of a square matrix is one number built from its entries, and for a system with as many equations as unknowns it decides whether there is exactly one solution. Cramer's rule then writes that solution as a ratio of determinants.

| a b | D = | c d | = ad - bc four entries, one number D ≠ 0 exactly one solution x = Dx/D, y = Dy/D D = 0 none or infinitely many and D cannot say which
The 2 by 2 determinant, and what it decides

Core ideas

What this lesson establishes

A determinant is not a matrix and not a solution. It is one number, and what it reports is a yes-or-no fact about the system it came from.

1

A matrix is an array, a determinant is a number

The array [ a b ; c d ] — two rows, written on one line with a semicolon between them — is a matrix; the number ad - bc is its determinant, written det A or with vertical bars. Only square matrices have one. The notation is worth keeping straight: brackets hold an array, bars produce a number.

2

D ≠ 0 is exactly the condition for a unique solution

For n equations in n unknowns, the system has exactly one solution when D ≠ 0 and does not when D = 0. “Systems of Two Linear Equations” said a system does one of three things; the determinant separates the first from the other two without solving anything.

3

D = 0 is where the determinant stops helping

It rules out uniqueness and says nothing else. Inconsistent and dependent systems both have D = 0, so the only way to tell which one you are holding is to go back to elimination.

The material

The determinant, and the rule built on it

Two sizes computed by hand, then a formula for the solution and the condition it needs.

“Gaussian Elimination” solved a system by carrying its augmented matrix to echelon form, and by the end of the reduction you knew how many solutions there were. The determinant answers that question in advance, from the coefficients alone, in a single number.

Definition · Determinant of a 2 by 2 matrix

For A = [ a b ; c d ], the determinant is det A = ad - bc: the product down the main diagonal minus the product up the other one. It is written det A or |A|, and the bar notation is applied directly to the array of entries.

| 3 5 | | 2 6 | | 1 4 | = (3)(4) - (5)(1) = 7 | 1 3 | = 6 - 6 = 0 the second matrix has a second row that is half the first, and a determinant of zero is what that always produces

For a 3 by 3 matrix the determinant is built from three 2 by 2 determinants. Take each entry of the first row, cross out the row and column it sits in, and multiply the entry by the determinant of what is left. The three results are then combined with alternating signs: plus, minus, plus.

| 2 1 3 | | 0 4 -1 | | 5 2 0 | | 4 -1 | | 0 -1 | | 0 4 | = 2· | 2 0 | - 1· | 5 0 | + 3· | 5 2 | = 2(0 - (-2)) - 1(0 - (-5)) + 3(0 - 20) = 2(2) - 1(5) + 3(-20) = 4 - 5 - 60 = -61

The alternating signs are not decoration and they are not optional. The middle term is subtracted, and forgetting that is the single most common way a 3 by 3 determinant comes out wrong. The expansion can be taken along any row or column with the same sign pattern started in the right place; the first row is the usual choice, and a row containing a zero is the smart one, because that term vanishes.

There is a diagonal shortcut for 3 by 3 determinants, sometimes called Sarrus's rule. It gives the same answer, and it works for 3 by 3 matrices and for no other size. The expansion above is the method that keeps working, so it is the one to learn.

Theorem · The determinant decides uniqueness

A system of n linear equations in n unknowns has exactly one solution if and only if the determinant D of its coefficient matrix is not zero. When D = 0 the system has either no solution or infinitely many.

Definition · Cramer's rule

Write the system in standard form and let D be the determinant of the coefficient matrix. Let Dx be the same determinant with the x column replaced by the column of constants, and Dy the same with the y column replaced. If D ≠ 0 then x = Dx/D and y = Dy/D.

The rule extends to any size: for each unknown, replace that unknown's column by the constants and divide by D. A system in three unknowns therefore needs four 3 by 3 determinants.

Example · Two systems with the same D

x + y = 1 with 2x + 2y = 5 has D = (1)(2) - (1)(2) = 0. So does x + y = 1 with 2x + 2y = 2. The first is inconsistent — doubling the first equation gives 2x + 2y = 2, which contradicts 2x + 2y = 5 — and the second is the same equation twice, with infinitely many solutions. One determinant, two different outcomes: D = 0 genuinely cannot tell them apart.

Cramer's rule is a formula, not a strategy. For a 2 by 2 system it is quick, and for coefficients that are letters rather than numbers it is often the clearest thing available. For a 4 by 4 system it asks for five 4 by 4 determinants, where one row reduction would have finished the job. “Gaussian Elimination” remains the method; this lesson is the criterion.

Interactive

The determinant, two ways, and Cramer's rule

Cofactor expansion beside row reduction, and the solution beside the one rref found

Matrix
cofactor expansionrow reductionCramer against rref

Method

Using Cramer's rule

Four steps, and the third one is a stop sign rather than a step.

1

Put the system in standard form

Same variable order in every equation, constants alone on the right. A missing variable is a coefficient of 0 and must be written as one: in 3x = 12 paired with 2x + 5y = 4, the first row is 3 0, not 3.

2

Compute D from the coefficient matrix

The constants play no part here. D depends only on the left-hand sides, which is why it describes the system's shape rather than its answer.

3

If D = 0, stop

There is no unique solution to find, and dividing by D is dividing by zero. Row reduce instead, and let the reduction tell you whether the system is inconsistent or dependent.

4

Replace one column at a time, then divide

Dx replaces the x column with the constants and leaves everything else alone; Dy replaces the y column. Divide each by D, keep the fractions exact, and substitute back into both original equations.

Determinants and the condition

Score 0 / 0

Cramer's rule on 2x + 3y = 7, 5x - y = 3

The system is already in standard form, so the coefficient matrix can be read straight off it. Note that -y contributes -1, not 1.

2x + 3y = 7 coefficient matrix [ 2 3 ] 5x - y = 3 [ 5 -1 ] | 2 3 | D = | 5 -1 | = (2)(-1) - (3)(5) = -2 - 15 = -17 D ≠ 0, so there is exactly one solution. | 7 3 | Dx = | 3 -1 | = (7)(-1) - (3)(3) = -7 - 9 = -16 x column replaced by the constants | 2 7 | Dy = | 5 3 | = (2)(3) - (7)(5) = 6 - 35 = -29 y column replaced by the constants x = Dx/D = -16/-17 = 16/17 y = Dy/D = -29/-17 = 29/17 check 2(16/17) + 3(29/17) = (32 + 87)/17 = 119/17 = 7 ✓ 5(16/17) - (29/17) = (80 - 29)/17 = 51/17 = 3 ✓

Nothing in the question announced seventeenths, and they are not a sign of a slip. Whole-number coefficients produce fractional solutions as a matter of course, and the denominator is always D.

Rounding is where this goes wrong. Taking x ≈ 0.94 and y ≈ 1.71 and substituting gives 2(0.94) + 3(1.71) = 7.01, which is close enough to look like an arithmetic error somewhere and is in fact the rounding. Exact fractions check exactly; decimals do not.

Faded rehearsal: for 3x + 2y = 4 and x − y = 5, first write the coefficient determinant and decide whether Cramer's rule is legal. Then build Dx and Dy one replaced column at a time, keep the quotients exact, and check the pair in both original equations. If your determinant were 0, state what you would do instead.

Common mistakes

1
Reading coefficients off equations that are not in standard form3y + 2x = 7 contributes the row 2 3, not 3 2, and a constant still sitting on the left has to be moved before anything is read. The determinant of the wrong array is a perfectly good number attached to a different system.
2
Adding all three terms of a 3 by 3 expansionThe signs run plus, minus, plus. In the worked expansion above, adding the middle term instead of subtracting it gives 4 + 5 - 60 = -51 instead of -61 — a wrong answer with no visible symptom.
3
Announcing infinitely many solutions because D = 0That conclusion needs the reduction, not the determinant. Half the systems with D = 0 have no solution at all, and there is no way to tell from D which half you are in.

Check your understanding

✓
Finish when D = 0 sends you back to row reduction rather than to a conclusion.

You should be able to compute a 2 by 2 determinant instantly, a 3 by 3 by expansion without a sign error, and to state what D ≠ 0 means for the system in one sentence. The test is a system with D = 0: the right answer is "not exactly one solution, and I need to reduce it to say more".

Note: D ≠ 0 is about to appear under a second name. “Inverse Matrices” shows that it is exactly the condition for the coefficient matrix to have an inverse, so three statements — the system has one solution, the matrix is invertible, the determinant is nonzero — turn out to be one statement in three costumes.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.