Solving Systems with Cramer’s Rule

Learning Outcomes

By the end of this section, you will be able to:

• 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.

We have learned how to solve systems of equations in two variables and three variables, and by multiple methods: substitution, addition, Gaussian elimination, using the inverse of a matrix, and graphing. Some of these methods are easier to apply than others and are more appropriate in certain situations. In this section, we will study two more strategies for solving systems of equations.

Evaluating the Determinant of a 2×2 Matrix

A determinant is a real number that can be very useful in mathematics because it has multiple applications, such as calculating area, volume, and other quantities. Here, we will use determinants to reveal whether a matrix is invertible by using the entries of a square matrix to determine whether there is a solution to the system of equations. Perhaps one of the more interesting applications, however, is their use in cryptography. Secure signals or messages are sometimes sent encoded in a matrix. The data can only be decrypted with an invertible matrix and the determinant. For our purposes, we focus on the determinant as an indication of the invertibility of the matrix. Calculating the determinant of a matrix involves following the specific patterns that are outlined in this section.

A General Note: Find the Determinant of a 2 × 2 Matrix

The determinant of a $2\text{ }\times \text{ }2$ matrix, given

$A=\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]$

is defined as

Figure 1

Notice the change in notation. There are several ways to indicate the determinant, including $\mathrm{det}\left(A\right)$ and replacing the brackets in a matrix with straight lines, $|A|$.

Example 1: Finding the Determinant of a 2 × 2 Matrix

Find the determinant of the given matrix.

$A=\left[\begin{array}{cc}5& 2\\ -6& 3\end{array}\right]$

Using Cramer’s Rule to Solve a System of Two Equations in Two Variables

We will now introduce a final method for solving systems of equations that uses determinants. Known as Cramer’s Rule, this technique dates back to the middle of the 18th century and is named for its innovator, the Swiss mathematician Gabriel Cramer (1704–1752), who introduced it in 1750 in Introduction à l’Analyse des lignes Courbes algébriques. Cramer’s Rule is a viable and efficient method for finding solutions to systems with an arbitrary number of unknowns, provided that we have the same number of equations as unknowns.

Cramer’s Rule will give us the unique solution to a system of equations, if it exists. However, if the system has no solution or an infinite number of solutions, this will be indicated by a determinant of zero. To find out if the system is inconsistent or dependent, another method, such as elimination, will have to be used.

To understand Cramer’s Rule, let’s look closely at how we solve systems of linear equations using basic row operations. Consider a system of two equations in two variables.

\begin{align}{a}_{1}x+{b}_{1}y&={c}_{1}&&R_{1}\\ {a}_{2}x+{b}_{2}y&={c}_{2}&&R_2\end{align}

We eliminate one variable using row operations and solve for the other. Say that we wish to solve for $x$. If equation (2) is multiplied by the opposite of the coefficient of $y$ in equation (1), equation (1) is multiplied by the coefficient of $y$ in equation (2), and we add the two equations, the variable $y$ will be eliminated.

\begin{align}b_{2}a_{1}x+b_{2}b_{1}y&=b_{2}c_{1} \\ −b_{1}a_{2}x−b_{1}b_{2}y&=−b_{1}c_{2} \\ \hline b_{2}a_{1}x−b_{1}a_{2}x&=−b_{2}c_{1}−b_{1}c_{2}\end{align} \begin{align}&\text{Multiply }R_{1}\text{ by }b_{2} \\ &\text{Multiply }R_{2}\text{ by }−b_{2} \\ \text{ } \end{align}

Now, solve for $x$.

