3.5 Determinants and Cramer’s Rule

[1]

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.

Find the Determinant of a 2 \color{white}  \times 2 Matrix

The determinant of  2 \times 2 matrix, given

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

is defined as:

det A= \left| \begin{array}{cc}  a&b\\  c&d\end{array} \right| = ad-bc

Notice that for determinants, we use straight vertical lines. In other words, det(A)=|A|.

Take NoteDoes ad-bc look familiar? It should. Remember this was the denominator in the scalar we multiply to the 2 \times 2 matrix with the diagonals switched and the off-diagonals opposite to create the inverse. So the inverse of a 2 \times 2 matrix like A above would be:

    \[A^{-1}=\dfrac{1}{\textsf{det}(A)}\left[\begin{array}{cc} d&-b\\ -c&a \end{array} \right]\]

Example Finding the Determinant of a 2 \color{white} \times 2 Matrix

Find the determinant of the given matrix

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

det(A)=\left| \begin{array}{cc}  5&2\\  -6&3 \end{array} \right| = (5)(3)-(-6)(2)=15+12=27

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 18th century and is named for its innovator, the Swiss mathematician Gabriel Cramer (1704-1752), who introduced it in 1750. Cramer’s Rule is a viable and efficient method for finding solutions to systems with any 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, D=0. Inconsistent Solutions have at least one numerator determinant that is non-zero. Dependent solutions have zero as the determinant in both the numerators. Another method must be used to find the general solution.

To see how and why Cramer’s Rule works, we will direct you to the source material at OpenStax College Algebra.

In short, Cramer’s rule begins with a system of equations, such as:

    \[a_1x+b_1y=c_1\]

    \[a_2x+b_2y=c_2\]

and we can show that

    \[x=\dfrac{\left| \begin{array}{cc} c_1&b_1\\ c_2&b_2 \end{array} \right|}{\left| \begin{array}{cc} a_1&b_1\\ a_2&b_2 \end{array} \right| }  \; \textsf{and} \; y=\dfrac{\left| \begin{array}{cc} a_1&c_1\\ a_2&c_2 \end{array} \right|}{\left| \begin{array}{cc} a_1&b_1\\ a_2&b_2 \end{array} \right|} \]

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 andy but Cramer’s Rule also introduces new notation:

  • D: determinant of the coefficient matrix
  • D_x: determinant of the matrix created by the coefficient matrix with the x-coefficient replaced by the constants
  • D_y: determinant of the matrix created by the coefficient matrix with the y-coefficient replaced by the constants

 

Notice that they 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:

    \[x=\dfrac{D_x}{D} \quad \textsf{and} \quad y=\dfrac{D_y}{D}\]

Cramer’s Rule for 2 \color{white}  \times 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.

    \[a_1x+b_1y=c_1\]

    \[a_2x+b_2y=c_2\]

The solution using Cramer’s Rule is given as:

    \[x=\dfrac{D_x}{D}=\dfrac{\left| \begin{array}{cc} c_1&b_1\\ c_2&b_2 \end{array} \right|}{\left| \begin{array}{cc} a_1&b_1\\ a_2&b_2 \end{array} \right| }  \; \textsf{and} \; y=\dfrac{D_y}{D}=\dfrac{\left| \begin{array}{cc} a_1&c_1\\ a_2&c_2 \end{array} \right|}{\left| \begin{array}{cc} a_1&b_1\\ a_2&b_2 \end{array} \right|} \]

For D \neq 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 Using Cramer’s Rule to Solve a System

Solve the following system using Cramer’s Rule

\begin{array}{c}  12x+3y=15\\  2x-3y=13 \end{array}

Find D=\left| \begin{array}{cc}  12&3\\  2&-3 \end{array} \right|=-36-6=-42

Find D_x=\left| \begin{array}{cc}  15&3\\  13&-3 \end{array} \right|=-45-39=-84

Find D_y=\left| \begin{array}{cc}  12&15\\  2&13 \end{array} \right|=156-30=126

