Cramer's Rule

Solving systems of equations using ratios of determinants.

Estimated14 minsto complete
%
Progress
Practice Cramer's Rule

MEMORY METER
This indicates how strong in your memory this concept is
Progress
Estimated14 minsto complete
%
Cramer's Rule

At your school book fair, paperbacks cost one price and hardcovers cost another. You buy 3 paperbacks and 2 hardcovers. Your total comes to $54. Your best friend buys 2 paperbacks and 4 hardcovers. His total comes to$76. How could you use a matrix to find the price of each type of book?

Cramer's Rule

We have already learned how to solve systems of linear equations using graphing, substitution and linear combinations. In this section, we will explore one way to use matrices and determinants to solve linear systems.

Cramer’s Rule in Two Variables

Given the system: \begin{align*}ax+by &= e\\ cx+dy &= f,\end{align*} we can set up the matrix \begin{align*}A\end{align*} and solve for \begin{align*}x\end{align*} and \begin{align*}y\end{align*} as shown below:

\begin{align*}A = \begin{bmatrix} a & b\\ c & d\end{bmatrix}, \ x=\frac{\begin{vmatrix}{\color{red}e} & d\\ {\color{red}f} & b\end{vmatrix}}{det \ A}\end{align*} and \begin{align*}y = \frac{\begin{vmatrix}a & {\color{red}e}\\c & {\color{red}f}\end{vmatrix}}{det \ A},\end{align*} provided \begin{align*}|A| \ne 0\end{align*}.

Note: When \begin{align*}|A| = 0\end{align*}, there is no unique solution. We have to investigate further to determine if there are infinite solutions or no solutions to the system. Notice that there is a pattern here. The coefficients of the variable we are trying to find are replaced with the constants.

Cramer’s Rule in Three Variables

Given the system: \begin{align*}ax+by+cz &= j\\ dx+ey+fz &= k\\ gx+hy+iz &= l,\end{align*} we can set up the matrix \begin{align*}A\end{align*} and solve for \begin{align*}x\end{align*} and \begin{align*}y\end{align*} as shown below:

\begin{align*}A = \begin{bmatrix} a & b & c\\ d & e & f\\ g & h & i\end{bmatrix}\end{align*}

\begin{align*}x = \frac{\begin{vmatrix}{\color{red}j} & b & c\\{\color{red}k} & e & f\\{\color{red}l} & h & i\end{vmatrix}}{det \ A}\end{align*}, \begin{align*}y = \frac{\begin{vmatrix}a & {\color{red}j} & c\\d & {\color{red}k} & f\\g & {\color{red}l} & i\end{vmatrix}}{det \ A}\end{align*} and \begin{align*}z = \frac{\begin{vmatrix}a & b & {\color{red}j}\\d & e & {\color{red}k}\\g & h & {\color{red}l}\end{vmatrix}}{det \ A}\end{align*}

provided \begin{align*}|A| \ne 0\end{align*}. Once again, if the \begin{align*}|A| = 0\end{align*}, then there is no unique solution to the system. Once again there is a pattern here. The coefficients of the variable for which we are trying to solve are replaced with the constants.

Let's use Cramer's Rule to solve the following systems of equations.

1.
\begin{align*}3x-7y &=13\\ -5x+9y &=-19\end{align*}

Matrix \begin{align*}A\end{align*} is the matrix made up of the coefficients of \begin{align*}x\end{align*} and \begin{align*}y\end{align*}:

\begin{align*}A = \begin{bmatrix} 3 & -7\\ -5 & 9\end{bmatrix}\end{align*}

Now we can find the \begin{align*}det \ A = (3\cdot9)-(-7\cdot-5) = 27-35=-8\end{align*}

So, using the formulas above:

\begin{align*}x = \frac{\begin{vmatrix}{\color{red}13} & -7\\{\color{red}-19} & 9\end{vmatrix}}{-8}=\frac{(13\cdot9)-(-7\cdot-19)}{-8}=\frac{-16}{-8}=2\end{align*}

\begin{align*}y = \frac{\begin{vmatrix}3 & {\color{red}13}\\-5 & {\color{red}-19}\end{vmatrix}}{-8}=\frac{(3\cdot-19)-(13\cdot-5)}{-8}=\frac{-57-(-65)}{-8}=\frac{8}{-8}=-1\end{align*}

Therefore, the solution is (2, -1).

1.
\begin{align*}6x+3y &=-12\\ 2x+y &=20\end{align*}

Matrix \begin{align*}A\end{align*} is the matrix made up of the coefficients of \begin{align*}x\end{align*} and \begin{align*}y\end{align*}:

\begin{align*}A = \begin{bmatrix} 6 & 3\\ 2 & 1\end{bmatrix}\end{align*}

Now we can find the \begin{align*}det \ A = (6\cdot1)-(3\cdot2) = 6-6=0\end{align*}

Because the determinant is zero, there is no unique solution and we cannot solve the system further using Cramer's Rule. Looking at the system, we see that the left-hand side of the first equation is a multiple of the second equation, by 3. The right sides are not multiples of each other, therefore there is no solution.

1.
\begin{align*}2x+2y-z &=-7\\ 5x+y-2z &=-3\\ x-3y+2z &=21\end{align*}

Matrix \begin{align*}A\end{align*} is the matrix made up of the coefficients of \begin{align*}x, y\end{align*} and \begin{align*}z\end{align*}:

\begin{align*}\begin{bmatrix} 2 & 2 & -1\\ 5 & 1 & -2\\ 1 & -3 & 2\end{bmatrix}\end{align*}

Now we can find the determinant of matrix \begin{align*}A\end{align*}:

\begin{align*}det \ A &=\begin{vmatrix}2 & 2 & -1\\ 5 & 1 & -2\\ 1 & -3 & 2\end{vmatrix}\begin{matrix} 2 & 2\\ 5 & 1\\ 1 & -3\end{matrix}\\ &= [(2)(1)(2)+(2)(-2)(1)+(-1)(5)(-3)]-[(1)(1)(-1)+(-3)(-2)(2)+(2)(5)(2)]\\ &= [4-4+15]-[-1+12+20]\\ &=15-31\\ &=-16\end{align*}

Now using the formulas above, we can find \begin{align*}x, y\end{align*} and \begin{align*}z\end{align*} as follows:

\begin{align*}x = \frac{\begin{vmatrix}{\color{red}-7} & 2 & -1\\{\color{red}-3} & 1 & -2\\{\color{red}21} & -3 & 2\end{vmatrix}}{-16}=\frac{-32}{-16}=2 \qquad y = \frac{\begin{vmatrix}2 & {\color{red}-7} & -1\\5 & {\color{red}-3} & -2\\1 & {\color{red}21} & 2\end{vmatrix}}{-16}=\frac{48}{-16}=-3 \qquad z = \frac{\begin{vmatrix}2 & 2 & {\color{red}-7}\\5 & 1 & {\color{red}-3}\\1 & -3 & {\color{red}21}\end{vmatrix}}{-16}=\frac{-80}{-16}=5\end{align*}

So the solution is (2, -3, 5).

Examples

Example 1

Earlier, you were asked how you could use a matrix to find the price of each type of book.

The system of linear equation represented by this situation is:

\begin{align*}3x + 2y = 54\\ 2x + 4y = 76\end{align*}

We can now set up a matrix and apply Cramer's rule to find the price of each type of book.

\begin{align*}A = \begin{bmatrix} 3 & 2\\ 2 & 4\end{bmatrix}\end{align*}

Now we can find the \begin{align*}det \ A = (3\cdot4)-(2\cdot2) = 12-4=8\end{align*}

So, using the formulas above:

\begin{align*}x = \frac{\begin{vmatrix}{\color{red}54} & 2\\{\color{red}76} & 4\end{vmatrix}}{8}=\frac{(54\cdot4)-(76\cdot2)}{8}=\frac{216-152}{8}=8\end{align*}

\begin{align*}y = \frac{\begin{vmatrix}3 & {\color{red}54}\\2 & {\color{red}76}\end{vmatrix}}{8}=\frac{(3\cdot76)-(2\cdot54)}{8}=\frac{(228-108)}{8}=15\end{align*}

Therefore, paperbacks cost $8 and hardcovers cost$15.

Example 2

Use Cramer's Rule to solve the system below.
\begin{align*}2x+5y &=7\\ x+3y &=2\end{align*}

Find the \begin{align*}det \ A = \begin{vmatrix} 2 & 5\\ 1 & 3\end{vmatrix} = 1.\end{align*} Now find \begin{align*}x\end{align*} and \begin{align*}y\end{align*} as follows:

\begin{align*}x= \frac{\begin{vmatrix} 7 & 5\\ 2 & 3 \end{vmatrix}}{1} = \frac{11}{1}=11 \qquad y= \frac{\begin{vmatrix} 2 & 7\\ 1 & 2 \end{vmatrix}}{1} = \frac{-3}{1}=-3, \quad \text{solution:} \ (11,-3)\end{align*}

Example 3

Use Cramer's Rule to solve the system below.
\begin{align*}4x-y &=6\\ -8x+2y &=10\end{align*}