$\begin{gathered}{b}_{2}{a}_{1}x-{b}_{1}{a}_{2}x={b}_{2}{c}_{1}-{b}_{1}{c}_{2}\\ \hfill \\ x\left({b}_{2}{a}_{1}-{b}_{1}{a}_{2}\right)={b}_{2}{c}_{1}-{b}_{1}{c}_{2}\\ \hfill \\ x=\frac{{b}_{2}{c}_{1}-{b}_{1}{c}_{2}}{{b}_{2}{a}_{1}-{b}_{1}{a}_{2}}=\frac{\left\rvert\begin{array}{cc}{c}_{1}& {b}_{1}\\ {c}_{2}& {b}_{2}\end{array}\right\rvert}{\left\rvert\begin{array}{cc}{a}_{1}& {b}_{1}\\ {a}_{2}& {b}_{2}\end{array}\right\rvert}\hfill \end{gathered}$

Similarly, to solve for $y$, we will eliminate $x$.

\begin{align}a_{2}a_{1}x+a_{2}b_{1}y&=a_{2}c_{1} \\−a_{1}a_{2}x−a_{1}b_{2}y&=−a_{1}c_{2} \\ \hline a_{2}b_{1}y−a_{1}b_{2}y&=a_{2}c_{1}−a_{1}c_{2}\end{align} \begin{align}&\text{Multiply }R_{1}\text{ by }a_{2} \\&\text{Multiply }R_{2}\text{ by }−a_{1} \\ \text{ } \end{align}

Solving for $y$ gives

$\begin{gathered}{a}_{2}{b}_{1}y-{a}_{1}{b}_{2}y={a}_{2}{c}_{1}-{a}_{1}{c}_{2} \\ y\left({a}_{2}{b}_{1}-{a}_{1}{b}_{2}\right)={a}_{2}{c}_{1}-{a}_{1}{c}_{2} \\ y=\frac{{a}_{2}{c}_{1}-{a}_{1}{c}_{2}}{{a}_{2}{b}_{1}-{a}_{1}{b}_{2}}=\frac{{a}_{1}{c}_{2}-{a}_{2}{c}_{1}}{{a}_{1}{b}_{2}-{a}_{2}{b}_{1}}=\frac{\left\rvert\begin{array}{cc}{a}_{1}& {c}_{1}\\ {a}_{2}& {c}_{2}\end{array}\right\rvert}{\left\rvert\begin{array}{cc}{a}_{1}& {b}_{1}\\ {a}_{2}& {b}_{2}\end{array}\right\rvert} \end{gathered}$

Notice that the denominator for both $x$ and $y$ is the determinant of the coefficient matrix.

We can use these formulas to solve for $x$ and $y$, but Cramer’s Rule also introduces new notation:

• $D:$ determinant of the coefficient matrix
• ${D}_{x}:$ determinant of the numerator in the solution of $x$
$x=\frac{{D}_{x}}{D}$
• ${D}_{y}:$ determinant of the numerator in the solution of $y$
$y=\frac{{D}_{y}}{D}$

The key to Cramer’s Rule is replacing the variable column of interest with the constant column and calculating the determinants. We can then express $x$ and $y$ as a quotient of two determinants.

A General Note: Cramer’s Rule for 2×2 Systems

Cramer’s Rule is a method that uses determinants to solve systems of equations that have the same number of equations as variables.

Consider a system of two linear equations in two variables.

$\begin{array}{c}{a}_{1}x+{b}_{1}y={c}_{1}\\ {a}_{2}x+{b}_{2}y={c}_{2}\end{array}$

The solution using Cramer’s Rule is given as

$x=\frac{{D}_{x}}{D}=\frac{\left\rvert\begin{array}{cc}{c}_{1}& {b}_{1}\\ {c}_{2}& {b}_{2}\end{array}\right\rvert}{\left\rvert\begin{array}{cc}{a}_{1}& {b}_{1}\\ {a}_{2}& {b}_{2}\end{array}\right\rvert},D\ne 0;\text{ }\text{ }y=\frac{{D}_{y}}{D}=\frac{\left\rvert\begin{array}{cc}{a}_{1}& {c}_{1}\\ {a}_{2}& {c}_{2}\end{array}\right\rvert}{\left\rvert\begin{array}{cc}{a}_{1}& {b}_{1}\\ {a}_{2}& {b}_{2}\end{array}\right\rvert},D\ne 0$.