x=\dfrac{D_x}{D}=\dfrac{-84}{-42}=2

y=\dfrac{D_y}{D}=\dfrac{126}{-42}=-3

The solution is (2,-3).

Try it Now 1

Use Cramer’s Rule to solve 2 \times  2 system of equations.

\begin{array}{c}  x+2y=-11\\  -2x+y=-13 \end{array}

Evaluating the Determinant of a 3 \times 3 Matrix

Finding the determinant of a 2 \times  2 matrix is straightforward, but finding the determinant of a 3 \times 3 matrix is more complicated. One method is to augment the matrix with a repeat of the first two columns, giving a 3 \times 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 the entries up each of the three opposite diagonals (lower left to upper right). This is more easily understood with a visual and an example.

Find the determinant of the 3 \times 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] \]

Step 1: Augment A with the first two columns:

    \[\textsf{det} (A)=\left| \begin{array}{ccccc} a_1 & b_1 & c_1  &a_1&b_1\\ a_2&b_2&c_2&a_2&b_2\\ a_3 &b_3&c_3 &a_3&b_3 \end{matrix}  \right| \]

Step 2: From upper left to lower right: Multiply the entries down the first diagonal. a_1 \cdot b_2 \cdot c_3, then start at b_1 and multiply left to right diagonally and then c_1. Add those three products.

Step 3: Now from upper right: Multiply the entries down the reverse diagonal. b_1 \cdot a_2 \cdot c_3, then start at a_1 and multiply right to left diagonally and then c_1.  Add those three products and subtract that value from the one in step 2.

The algebra is as follows:

    \[|A|=a_1b_2c_3+b_1c_2a_3+c_1a_2b_3-(b_1 a_2 c_3 + a_1 c_2 b_3+c_1 b_2 a_3)\]

    \[=a_1b_2c_3+b_1c_2a_3+c_1a_2b_3-b_1a_2 c_3 -a_1 c_2 b_3 -c_1 b_2 a_3\]

Example Finding the Determinant of a \color{white}3 \times 3 Matrix

Find the determinant of matrix A:

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

Augment the matrix with the first two columns and then follow the formula. Thus,

|A|=\left| \begin{array}{ccccc}  0&2&1&0&2\\  3&-1&1&3&-1\\  4&0&1&4&0 \end{array} \right|

\begin{array}{l}  \textsf{det} (A)=0(-1)(1)+2(1)(4)+1(3)(0)-4(-1)(1)-0(1)(0)-1(3)(2)\\  \quad=0+8+0-(-4)-0-6\\  \quad=6 \end{array}

Determinants can also be found using technology. Once a matrix is entered into your calculator. Going to MATRIX – MATH and det and calling up the matrix in question will provide the determinant for a matrix. In Excel, =mdeterm will find the determinant of a matrix as well.  The methods mentioned in this section only work for the specified size. For larger matrices, it is recommended to use a calculator, Excel, or another program.

Try it Now 2

Find the determinant of the matrix A.

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

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

Now that we can find the determinant of a 3 \times 3 matrix, we can apply Cramer’s Rule to solve a system of three equations and three unknowns. Cramer’s Rule for 3 \times 3 systems follows the same pattern as for 2 \times 2 systems. However, there are more calculations required.

Consider the system:

\begin{array}{c}  a_1x+b_1y+c_1z=\color{blue}d_1\\  \color{black}a_2x+b_2y+c_2z=\color{blue}d_2\\  \color{black}a_3x+b_3y+c_3z=\color{blue}d_3 \end{array}

    \[x=\dfrac{D_x}{D},\,y=\dfrac{D_y}{D},\,z=\dfrac{D_z}{D},\,D \neq 0\]