Find the

\begin{align*}det \ A= \begin{vmatrix} 4 & -1 \\ -8 & 2 \end{vmatrix} = 8-8 = 0.\end{align*}

Therefore, there is no unique solution. We must use linear combination or the substitution method to determine whether there are an infinite number of solutions or no solutions. Using linear combinations we can multiply the first equation by 2 and get the following:

\begin{align*}& \quad 8x-2y=12 \\ & \ \underline{-8x+2y=10 \; \;} \ \Rightarrow \quad \text{Therefore, there is no solution}.\\ & \qquad \quad \ \ 0=22\end{align*}

Example 4

Use Cramer's Rule to solve the system below.

\begin{align*}x+2y+3z &=8\\ 2x-y+4z &=3\\ -x-4y+3z &=14\end{align*}

Find the

\begin{align*}det \ A=\begin{vmatrix} 1 & 2 & 3\\ 2 & -1 & 4\\ -1 & -4 & 3 \end{vmatrix}=-34.\end{align*}

Now find \begin{align*}x, y\end{align*} and \begin{align*}z\end{align*} as follows:

\begin{align*}x= \frac{\begin{vmatrix} 8 & 2 & 3\\ 3 & -1 & 4\\ 14 & -4 & 3 \end{vmatrix}}{-34} = \frac{204}{-34}=-6 \qquad y= \frac{\begin{vmatrix} 1 & 8 & 3\\ 2 & 3 & 4 \\ -1 & 14 & 3 \end{vmatrix}}{-34} = \frac{-34}{-34}=1 \qquad z= \frac{\begin{vmatrix} 1 & 2 & 8\\ 2 & -1 & 3\\ -1 & -4 & 14 \end{vmatrix}}{-34}=\frac{-136}{-34}=4\end{align*}

Therefore, the solution is (-6, 1, 4).

Review

Solve the systems below using Cramer’s Rule. If there is no unique solution, use an alternate method to determine whether the system has infinite solutions or no solution.

1. \begin{align*}5x-y &= 22\\ -x+6y &= -16\end{align*}
2. \begin{align*}2x+5y &= -1\\ -3x-8y &= 1\end{align*}
3. \begin{align*}4x-3y &= 0\\ -6x+9y &= 3\end{align*}
4. \begin{align*}4x-9y &= -20\\ -5x+15y &= 25\end{align*}
5. \begin{align*}2x-3y &= -4\\ 8x+12y &= -24\end{align*}
6. \begin{align*}3x-7y &= 12\\ -6x+14y &= -24\end{align*}
7. \begin{align*}x+5y &= 8\\ -2x-10y &= 16\end{align*}
8. \begin{align*}2x-y &= -5\\ -3x+2y &= 13\end{align*}
9. \begin{align*}x+y &= -1\\ -3x-2y &= 6\end{align*}

Solve the systems below using Cramer’s Rule. You may wish to use your calculator to evaluate the determinants.

1. \begin{align*}3x-y+2z &= 11\\ -2x+4y+13z &= -3\\ x+2y+9z &=5\end{align*}
2. \begin{align*}3x+2y-7z &= 1\\ -4x-3y+11z &= -2\\ x+4y-z &=7\end{align*}
3. \begin{align*}6x-9y+z &= -6\\ 4x+3y-2z &= 10\\ -2x+6y+z &=0\end{align*}
4. \begin{align*}x-2y+3z &= 5\\ 4x-y+4z &= 14\\ 5x+2y-4z &=-3\end{align*}
5. \begin{align*}-3x+y+z &= 10\\ 2x+y-2z &= 15\\ -4x-2y+4z &=-20\end{align*}
6. The Smith and Jamison families go to the county fair. The Smiths purchase 6 corndogs and 3 cotton candies for $21.75. The Jamisons purchase 3 corndogs and 4 cotton candies for$15.25. Write a system of linear equations and solve it using Cramer’s Rule to find the price of each food.

To see the Review answers, open this PDF file and look for section 4.8.

Notes/Highlights Having trouble? Report an issue.

Color Highlighted Text Notes

Vocabulary Language: English

TermDefinition
Cramer's rule Cramer's rule is a formula involving ratios of determinants for the solution of a system of linear equations.
determinant The determinant is a single number descriptor of a square matrix. The determinant is computed from the entries of the matrix, and has many properties and interpretations explored in linear algebra.
matrix equation A matrix equation represents a system of equations by multiplying a coefficient matrix and a variable matrix to get a solution matrix.
Sarrus’ rule Sarrus’ rule is a memorization technique that enables you to compute the determinant of matrices efficiently.