If we are solving for $x$, the $x$ column is replaced with the constant column. If we are solving for $y$, the $y$ column is replaced with the constant column.

Example 2: Using Cramer’s Rule to Solve a 2 × 2 System

Solve the following $2\text{ }\times \text{ }2$ system using Cramer’s Rule.

\begin{align}12x+3y&=15\\ 2x - 3y&=13\end{align}

Try It

Use Cramer’s Rule to solve the 2 × 2 system of equations.

$\begin{gathered}x+2y=-11 \\ -2x+y=-13 \end{gathered}$

Evaluating the Determinant of a 3 × 3 Matrix

Finding the determinant of a 2×2 matrix is straightforward, but finding the determinant of a 3×3 matrix is more complicated. One method is to augment the 3×3 matrix with a repetition of the first two columns, giving a 3×5 matrix. Then we calculate the sum of the products of entries down each of the three diagonals (upper left to lower right), and subtract the products of entries up each of the three diagonals (lower left to upper right). This is more easily understood with a visual and an example.

Find the determinant of the 3×3 matrix.

$A=\left[\begin{array}{ccc}{a}_{1}& {b}_{1}& {c}_{1}\\ {a}_{2}& {b}_{2}& {c}_{2}\\ {a}_{3}& {b}_{3}& {c}_{3}\end{array}\right]$
1. Augment $A$ with the first two columns.
$\mathrm{det}\left(A\right)=\left\rvert\begin{array}{ccc}{a}_{1}& {b}_{1}& {c}_{1}\\ {a}_{2}& {b}_{2}& {c}_{2}\\ {a}_{3}& {b}_{3}& {c}_{3}\end{array}\right\rvert \left.\begin{array}{c}{a}_{1}\\ {a}_{2}\\ {a}_{3}\end{array}\begin{array}{c}{b}_{1}\\ {b}_{2}\\ {b}_{3}\end{array}\right\rvert$
2. From upper left to lower right: Multiply the entries down the first diagonal. Add the result to the product of entries down the second diagonal. Add this result to the product of the entries down the third diagonal.
3. From lower left to upper right: Subtract the product of entries up the first diagonal. From this result subtract the product of entries up the second diagonal. From this result, subtract the product of entries up the third diagonal.

Figure 2

The algebra is as follows:

$|A|={a}_{1}{b}_{2}{c}_{3}+{b}_{1}{c}_{2}{a}_{3}+{c}_{1}{a}_{2}{b}_{3}-{a}_{3}{b}_{2}{c}_{1}-{b}_{3}{c}_{2}{a}_{1}-{c}_{3}{a}_{2}{b}_{1}$

Example 3: Finding the Determinant of a 3 × 3 Matrix

Find the determinant of the 3 × 3 matrix given

$A=\left[\begin{array}{ccc}0& 2& 1\\ 3& -1& 1\\ 4& 0& 1\end{array}\right]$

Try It

Find the determinant of the 3 × 3 matrix.

$\mathrm{det}\left(A\right)=\left\rvert\begin{array}{ccc}1& -3& 7\\ 1& 1& 1\\ 1& -2& 3\end{array}\right\rvert$

Can we use the same method to find the determinant of a larger matrix?

Yes, but for larger matrices it is best to use a graphing utility or computer software.

Using Cramer’s Rule to Solve a System of Three Equations in Three Variables

Now that we can find the determinant of a 3 × 3 matrix, we can apply Cramer’s Rule to solve a system of three equations in three variables. Cramer’s Rule is straightforward, following a pattern consistent with Cramer’s Rule for 2 × 2 matrices. As the order of the matrix increases to 3 × 3, however, there are many more calculations required.

When we calculate the determinant to be zero, Cramer’s Rule gives no indication as to whether the system has no solution or an infinite number of solutions. To find out, we have to perform elimination on the system.