where:

    \[D=\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| , D_x=\left|\begin{array}{ccc} \color{blue}d_1&b_1&c_1\\ \color{blue}d_2&b_2&c_2\\ \color{blue}d_3&b_3&c_3 \end{array} \right| , D_y=\left|\begin{array}{ccc} a_1&\color{blue}d_1&c_1\\ a_2&\color{blue}d_2&c_2\\ a_3&\color{blue}d_3&c_3 \end{array} \right| , D_z=\left|\begin{array}{ccc} a_1&b_1&\color{blue}d_1\\ a_2&b_2&\color{blue}d_2\\ a_3&b_3&\color{blue}d_3 \end{array} \right| \]

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 constant column. Always check the answer.

Example Solving a \color{white} 3 \times 3 System Using Cramer’s Rule

Solve the following system using Cramer’s Rule.

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

Use Cramer’s Rule.

D=\left|\begin{array}{ccc}  1&1&-1\\  3&-2&1\\  1&3&-2 \end{array} \right| ,  D_x=\left|\begin{array}{ccc}  6&1&-1\\  -5&-2&1\\  14&3&-2 \end{array} \right| ,  D_y=\left|\begin{array}{ccc}  1&6&-1\\  3&-5&1\\  1&14&-2 \end{array} \right| ,  D_z=\left|\begin{array}{ccc}  1&1&6\\  3&-2&-5\\  1&3&14 \end{array} \right|

Then,

x=\dfrac{D_x}{D}=\dfrac{-3}{-3}=1

y=\dfrac{D_y}{D}=\dfrac{-9}{-3}=3

z=\dfrac{D_z}{D}=\dfrac{6}{-3}=-2

The solution is (1,3,-2).

Try it Now 3

Use Cramer’s Rule to solve the system:

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

Examples of Cramer’s Rule when  D = 0

a. Solve the system of equations (if possible) using Cramer’s Rule.

\begin{array}{l}  3x-2y=4\\  6x-4y=0 \end{array}

We begin by finding determinants:

D=\left| \begin{array}{cc}  3&-2\\  6&-4 \end{array} \right| =3(-4)-6(-2)=0

Now we know that it is either dependent or inconsistent. Let’s see one of the other determinants.

D_x=\left| \begin{array}{cc}  4&-2\\  0&-4 \end{array} \right| =4(-4)-(-2)(0)=-16

Since -16 \neq 0, we have an inconsistent solution.

b. Solve the following system of equations (if possible, or give general solution if dependent).

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

Let’s find D using technology, via calculator or Excel.

D=\left| \begin{array}{ccc}  1&-2&3\\  3&1&-2\\  2&-4&6 \end{array} \right| = 0

We know that this is a dependent or inconsistent system. We could find all three of the other determinants to see if it is dependent and if it is, we’d then have to use rref in a calculator to find a general solution. For this reason, it’s faster to simply use rref now.  There is an online version by planetcalc.

The reduced row echelon form of the matrix is:

\left[\begin{array}{cccc}  1&0&-\frac{1}{7}&0\\  0&1&-\frac{11}{7}&0\\  0&0&0&0 \end{array} \right]

As equations, these are:

\begin{array}{l}  x-\dfrac{1}{7}z=0\\  y-\dfrac{11}{7}z=0\\  0=0\end{array}

So if a is any real number then:

x=\dfrac{1}{7}a,\,y=\dfrac{11}{7}a\,\textsf{and} \, z=a

Properties of Determinants

Here are few properties that may make find determinants quicker and easier.

  1. If the matrix is in the upper triangular form (the bottom triangle below the diagonal is all 0’s), then the determinant equals the product of the 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 is zero.
  4. If a matrix contains either a row or column of 0’s, the determinant is 0.
  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.

Try it Now Answers

  1. D=5, D_x=15, D_y=-35, x=3, y=-7
  2. D=-10
  3. D=-10, D_x=20, D_y=-6, D_z=-24, x=-2, y= .6, z=-2.4

 

Media Attributions


  1. This section adapted from OpenStax College Algebra by Jay Abramson, Arizona State University, et. al. under a Creative Commons License 4.0 CC-BY

License

Icon for the Creative Commons Attribution-ShareAlike 4.0 International License

College Algebra for the Managerial Sciences Copyright © by Terri Manthey is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book