# 8.8 Cramer's Rule

$$\newcommand{\vecs}{\overset { \rightharpoonup} {\mathbf{#1}} }$$ $$\newcommand{\vecd}{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}}$$$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}{\| #1 \|}$$ $$\newcommand{\inner}{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

A system of equations can be represented and solved in general using matrices and determinants. This method can be significantly more efficient than eliminating variables in equations. What does it mean for a solution method to be more efficient? Is Cramer’s Rule the most efficient means of solving a system of equations?

Using Cramer's Rule

The determinant is defined in a seemingly arbitrary way, however, when you look at the general solution for a $$2 \times 2$$ matrix, the reasoning why it is defined this way is apparent

$$a x+b y=e$$

$$c x+d y=f$$

When you solve the system above for $$y$$ and $$x$$, you get the following:

$$y=\frac{a f-c e}{a d-b c}$$

$$x=\frac{b f-d e}{a d-b c}$$

Note that the system can be represented by the matrix and the solutions can be written as ratios of two determinants. The determinant in the denominator is of the coefficient matrix. Cramer's Rule states that for two equations, the numerator of the $$x$$ solution is the determinant of the new matrix whose columns are made up of the $$y$$ coefficients and the solution coefficients. The numerator of the $$y$$ solution is the determinant of the new matrix made up of the $$x$$ coefficients and the solution coefficients.

$$\left[\begin{array}{ll}a & b \\ c & d\end{array}\right]\left[\begin{array}{l}x \\ y\end{array}\right]=\left[\begin{array}{l}e \\ f\end{array}\right]$$

$$x=\frac{\left|\begin{array}{ll}e & b \\ f & d\end{array}\right|}{\left|\begin{array}{ll}a & b \\ c & d\end{array}\right|}$$

$$y=\frac{\left|\begin{array}{ll}a & e \\ c & f\end{array}\right|}{\left|\begin{array}{ll}a & b \\ c & d\end{array}\right|}$$

This is a fantastic improvement over solving systems using substitution or elimination. Cramer’s Rule also works with larger order matrices. For a system of 3 variables and 3 equations the reasoning is identical.

$$a x+b y+c z=j$$

$$d x+e y+f z=k$$

$$g x+h y+i z=l$$

The system can be represented as a matrix.

$$\left[\begin{array}{lll}a & b & c \\ d & e & f \\ g & h & i\end{array}\right] \cdot\left[\begin{array}{l}x \\ y \\ z\end{array}\right]=\left[\begin{array}{l}j \\ k \\ l\end{array}\right]$$

The three solutions can be represented as a ratio of determinants.

$$x=\frac{\left|\begin{array}{lll}j & b & c \\ k & e & f \\ l & h & i\end{array}\right|}{\left|\begin{array}{lll}a & b & c \\ d & e & f \\ g & h & i\end{array}\right|}$$

$$y=\frac{\left|\begin{array}{lll}a & j & c \\ d & k & f \\ g & l & i\end{array}\right|}{\left|\begin{array}{lll}a & b & c \\ d & e & f \\ g & h & i\end{array}\right|}$$

$$z=\frac{\left|\begin{array}{lll}a & b & j \\ d & e & k \\ g & h & l\end{array}\right|}{\left|\begin{array}{lll}a & b & c \\ d & e & f \\ g & h & i\end{array}\right|}$$

Remember that evaluating the determinants of $$3 \times 3$$ matrices using Sarrus's rule is very efficient.

## Examples

##### Example 1

Earlier, you were asked about efficient solutions. You have seen that using traditional row reduction to solve a system of equations can take a while and use up a lot of paper. Efficiency partly means requiring less time and space. If this was all that efficiency meant then it would not make sense to solve systems of two equations with two unknowns using matrices because the solution could be found more quickly using substitution. However, the other part of efficiency is minimizing the number of decisions that have to be made. A computer is very good at adding, subtracting and multiplying numbers, but not very good at deciding whether eliminating $$x$$ or eliminating $$y$$ would be better. This is why a definite algorithm using matrices and Cramer's Rule is more efficient.

##### Example 2

Represent the following system of equations as a matrix equation and solve using Cramer's Rule.

\begin{aligned} y-13 &=-3 x \\ x &=19-4 y \end{aligned}

First write each equation in standard form.

$$3 x+y=13$$

$$x+4 y=19$$

Then write as a coefficient matrix times a variable matrix equal to a solution matrix.

$$\left[\begin{array}{ll}3 & 1 \\ 1 & 4\end{array}\right] \cdot\left[\begin{array}{l}x \\ y\end{array}\right]=\left[\begin{array}{l}13 \\ 19\end{array}\right]$$

$$x=\frac{\left|\begin{array}{ll}e & b \\ f & d\end{array}\right|}{\left|\begin{array}{ll}a & b \\ c & d\end{array}\right|}=\frac{\left|\begin{array}{ll}13 & 1 \\ 19 & 4\end{array}\right|}{\left|\begin{array}{ll}3 & 1 \\ 1 & 4\end{array}\right|}=\frac{13 \cdot 4-19 \cdot 1}{3 \cdot 4-1 \cdot 1}=\frac{33}{11}=3$$

$$y=\frac{\left|\begin{array}{ll}3 & 13 \\ 1 & 19\end{array}\right|}{\left|\begin{array}{ll}3 & 1 \\ 1 & 4\end{array}\right|}=\frac{3 \cdot 19-13}{11}=\frac{44}{11}=4$$

##### Example 3

What is $$y$$ equal to in the following system?

$$x+2 y-z=0$$

$$7 x-0 y+z=14$$

$$0 x+y+z=10$$

If you attempted to solve this using elimination, it would take over a page of writing and rewriting to solve. Cramer’s Rule speeds up the solving process.

$$\left[\begin{array}{ccc}1 & 2 & -1 \\ 7 & 0 & 1 \\ 0 & 1 & 1\end{array}\right] \cdot\left[\begin{array}{l}x \\ y \\ z\end{array}\right]=\left[\begin{array}{c}0 \\ 14 \\ 10\end{array}\right]$$

$$y=\frac{\left|\begin{array}{lll}a & j & c \\ d & k & f \\ g & l & i\end{array}\right|}{\left|\begin{array}{lll}a & b & c \\ d & e & f \\ g & h & i\end{array}\right|}=\frac{\left|\begin{array}{ccc}1 & 0 & -1 \\ 7 & 14 & 1 \\ 0 & 10 & 1\end{array}\right|}{\left|\begin{array}{ccc}1 & 2 & -1 \\ 7 & 0 & 1 \\ 0 & 1 & 1\end{array}\right|}=\frac{14+0+(-70)-0-10-0}{0+0+(-7)-0-1-14}=\frac{-66}{-22}=3$$

##### Example 4

Solve the following system using Cramer’s Rule.

\begin{aligned} 5 x+12 y &=72 \\ 18 x-12 y &=108 \end{aligned}

$$x=\frac{\left|\begin{array}{cc}72 & 12 \\ 108 & -12\end{array}\right|}{\left|\begin{array}{cc}5 & 12 \\ 18 & -12\end{array}\right|}=\frac{72 \cdot(-12)-12 \cdot 108}{5 \cdot(-12)-12 \cdot 18}=\frac{-2160}{-276}=\frac{180}{23}$$

$$y=\frac{\left|\begin{array}{cc}5 & 72 \\ 18 & 108\end{array}\right|}{\left|\begin{array}{cc}5 & 12 \\ 18 & -12\end{array}\right|}=\frac{5 \cdot 108-72 \cdot 18}{-276}=\frac{-756}{-276}=\frac{63}{23}$$

##### Example 5

What is the value of $$z$$ in the following system?

$$3 x+2 y+z=7$$

$$4 x+0 y+z=6$$

$$6 x-y+0 z=5$$

$$z=\frac{\left|\begin{array}{ccc}3 & 2 & 7 \\ 4 & 0 & 6 \\ 6 & -1 & 5\end{array}\right|}{\left|\begin{array}{ccc}3 & 2 & 1 \\ 4 & 0 & 1 \\ 6 & -1 & 0\end{array}\right|}=\frac{0+2 \cdot 6 \cdot 6+7 \cdot 4 \cdot(-1)-0-(-1) \cdot 6 \cdot 3-5 \cdot 4 \cdot 2}{0+2 \cdot 1 \cdot 6+1 \cdot 4 \cdot(-1)-0-(-1) \cdot 1 \cdot 3-0}$$

$$=\frac{22}{11}$$

$$=2$$

##### Review

Solve the following systems of equations using Cramer's Rule. If one solution does not exist, explain.

$\begin{array}{c} 4 x-2 y &=-20 \\ x-3 y &=-15 \end{array}$

$\begin{array}{c} 3 x+5 y=33 \\ -x-2 y=-13 \end{array}$

$\begin{array}{c} x+4 y=11 \\ 3 x+12 y=33 \end{array}$

$\begin{array}{c} -3 x+y=-7 \\ -x+4 y=5 \end{array}$

$\begin{array}{c} 3 x+y &=6 \\ -6 x-2 y &=10 \end{array}$

$\begin{array}{c} Use Cramer's Rule to solve for $$x$$ in the following system: \\ 2 x-y+z &=4 \\ 4 x+7 y-z &=38 \\ -x+3 y+2 z &=23 \end{array}$

$\begin{array}{c} Use Cramer's Rule to solve for $$y$$ in the following system: \\ 4 x+y-z &=-16 \\ -3 x+4 y+z &=18 \\ x+y-3 z &=-17 \end{array}$

$\begin{array}{c} Use Cramer's Rule to solve for $$z$$ in the following system: \\ 3 x+2 y-3 z &=7 \\ -x+5 y+2 z &=29 \\ x+2 y+z &=15 \end{array}$

$\begin{array}{c} Use Cramer's Rule to solve for $$x$$ in the following system: \\ 2 x+y-2 z &=-5 \\ -4 x-2 y+3 z &=2 \\ 3 x+y-z &=3 \end{array}$

$\begin{array}{c} Use Cramer's Rule to solve for $$y$$ in the following system: \\ -x+3 y+z &=11 \\ 3 x+y+2 z &=27 \\ 5 x-y-z &=5 \end{array}$

$\begin{array}{c} Use Cramer's Rule to solve for $$z$$ in the following system: \\ 3 x+2 y+4 z &=21 \\ -2 x+3 y+z &=-11 \\ x+2 y-3 z &=-3 \end{array}$

Solve the following systems of equations using Cramer’s Rule. Practice using your calculator to help with at least one problem. If one solution does not exist, explain.

$\begin{array}{c} -x+2 y-6 z &=4 \\ 8 x+5 y+3 z &=-8 \\ 2 x-4 y+12 z &=5 \end{array}$

$\begin{array}{c} 3 x+5 y+8 z &=37 \\ -6 x+3 y+z &=42 \\ x+3 y-2 z &=5 \end{array}$

$\begin{array}{c} 4 x+y-6 z &=-38 \\ 2 x+7 y+8 z &=108 \\ -3 x+2 y-3 z &=-15 \end{array}$

$\begin{array}{c} 6 x+3 y-2 z &=-22 \\ -4 x-2 y+4 z &=28 \\ 3 x+3 y+2 z &=7 \end{array}$

$\begin{array}{c} \text { When using Cramer's Rule to solve a system of equations you will occasionally find that the determinant of the coefficient matrix is zero. When this happens, how can you tell whether your system has no solution or infinite solutions }\end{array}$

8.8 Cramer's Rule is shared under a CC BY-NC license and was authored, remixed, and/or curated by LibreTexts.