Consider a 3 × 3 system of equations.

Figure 3

$x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D},z=\frac{{D}_{z}}{D},D\ne 0$

where

Figure 4

If we are writing the determinant ${D}_{x}$, we replace the $x$ column with the constant column. If we are writing the determinant ${D}_{y}$, we replace the $y$ column with the constant column. If we are writing the determinant ${D}_{z}$, we replace the $z$ column with the constant column. Always check the answer.

Example 4: Solving a 3 × 3 System Using Cramer’s Rule

Find the solution to the given 3 × 3 system using Cramer’s Rule.

$\begin{gathered}x+y-z=6\\ 3x - 2y+z=-5\\ x+3y - 2z=14\end{gathered}$

Try It

Use Cramer’s Rule to solve the 3 × 3 matrix.

$\begin{gathered} x - 3y+7z=13\\ x+y+z=1\\ x - 2y+3z=4\end{gathered}$

Example 5: Using Cramer’s Rule to Solve an Inconsistent System

Solve the system of equations using Cramer’s Rule.

$\begin{gathered}3x - 2y=4 \\ 6x - 4y=0\end{gathered}$

Example 6: Use Cramer’s Rule to Solve a Dependent System

Solve the system with an infinite number of solutions.

$\begin{gathered} x - 2y+3z=0\\ 3x+y - 2z=0 \\ 2x - 4y+6z=0 \end{gathered}$

Understanding Properties of Determinants

There are many properties of determinants. Listed here are some properties that may be helpful in calculating the determinant of a matrix.

A General Note: Properties of Determinants

1. If the matrix is in upper triangular form, the determinant equals the product of entries down the main diagonal.
2. When two rows are interchanged, the determinant changes sign.
3. If either two rows or two columns are identical, the determinant equals zero.
4. If a matrix contains either a row of zeros or a column of zeros, the determinant equals zero.
5. The determinant of an inverse matrix ${A}^{-1}$ is the reciprocal of the determinant of the matrix $A$.
6. If any row or column is multiplied by a constant, the determinant is multiplied by the same factor.

Example 7: Illustrating Properties of Determinants

Illustrate each of the properties of determinants.

Example 8: Using Cramer’s Rule and Determinant Properties to Solve a System

Find the solution to the given 3 × 3 system.

$\begin{gathered}2x+4y+4z=2 \\ 3x+7y+7z=-5 \\ x+2y+2z=4 \end{gathered}$

Key Concepts

• The determinant for $\left[\begin{array}{cc}a& b\\ c& d\end{array}\right]$ is $ad-bc$.
• Cramer’s Rule replaces a variable column with the constant column. Solutions are $x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D}$.
• To find the determinant of a 3×3 matrix, augment with the first two columns. Add the three diagonal entries (upper left to lower right) and subtract the three diagonal entries (lower left to upper right).
• To solve a system of three equations in three variables using Cramer’s Rule, replace a variable column with the constant column for each desired solution: $x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D},z=\frac{{D}_{z}}{D}$.
• Cramer’s Rule is also useful for finding the solution of a system of equations with no solution or infinite solutions.
• Certain properties of determinants are useful for solving problems. For example:
• If the matrix is in upper triangular form, the determinant equals the product of entries down the main diagonal.
• When two rows are interchanged, the determinant changes sign.
• If either two rows or two columns are identical, the determinant equals zero.
• If a matrix contains either a row of zeros or a column of zeros, the determinant equals zero.
• The determinant of an inverse matrix ${A}^{-1}$ is the reciprocal of the determinant of the matrix $A$.
• If any row or column is multiplied by a constant, the determinant is multiplied by the same factor.

Glossary

Cramer’s Rule
a method for solving systems of equations that have the same number of equations as variables using determinants
determinant
a number calculated using the entries of a square matrix that determines such information as whether there is a solution to a system of equations