From the free course College Algebra on Lykke
7.8 Solving Systems with Cramer's Rule
Key concepts: Cramer's Rule for systems with equal numbers of equations and variables · Determinants of 2×2 matrices · Cramer's Rule formulas for solving 2×2 systems · Determinants of 3×3 matrices · Evaluating 3×3 determinants using augmentation and diagonal products · Cramer's Rule formulas for 3×3 systems · Using determinants to identify inconsistent systems · Using determinants to identify dependent systems with infinitely many solutions · Replacing coefficient columns with the constant column to form D_x, D_y, and D_z · Checking solutions in the original equation
By the end of this section the student can: Evaluate 2 × 2 determinants; Use Cramer’s Rule to solve a system of equations in two variables; Evaluate 3 × 3 determinants; Use Cramer’s Rule to solve a system of three equations in three variables; Know the properties of determinants
7.8 Solving Systems with Cramer’s Rule
A determinant compresses the essential information about a square matrix into one number: for a system of linear equations, that number reveals whether the coefficient structure permits a unique solution. Cramer’s Rule then turns each variable into a quotient of determinants.
Imagine a system as a machine with several coefficient columns feeding into one constant column. To solve for a particular variable, Cramer’s Rule replaces that variable’s coefficient column with the constants and compares the resulting determinant with the original coefficient determinant. The replacement column is the central idea:
If solving for a variable, replace that variable’s coefficient column with the column of constants.
Cramer’s Rule applies to systems with the same number of equations as variables. Thus, it applies to a system of two equations in two variables or three equations in three variables. It does not replace ordinary elimination in every situation: determinant calculations become increasingly cumbersome as the matrix grows, and a zero coefficient determinant requires additional analysis.
Evaluating the Determinant of a $2 \times 2$ Matrix
A determinant is a number associated with a square matrix. For a $2 \times 2$ matrix,
$$ A= \begin{bmatrix} a & b\ c & d \end{bmatrix}, $$
the determinant is defined by
$$ \det(A)= \begin{vmatrix} a & b\ c & d \end{vmatrix} =ad-bc. $$
The calculation follows the pattern “product of the main diagonal minus product of the other diagonal.” The first product is $ad$, and the second product is $bc$. The vertical bars indicate a determinant, not the absolute value of an expression viewed in isolation.
Example: Find the determinant of
$$ A= \begin{bmatrix} 4 & -3\ 2 & 5 \end{bmatrix}. $$
Identify the four entries:
$$ a=4,\qquad b=-3,\qquad c=2,\qquad d=5. $$
Apply the $2 \times 2$ determinant rule:
$$ \det(A)=ad-bc. $$
Substitute the entries:
$$ \det(A)=(4)(5)-(-3)(2). $$
Multiply:
$$ \det(A)=20-(-6). $$
Subtract a negative number:
$$ \det(A)=20+6. $$
Therefore,
$$ \boxed{\det(A)=26}. $$
A common mistake is to calculate $ad+bc$. The determinant requires subtraction:
$$ \boxed{\det(A)=ad-bc}. $$
Using Cramer’s Rule to Solve a System of Two Equations in Two Variables
Cramer’s Rule is a method that uses determinants to solve systems of equations that have the same number of equations as variables. Consider the system
$$ \begin{aligned} a_1x+b_1y&=c_1,\ a_2x+b_2y&=c_2. \end{aligned} $$
The determinant of the coefficient matrix is
$$ D= \begin{vmatrix} a_1 & b_1\ a_2 & b_2 \end{vmatrix}. $$
To solve for $x$, replace the $x$-coefficient column with the constants:
$$ D_x= \begin{vmatrix} c_1 & b_1\ c_2 & b_2 \end{vmatrix}. $$
To solve for $y$, replace the $y$-coefficient column with the constants:
$$ D_y= \begin{vmatrix} a_1 & c_1\ a_2 & c_2 \end{vmatrix}. $$
If $D\neq 0$, then
$$ \boxed{x=\frac{D_x}{D}},\qquad \boxed{y=\frac{D_y}{D}}. $$
The condition $D\neq 0$ matters because division by zero is undefined. When $D=0$, the system does not have a unique solution; it may have no solution or infinitely many solutions, and another method is needed to distinguish those cases.
Example: Solve the system using Cramer’s Rule.
$$ \begin{aligned} 2x+3y&=7,\ 4x-y&=5. \end{aligned} $$
First form the coefficient determinant:
$$ D= \begin{vmatrix} 2 & 3\ 4 & -1 \end{vmatrix}. $$
Evaluate it using $ad-bc$:
$$ D=(2)(-1)-(3)(4). $$
$$ D=-2-12. $$
$$ D=-14. $$
Because $D\neq 0$, the system has a unique solution.
Next replace the $x$ column with the constant column to find $D_x$:
$$ D_x= \begin{vmatrix} 7 & 3\ 5 & -1 \end{vmatrix}. $$
$$ D_x=(7)(-1)-(3)(5). $$
$$ D_x=-7-15. $$
$$ D_x=-22. $$
Therefore,
$$ x=\frac{D_x}{D} =\frac{-22}{-14} =\frac{22}{14} =\frac{11}{7}. $$
Now replace the $y$ column with the constant column to find $D_y$:
$$ D_y= \begin{vmatrix} 2 & 7\ 4 & 5 \end{vmatrix}. $$
$$ D_y=(2)(5)-(7)(4). $$
$$ D_y=10-28. $$
$$ D_y=-18. $$
Therefore,
$$ y=\frac{D_y}{D} =\frac{-18}{-14} =\frac{18}{14} =\frac{9}{7}. $$
The solution is
$$ \boxed{\left(x,y\right)=\left(\frac{11}{7},\frac{9}{7}\right)}. $$
Check both equations:
$$ 2\left(\frac{11}{7}\right)+3\left(\frac{9}{7}\right) =\frac{22}{7}+\frac{27}{7} =\frac{49}{7} =7, $$
and
$$ 4\left(\frac{11}{7}\right)-\frac{9}{7} =\frac{44}{7}-\frac{9}{7} =\frac{35}{7} =5. $$
Evaluating the Determinant of a $3 \times 3$ Matrix
For a $3 \times 3$ matrix, the determinant can be evaluated using diagonal products. For
$$ A= \begin{bmatrix} a&b&c\ d&e&f\ g&h&i \end{bmatrix}, $$
write the first two columns again to the right:
$$ \begin{array}{ccc|cc} a&b&c&a&b\ d&e&f&d&e\ g&h&i&g&h \end{array}. $$
Multiply the three entries along each downward diagonal and add those products. Then multiply the three entries along each upward diagonal and subtract those products:
$$ \det(A)=aei+bfg+cdh-ceg-bdi-afh. $$
This diagonal-augmentation shortcut works for $3 \times 3$ determinants. It should not be extended to larger matrices.
$$ A= \begin{bmatrix} 1&-2&3\ 4&0&5\ 2&1&-1 \end{bmatrix}. $$
Augment the matrix by repeating its first two columns:
$$ \begin{array}{ccc|cc} 1&-2&3&1&-2\ 4&0&5&4&0\ 2&1&-1&2&1 \end{array}. $$
The downward diagonal products are
$$ (1)(0)(-1)=0, $$
$$ (-2)(5)(2)=-20, $$
and
$$ (3)(4)(1)=12. $$
Their sum is
$$ 0+(-20)+12=-8. $$
The upward diagonal products are
$$ (2)(0)(3)=0, $$
$$ (1)(5)(1)=5, $$
and
$$ (-1)(4)(-2)=8. $$
Their sum is
$$ 0+5+8=13. $$
Subtract the upward sum from the downward sum:
$$ \det(A)=-8-13. $$
Therefore,
$$ \boxed{\det(A)=-21}. $$
The most frequent error is mixing the diagonal directions or forgetting that all three upward products are subtracted. Writing the augmented arrangement first helps keep the signs visible.
Using Cramer’s Rule to Solve a System of Three Equations in Three Variables
For the system
$$ \begin{cases} a_1x+b_1y+c_1z=d_1,\ a_2x+b_2y+c_2z=d_2,\ a_3x+b_3y+c_3z=d_3, \end{cases} $$
the coefficient determinant is
$$ D= \begin{vmatrix} a_1&b_1&c_1\ a_2&b_2&c_2\ a_3&b_3&c_3 \end{vmatrix}. $$
Replace one coefficient column at a time with the constants:
$$ D_x= \begin{vmatrix} d_1&b_1&c_1\ d_2&b_2&c_2\ d_3&b_3&c_3 \end{vmatrix}, \qquad D_y= \begin{vmatrix} a_1&d_1&c_1\ a_2&d_2&c_2\ a_3&d_3&c_3 \end{vmatrix}, $$
and
$$ D_z= \begin{vmatrix} a_1&b_1&d_1\ a_2&b_2&d_2\ a_3&b_3&d_3 \end{vmatrix}. $$
If $D\neq 0$, Cramer’s Rule gives
$$ \boxed{x=\frac{D_x}{D}},\qquad \boxed{y=\frac{D_y}{D}},\qquad \boxed{z=\frac{D_z}{D}}. $$
$$ \begin{cases} x+y+z=6,\ 2x-y+z=3,\ x+2y-z=2. \end{cases} $$
$$ D= \begin{vmatrix} 1&1&1\ 2&-1&1\ 1&2&-1 \end{vmatrix}. $$
Using the diagonal-product method, repeat the first two columns:
$$ \begin{array}{ccc|cc} 1&1&1&1&1\ 2&-1&1&2&-1\ 1&2&-1&1&2 \end{array}. $$
The downward products are
$$ (1)(-1)(-1)=1, $$
$$ (1)(1)(1)=1, $$
and
$$ (1)(2)(2)=4. $$
Thus, the downward sum is
$$ 1+1+4=6. $$
The upward products are
$$ (1)(-1)(1)=-1, $$
$$ (2)(1)(1)=2, $$
and
$$ (-1)(2)(1)=-2. $$
Thus, the upward sum is
$$ -1+2+(-2)=-1. $$
Therefore,
$$ D=6-(-1)=7. $$
Since $D=7\neq 0$, the system has a unique solution.
Replace the $x$ column with the constant column:
$$ D_x= \begin{vmatrix} 6&1&1\ 3&-1&1\ 2&2&-1 \end{vmatrix}. $$
$$ (6)(-1)(-1)=6, $$
$$ (1)(1)(2)=2, $$
and
$$ (1)(3)(2)=6. $$
Their sum is
$$ 6+2+6=14. $$
The upward products are
$$ (2)(-1)(1)=-2, $$
$$ (3)(1)(1)=3, $$
and
$$ (-1)(3)(1)=-3. $$
Their sum is
$$ -2+3+(-3)=-2. $$
Hence,
$$ D_x=14-(-2)=16, $$
so
$$ x=\frac{D_x}{D}=\frac{16}{7}. $$
Replace the $y$ column with the constant column:
$$ D_y= \begin{vmatrix} 1&6&1\ 2&3&1\ 1&2&-1 \end{vmatrix}. $$
$$ (1)(3)(-1)=-3, $$
$$ (6)(1)(1)=6, $$
and
$$ (1)(2)(2)=4. $$
Their sum is
$$ -3+6+4=7. $$
The upward products are
$$ (1)(3)(1)=3, $$
$$ (2)(1)(1)=2, $$
and
$$ (-1)(2)(6)=-12. $$
Their sum is
$$ 3+2+(-12)=-7. $$
Hence,
$$ D_y=7-(-7)=14, $$
so
$$ y=\frac{D_y}{D}=\frac{14}{7}=2. $$
Replace the $z$ column with the constant column:
$$ D_z= \begin{vmatrix} 1&1&6\ 2&-1&3\ 1&2&2 \end{vmatrix}. $$
$$ (1)(-1)(2)=-2, $$
$$ (1)(3)(1)=3, $$
and
$$ (6)(2)(2)=24. $$
Their sum is
$$ -2+3+24=25. $$
The upward products are
$$ (1)(-1)(6)=-6, $$
$$ (2)(3)(1)=6, $$
and
$$ (2)(2)(1)=4. $$
Their sum is
$$ -6+6+4=4. $$
Hence,
$$ D_z=25-4=21, $$
so
$$ z=\frac{D_z}{D}=\frac{21}{7}=3. $$
The solution is
$$ \boxed{\left(x,y,z\right)=\left(\frac{16}{7},2,3\right)}. $$
Substitution verifies the result:
$$ \frac{16}{7}+2+3 =\frac{16}{7}+\frac{14}{7}+\frac{21}{7} =\frac{51}{7}, $$
which does not equal $6$. Therefore, the computed determinants reveal an arithmetic error in the preceding work. Rechecking $D_x$ directly by expansion gives
$$ D_x =6\begin{vmatrix}-1&1\2&-1\end{vmatrix} -1\begin{vmatrix}3&1\2&-1\end{vmatrix} +1\begin{vmatrix}3&-1\2&2\end{vmatrix}, $$
$$ D_x =6\bigl((-1)(-1)-(1)(2)\bigr) -\bigl((3)(-1)-(1)(2)\bigr) +\bigl((3)(2)-(-1)(2)\bigr), $$
$$ D_x=6(1-2)-(-3-2)+(6+2), $$
$$ D_x=-6+5+8=7. $$
Thus,
$$ x=\frac{D_x}{D}=\frac{7}{7}=1. $$
The values are therefore
$$ \boxed{(x,y,z)=(1,2,3)}. $$
Indeed,
$$ 1+2+3=6, $$
$$ 2(1)-2+3=3, $$
and
$$ 1+2(2)-3=2. $$
This example illustrates why every determinant should be checked carefully. One incorrect diagonal product can change the solution. A final substitution into the original equations is an essential safeguard.
Understanding Properties of Determinants
Several determinant properties make calculations and conclusions easier:
- If a matrix is in upper triangular form, its determinant equals the product of the entries on the main diagonal.
- Interchanging two rows changes the sign of the determinant.
- If two rows or two columns are identical, the determinant is $0$.
- If a matrix contains a row of zeros or a column of zeros, its determinant is $0$.
- The determinant of an inverse matrix is the reciprocal of the determinant of the original matrix:
$$ \det\left(A^{-1}\right)=\frac{1}{\det(A)}, \qquad \det(A)\neq 0. $$
Example: Apply determinant properties without expanding. Consider
$$ B= \begin{bmatrix} 2&-1&4\ 0&3&5\ 0&0&-2 \end{bmatrix}. $$
This matrix is upper triangular, so multiply the main-diagonal entries:
$$ \det(B)=(2)(3)(-2). $$
$$ \det(B)=-12. $$
Therefore,
$$ \boxed{\det(B)=-12}. $$
Now interchange the first two rows:
$$ C= \begin{bmatrix} 0&3&5\ 2&-1&4\ 0&0&-2 \end{bmatrix}. $$
Because one row interchange changes the sign,
$$ \det(C)=-\det(B). $$
Therefore,
$$ \det(C)=-(-12)=12. $$
If instead two rows were identical, or if one row were all zeros, the determinant would immediately be
$$ \boxed{0}. $$
These zero-determinant cases are especially important in Cramer’s Rule. For a $2 \times 2$ or $3 \times 3$ system, let $D$ be the coefficient determinant.
- If $D\neq 0$, the system has exactly one solution, and Cramer’s Rule applies directly.
- If $D=0$ and at least one replaced determinant, such as $D_x$, $D_y$, or $D_z$, is nonzero, the system is inconsistent and has no solution.
- If $D=0$ and all the replaced determinants are zero, the determinants alone do not distinguish consistency from inconsistency. Use row reduction or a rank/dependence check to determine whether the system has infinitely many solutions or no solution.
The key misconception is that $D=0$ automatically means infinitely many solutions. It does not. A zero coefficient determinant means only that a unique solution is impossible. The constants may still contradict the coefficient relationships, producing no solution.
Practice Problems
1. Find the determinant.
$$ \begin{vmatrix} 5&2\ -1&4 \end{vmatrix} $$
Answer:
$$ (5)(4)-(2)(-1)=20+2=\boxed{22}. $$
2. Solve using Cramer’s Rule.
$$ \begin{aligned} 3x-2y&=4,\ x+y&=5. \end{aligned} $$
Answer:
$$ D= \begin{vmatrix} 3&-2\ 1&1 \end{vmatrix} =3+2=5, $$
$$ D_x= \begin{vmatrix} 4&-2\ 5&1 \end{vmatrix} =4+10=14, $$
$$ D_y= \begin{vmatrix} 3&4\ 1&5 \end{vmatrix} =15-4=11. $$
Therefore,
$$ \boxed{x=\frac{14}{5},\qquad y=\frac{11}{5}}. $$
3. Solve the following complete $3 \times 3$ system using Cramer’s Rule.
Answer:
$$ D=7,\qquad D_x=7,\qquad D_y=14,\qquad D_z=21. $$
Thus,
$$ \boxed{x=1,\qquad y=2,\qquad z=3}. $$
Substitution gives $6$, $3$, and $2$ on the three left-hand sides, respectively.
Content adapted from OpenStax College Algebra 2e by Jay Abramson et al., licensed CC BY 4.0.
Source Materials
Study College Algebra on Lykke
This course page is free to open: signed out, you can read its first two sections, and signing in, on any plan, opens the rest. The free Lykke Chrome extension syncs your own Canvas courses, so ChatGPT, Claude and Muse can answer from your classes and deadlines. It only reads Canvas.
Add the free extensionSign in to open every section