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.

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

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 [latex]2\text{ }\times \text{ }2[/latex] matrix, given

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

is defined as

Figure 1

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

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

Find the determinant of the given matrix.

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

Try It

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.

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

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

[latex]\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}[/latex] [latex]\begin{align}&\text{Multiply }R_{1}\text{ by }b_{2} \\ &\text{Multiply }R_{2}\text{ by }−b_{2} \\ \text{ } \end{align}[/latex]

Now, solve for [latex]x[/latex].

[latex]\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}[/latex]

Similarly, to solve for [latex]y[/latex], we will eliminate [latex]x[/latex].

[latex]\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}[/latex] [latex]\begin{align}&\text{Multiply }R_{1}\text{ by }a_{2} \\&\text{Multiply }R_{2}\text{ by }−a_{1} \\ \text{ } \end{align}[/latex]

Solving for [latex]y[/latex] gives

[latex]\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}[/latex]

Notice that the denominator for both [latex]x[/latex] and [latex]y[/latex] is the determinant of the coefficient matrix.

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

  • [latex]D:[/latex] determinant of the coefficient matrix
  • [latex]{D}_{x}:[/latex] determinant of the numerator in the solution of [latex]x[/latex]
    [latex]x=\frac{{D}_{x}}{D}[/latex]
  • [latex]{D}_{y}:[/latex] determinant of the numerator in the solution of [latex]y[/latex]
    [latex]y=\frac{{D}_{y}}{D}[/latex]

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 [latex]x[/latex] and [latex]y[/latex] 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.

[latex]\begin{array}{c}{a}_{1}x+{b}_{1}y={c}_{1}\\ {a}_{2}x+{b}_{2}y={c}_{2}\end{array}[/latex]

The solution using Cramer’s Rule is given as

[latex]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[/latex].

If we are solving for [latex]x[/latex], the [latex]x[/latex] column is replaced with the constant column. If we are solving for [latex]y[/latex], the [latex]y[/latex] column is replaced with the constant column.

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

Solve the following [latex]2\text{ }\times \text{ }2[/latex] system using Cramer’s Rule.

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

Try It

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

[latex]\begin{gathered}x+2y=-11 \\ -2x+y=-13 \end{gathered}[/latex]

Try It

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

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.

[latex]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][/latex]
  1. Augment [latex]A[/latex] with the first two columns.
    [latex]\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[/latex]
  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:

[latex]|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}[/latex]

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

Find the determinant of the 3 × 3 matrix given

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

Try It

Find the determinant of the 3 × 3 matrix.

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

Try It

Q & A

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

[latex]x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D},z=\frac{{D}_{z}}{D},D\ne 0[/latex]

where

Figure 4

If we are writing the determinant [latex]{D}_{x}[/latex], we replace the [latex]x[/latex] column with the constant column. If we are writing the determinant [latex]{D}_{y}[/latex], we replace the [latex]y[/latex] column with the constant column. If we are writing the determinant [latex]{D}_{z}[/latex], we replace the [latex]z[/latex] 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.

[latex]\begin{gathered}x+y-z=6\\ 3x - 2y+z=-5\\ x+3y - 2z=14\end{gathered}[/latex]

Try It

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

[latex]\begin{gathered} x - 3y+7z=13\\ x+y+z=1\\ x - 2y+3z=4\end{gathered}[/latex]

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

Solve the system of equations using Cramer’s Rule.

[latex]\begin{gathered}3x - 2y=4 \\ 6x - 4y=0\end{gathered}[/latex]

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

Solve the system with an infinite number of solutions.

[latex]\begin{gathered} x - 2y+3z=0\\ 3x+y - 2z=0 \\ 2x - 4y+6z=0 \end{gathered}[/latex]

Try It

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 [latex]{A}^{-1}[/latex] is the reciprocal of the determinant of the matrix [latex]A[/latex].
  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.

[latex]\begin{gathered}2x+4y+4z=2 \\ 3x+7y+7z=-5 \\ x+2y+2z=4 \end{gathered}[/latex]

Key Concepts

  • The determinant for [latex]\left[\begin{array}{cc}a& b\\ c& d\end{array}\right][/latex] is [latex]ad-bc[/latex].
  • Cramer’s Rule replaces a variable column with the constant column. Solutions are [latex]x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D}[/latex].
  • 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: [latex]x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D},z=\frac{{D}_{z}}{D}[/latex].
  • 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 [latex]{A}^{-1}[/latex] is the reciprocal of the determinant of the matrix [latex]A[/latex].
    • 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