maths.freeLinear Algebra › 9. Systems of Equations and Inequalities › Solving Systems with Cramer's Rule

Solving Systems with Cramer's Rule

Evaluate 2 × 2 determinants.

Solving Systems with Cramer's Rule

  • Use Cramer’s Rule to solve systems of equations (IA 4.6.3)

Cramer’s Rule uses determinants to solve systems of equations.

Example

Try it.

Use Cramer’s rule to solve the system of equations.

\(\left\{\begin{array}{l}-2x+3y=3 \\ x+3y=12\end{array}\right\)

Solution
Evaluate the determinant of the system by using the coefficients of the variables \(D=\left|\begin{array}{ll}-2 & 3 \\ 1 & 3\end{array}\right|=-6-3=-9\)
Evaluate the determinant Dx. Replace the coefficients of the variable x, -2 and 1, by the constants 3 and 12 \({D}_{x}=\left|\begin{array}{ll}3 & 3 \\ 12 & 3\end{array}\right|=9-36=-27\)
Evaluate the determinant Dy. Replace the coefficients of the variable y, 3 and 3, by the constants 3 and 12 \({D}_{y}=\left|\begin{array}{ll}-2 & 3 \\ 1 & 12\end{array}\right|=-24-3=-27\)
Find x and y \(\begin{array}{l}x=\frac{{D}_{x}}{D}=\frac{-27}{-9}=3 \\ y=\frac{{D}_{y}}{D}=\frac{-27}{-9}=3\end{array}\)
Write the solution as an ordered pair \((3,3)\)
Check the solution in the original equations

Try it.

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

\(\left\{\begin{array}{l}3x+8y=-3 \\ 2x+5y=-3\end{array}\right\)

Example

Try it.

Solve the system of equations using Cramer’s Rule: \(\{\begin{array}{l}3x-5y+4z=5 \\ 5x+2y+z=0 \\ 2x+3y-2z=3\end{array}.\)

Solution

Evaluate the determinant D.
Expand by minors using column 1.
Evaluate the determinants.
Simplify.
Simplify.
Simplify.
Evaluate the determinant \({D}_{x}.\) Use the
constants to replace the coefficients of x.
Expand by minors using column 1.
Evaluate the determinants.
Simplify.
Simplify.
Evaluate the determinant \({D}_{y}.\) Use the
constants to replace the coefficients of y.
Evaluate the determinants.
Simplify.
Simplify.
Simplify.
Evaluate the determinant \({D}_{z}.\) Use the
constants to replace the coefficients of z.
Evaluate the determinants.
Simplify.
Simplify.
Simplify.
Find x, y, and z.
Substitute in the values.
Simplify.
Write the solution as an ordered triple.
Check that the ordered triple is a solution
to all three original equations.
We leave the check to you.
The solution is \((2,-3,-4).\)

Try it.

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

\(\left\{\begin{array}{l}3x+8y+2z=-5 \\ 2x+5y-3z=0 \\ x+2y-2z=-1\end{array}\right\)

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.

Example

Try it.

Find the determinant of the given matrix.

\[A=[\begin{array}{ll}5 & 2 \\ -6 & 3\end{array}]\]
Solution\[\begin{array}{lll}\text{det}(A)=|\begin{array}{ll}5 & 2 \\ -6 & 3\end{array}| \\ =5(3)-(-6)(2) \\ =27\end{array}\]

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{array}{l}{a}_{1}x+{b}_{1}y={c}_{1}\ (1) \\ {a}_{2}x+{b}_{2}y={c}_{2}\ (2)\end{array}\]

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{array}{llllllllll}\underset{________________________________________________________}{\begin{array}{llll} & & & \\ {b}_{2}{a}_{1}x+{b}_{2}{b}_{1}y={b}_{2}{c}_{1} & & & \text{Multiply }{R}_{1}\ \text{by }{b}_{2} \\ -{b}_{1}{a}_{2}x-{b}_{1}{b}_{2}y=-{b}_{1}{c}_{2} & & & \text{Multiply }{R}_{2}\ \text{by}-{b}_{1}\end{array}} \\ \begin{array}{ll}{b}_{2}{a}_{1}x-{b}_{1}{a}_{2}x={b}_{2}{c}_{1}-{b}_{1}{c}_{2} & \end{array}\end{array}\]

Now, solve for \(x.\)

\[\begin{array}{lllll}{b}_{2}{a}_{1}x-{b}_{1}{a}_{2}x={b}_{2}{c}_{1}-{b}_{1}{c}_{2} \\ x({b}_{2}{a}_{1}-{b}_{1}{a}_{2})={b}_{2}{c}_{1}-{b}_{1}{c}_{2} \\ x=\frac{{b}_{2}{c}_{1}-{b}_{1}{c}_{2}}{{b}_{2}{a}_{1}-{b}_{1}{a}_{2}}=\frac{|\begin{array}{ll}{c}_{1} & {b}_{1} \\ {c}_{2} & {b}_{2}\end{array}|}{|\begin{array}{ll}{a}_{1} & {b}_{1} \\ {a}_{2} & {b}_{2}\end{array}|}\end{array}\]

Similarly, to solve for \(y,\) we will eliminate \(x.\)

Solving for \(y\) gives

  • \(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}\]

Condensed — the full section is in OpenStax College Algebra 2e.

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=[\begin{array}{lll}{a}_{1} & {b}_{1} & {c}_{1} \\ {a}_{2} & {b}_{2} & {c}_{2} \\ {a}_{3} & {b}_{3} & {c}_{3}\end{array}]\]
  1. Augment \(A\) with the first two columns. \[\text{det}(A)=|\begin{array}{lll}{a}_{1} & {b}_{1} & {c}_{1} \\ {a}_{2} & {b}_{2} & {c}_{2} \\ {a}_{3} & {b}_{3} & {c}_{3}\end{array}|\begin{array}{l}{a}_{1} \\ {a}_{2} \\ {a}_{3}\end{array}\begin{array}{l}{b}_{1} \\ {b}_{2} \\ {b}_{3}\end{array}|\]
  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.

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

Try it.

Find the determinant of the 3 × 3 matrix given

\[A=[\begin{array}{lll}0 & 2 & 1 \\ 3 & -1 & 1 \\ 4 & 0 & 1\end{array}]\]
Solution

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

\[\begin{array}{lllllll}|A|=|\begin{array}{lll}0 & 2 & 1 \\ 3 & -1 & 1 \\ 4 & 0 & 1\end{array}|\begin{array}{l}0 \\ 3 \\ 4\end{array}\begin{array}{l}2 \\ -1 \\ 0\end{array}| \\ =0(-1)(1)+2(1)(4)+1(3)(0)-4(-1)(1)-0(1)(0)-1(3)(2) \\ =0+8+0+4-0-6 \\ =6\end{array}\]

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.

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

where

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

Try it.

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

\[\begin{array}{l}x+y-z=6 \\ 3x-2y+z=-5 \\ x+3y-2z=14\end{array}\]
Solution

Use Cramer’s Rule.

\[D=|\begin{array}{lll}1 & 1 & -1 \\ 3 & -2 & 1 \\ 1 & 3 & -2\end{array}|,{D}_{x}=|\begin{array}{lll}6 & 1 & -1 \\ -5 & -2 & 1 \\ 14 & 3 & -2\end{array}|,{D}_{y}=|\begin{array}{lll}1 & 6 & -1 \\ 3 & -5 & 1 \\ 1 & 14 & -2\end{array}|,{D}_{z}=|\begin{array}{lll}1 & 1 & 6 \\ 3 & -2 & -5 \\ 1 & 3 & 14\end{array}|\]

Then,

\[\begin{array}{l}x=\frac{{D}_{x}}{D}=\frac{-3}{-3}=1 \\ y=\frac{{D}_{y}}{D}=\frac{-9}{-3}=3 \\ z=\frac{{D}_{z}}{D}=\frac{6}{-3}=-2\end{array}\]

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

Condensed — the full section is in OpenStax College Algebra 2e.

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.

Example

Try it.

Find the solution to the given 3 × 3 system.

\[\begin{array}{ll}2x+4y+4z=2 & (1) \\ 3x+7y+7z=-5 & (2) \\ x+2y+2z=4 & (3)\end{array}\]
Solution

Using Cramer’s Rule, we have

\[D=|\begin{array}{lll}2 & 4 & 4 \\ 3 & 7 & 7 \\ 1 & 2 & 2\end{array}|\]

Notice that the second and third columns are identical. According to Property 3, the determinant will be zero, so there is either no solution or an infinite number of solutions. We have to perform elimination to find out.

  1. Multiply equation (3) by –2 and add the result to equation (1). \[\frac{\begin{array}{l}-2x-4y-4x=-8 \\ \ 2x+4y+4z=2\ \end{array}}{\ 0=-6}\]

Obtaining a statement that is a contradiction means that the system has no solution.

Condensed — the full section is in OpenStax College Algebra 2e.

Key Concepts

  • The determinant for \([\begin{array}{ll}a & b \\ c & d\end{array}]\) is \(ad-bc.\) See .
  • Cramer’s Rule replaces a variable column with the constant column. Solutions are \(x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D}.\) See .
  • 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). See .
  • 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}.\) See .
  • Cramer’s Rule is also useful for finding the solution of a system of equations with no solution or infinite solutions. See and .
  • 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. See and .

Solving Systems with Cramer's Rule

  • Use Cramer’s Rule to solve systems of equations (IA 4.6.3)

Cramer’s Rule uses determinants to solve systems of equations.

Example

Try it.

Use Cramer’s rule to solve the system of equations.

\(\left\{\begin{array}{l}-2x+3y=3 \\ x+3y=12\end{array}\right\)

Solution
Evaluate the determinant of the system by using the coefficients of the variables \(D=\left|\begin{array}{ll}-2 & 3 \\ 1 & 3\end{array}\right|=-6-3=-9\)
Evaluate the determinant Dx. Replace the coefficients of the variable x, -2 and 1, by the constants 3 and 12 \({D}_{x}=\left|\begin{array}{ll}3 & 3 \\ 12 & 3\end{array}\right|=9-36=-27\)
Evaluate the determinant Dy. Replace the coefficients of the variable y, 3 and 3, by the constants 3 and 12 \({D}_{y}=\left|\begin{array}{ll}-2 & 3 \\ 1 & 12\end{array}\right|=-24-3=-27\)
Find x and y \(\begin{array}{l}x=\frac{{D}_{x}}{D}=\frac{-27}{-9}=3 \\ y=\frac{{D}_{y}}{D}=\frac{-27}{-9}=3\end{array}\)
Write the solution as an ordered pair \((3,3)\)
Check the solution in the original equations

Try it.

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

\(\left\{\begin{array}{l}3x+8y=-3 \\ 2x+5y=-3\end{array}\right\)

Example

Try it.

Solve the system of equations using Cramer’s Rule: \(\{\begin{array}{l}3x-5y+4z=5 \\ 5x+2y+z=0 \\ 2x+3y-2z=3\end{array}.\)

Solution

Evaluate the determinant D.
Expand by minors using column 1.
Evaluate the determinants.
Simplify.
Simplify.
Simplify.
Evaluate the determinant \({D}_{x}.\) Use the
constants to replace the coefficients of x.
Expand by minors using column 1.
Evaluate the determinants.
Simplify.
Simplify.
Evaluate the determinant \({D}_{y}.\) Use the
constants to replace the coefficients of y.
Evaluate the determinants.
Simplify.
Simplify.
Simplify.
Evaluate the determinant \({D}_{z}.\) Use the
constants to replace the coefficients of z.
Evaluate the determinants.
Simplify.
Simplify.
Simplify.
Find x, y, and z.
Substitute in the values.
Simplify.
Write the solution as an ordered triple.
Check that the ordered triple is a solution
to all three original equations.
We leave the check to you.
The solution is \((2,-3,-4).\)

Try it.

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

\(\left\{\begin{array}{l}3x+8y+2z=-5 \\ 2x+5y-3z=0 \\ x+2y-2z=-1\end{array}\right\)

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.

Example

Try it.

Find the determinant of the given matrix.

\[A=[\begin{array}{ll}5 & 2 \\ -6 & 3\end{array}]\]
Solution\[\begin{array}{lll}\text{det}(A)=|\begin{array}{ll}5 & 2 \\ -6 & 3\end{array}| \\ =5(3)-(-6)(2) \\ =27\end{array}\]

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{array}{l}{a}_{1}x+{b}_{1}y={c}_{1}\ (1) \\ {a}_{2}x+{b}_{2}y={c}_{2}\ (2)\end{array}\]

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{array}{llllllllll}\underset{________________________________________________________}{\begin{array}{llll} & & & \\ {b}_{2}{a}_{1}x+{b}_{2}{b}_{1}y={b}_{2}{c}_{1} & & & \text{Multiply }{R}_{1}\ \text{by }{b}_{2} \\ -{b}_{1}{a}_{2}x-{b}_{1}{b}_{2}y=-{b}_{1}{c}_{2} & & & \text{Multiply }{R}_{2}\ \text{by}-{b}_{1}\end{array}} \\ \begin{array}{ll}{b}_{2}{a}_{1}x-{b}_{1}{a}_{2}x={b}_{2}{c}_{1}-{b}_{1}{c}_{2} & \end{array}\end{array}\]

Now, solve for \(x.\)

\[\begin{array}{lllll}{b}_{2}{a}_{1}x-{b}_{1}{a}_{2}x={b}_{2}{c}_{1}-{b}_{1}{c}_{2} \\ x({b}_{2}{a}_{1}-{b}_{1}{a}_{2})={b}_{2}{c}_{1}-{b}_{1}{c}_{2} \\ x=\frac{{b}_{2}{c}_{1}-{b}_{1}{c}_{2}}{{b}_{2}{a}_{1}-{b}_{1}{a}_{2}}=\frac{|\begin{array}{ll}{c}_{1} & {b}_{1} \\ {c}_{2} & {b}_{2}\end{array}|}{|\begin{array}{ll}{a}_{1} & {b}_{1} \\ {a}_{2} & {b}_{2}\end{array}|}\end{array}\]

Similarly, to solve for \(y,\) we will eliminate \(x.\)

Solving for \(y\) gives

  • \(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}\]

Condensed — the full section is in OpenStax Precalculus 2e.

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=[\begin{array}{lll}{a}_{1} & {b}_{1} & {c}_{1} \\ {a}_{2} & {b}_{2} & {c}_{2} \\ {a}_{3} & {b}_{3} & {c}_{3}\end{array}]\]
  1. Augment \(A\) with the first two columns. \[\text{det}(A)=|\begin{array}{lll}{a}_{1} & {b}_{1} & {c}_{1} \\ {a}_{2} & {b}_{2} & {c}_{2} \\ {a}_{3} & {b}_{3} & {c}_{3}\end{array}|\begin{array}{l}{a}_{1} \\ {a}_{2} \\ {a}_{3}\end{array}\begin{array}{l}{b}_{1} \\ {b}_{2} \\ {b}_{3}\end{array}|\]
  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.

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

Try it.

Find the determinant of the 3 × 3 matrix given

\[A=[\begin{array}{lll}0 & 2 & 1 \\ 3 & -1 & 1 \\ 4 & 0 & 1\end{array}]\]
Solution

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

\[\begin{array}{lllllll}|A|=|\begin{array}{lll}0 & 2 & 1 \\ 3 & -1 & 1 \\ 4 & 0 & 1\end{array}|\begin{array}{l}0 \\ 3 \\ 4\end{array}\begin{array}{l}2 \\ -1 \\ 0\end{array}| \\ =0(-1)(1)+2(1)(4)+1(3)(0)-4(-1)(1)-0(1)(0)-1(3)(2) \\ =0+8+0+4-0-6 \\ =6\end{array}\]

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.

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

where

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

Try it.

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

\[\begin{array}{l}x+y-z=6 \\ 3x-2y+z=-5 \\ x+3y-2z=14\end{array}\]
Solution

Use Cramer’s Rule.

\[D=|\begin{array}{lll}1 & 1 & -1 \\ 3 & -2 & 1 \\ 1 & 3 & -2\end{array}|,{D}_{x}=|\begin{array}{lll}6 & 1 & -1 \\ -5 & -2 & 1 \\ 14 & 3 & -2\end{array}|,{D}_{y}=|\begin{array}{lll}1 & 6 & -1 \\ 3 & -5 & 1 \\ 1 & 14 & -2\end{array}|,{D}_{z}=|\begin{array}{lll}1 & 1 & 6 \\ 3 & -2 & -5 \\ 1 & 3 & 14\end{array}|\]

Then,

\[\begin{array}{l}x=\frac{{D}_{x}}{D}=\frac{-3}{-3}=1 \\ y=\frac{{D}_{y}}{D}=\frac{-9}{-3}=3 \\ z=\frac{{D}_{z}}{D}=\frac{6}{-3}=-2\end{array}\]

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

Condensed — the full section is in OpenStax Precalculus 2e.

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.

Example

Try it.

Find the solution to the given 3 × 3 system.

\[\begin{array}{ll}2x+4y+4z=2 & (1) \\ 3x+7y+7z=-5 & (2) \\ x+2y+2z=4 & (3)\end{array}\]
Solution

Using Cramer’s Rule, we have

\[D=|\begin{array}{lll}2 & 4 & 4 \\ 3 & 7 & 7 \\ 1 & 2 & 2\end{array}|\]

Notice that the second and third columns are identical. According to Property 3, the determinant will be zero, so there is either no solution or an infinite number of solutions. We have to perform elimination to find out.

  1. Multiply equation (3) by –2 and add the result to equation (1). \[\frac{\begin{array}{l}-2x-4y-4x=-8 \\ \ 2x+4y+4z=2\ \end{array}}{\ 0=-6}\]

Obtaining a statement that is a contradiction means that the system has no solution.

Condensed — the full section is in OpenStax Precalculus 2e.

Key Concepts

  • The determinant for \([\begin{array}{ll}a & b \\ c & d\end{array}]\) is \(ad-bc.\) See .
  • Cramer’s Rule replaces a variable column with the constant column. Solutions are \(x=\frac{{D}_{x}}{D},y=\frac{{D}_{y}}{D}.\) See .
  • 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). See .
  • 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}.\) See .
  • Cramer’s Rule is also useful for finding the solution of a system of equations with no solution or infinite solutions. See and .
  • 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. See and .

Practice (40)

Try each one on paper first. Reveal the answer to check; verified ones can be opened in the solver for every step.

  1. Use Cramer’s rule to solve the system of equations.

    \(\left\{\begin{array}{l}-2x+3y=3 \\ x+3y=12\end{array}\right\)

    Bonisa impendulo
    Evaluate the determinant of the system by using the coefficients of the variables \(D=\left|\begin{array}{ll}-2 & 3 \\ 1 & 3\end{array}\right|=-6-3=-9\)
    Evaluate the determinant Dx. Replace the coefficients of the variable x, -2 and 1, by the constants 3 and 12 \({D}_{x}=\left|\begin{array}{ll}3 & 3 \\ 12 & 3\end{array}\right|=9-36=-27\)
    Evaluate the determinant Dy. Replace the coefficients of the variable y, 3 and 3, by the constants 3 and 12 \({D}_{y}=\left|\begin{array}{ll}-2 & 3 \\ 1 & 12\end{array}\right|=-24-3=-27\)
    Find x and y \(\begin{array}{l}x=\frac{{D}_{x}}{D}=\frac{-27}{-9}=3 \\ y=\frac{{D}_{y}}{D}=\frac{-27}{-9}=3\end{array}\)
    Write the solution as an ordered pair \((3,3)\)
    Check the solution in the original equations
  2. Use Cramer’s Rule to solve the system of equations.

    \(\left\{\begin{array}{l}3x+8y=-3 \\ 2x+5y=-3\end{array}\right\)

  3. Solve the system of equations using Cramer’s Rule: \(\{\begin{array}{l}3x-5y+4z=5 \\ 5x+2y+z=0 \\ 2x+3y-2z=3\end{array}.\)

    Bonisa impendulo

    Evaluate the determinant D.
    Expand by minors using column 1.
    Evaluate the determinants.
    Simplify.
    Simplify.
    Simplify.
    Evaluate the determinant \({D}_{x}.\) Use the
    constants to replace the coefficients of x.
    Expand by minors using column 1.
    Evaluate the determinants.
    Simplify.
    Simplify.
    Evaluate the determinant \({D}_{y}.\) Use the
    constants to replace the coefficients of y.
    Evaluate the determinants.
    Simplify.
    Simplify.
    Simplify.
    Evaluate the determinant \({D}_{z}.\) Use the
    constants to replace the coefficients of z.
    Evaluate the determinants.
    Simplify.
    Simplify.
    Simplify.
    Find x, y, and z.
    Substitute in the values.
    Simplify.
    Write the solution as an ordered triple.
    Check that the ordered triple is a solution
    to all three original equations.
    We leave the check to you.
    The solution is \((2,-3,-4).\)

  4. Use Cramer’s Rule to solve the system of three equations.

    \(\left\{\begin{array}{l}3x+8y+2z=-5 \\ 2x+5y-3z=0 \\ x+2y-2z=-1\end{array}\right\)

  5. Find the determinant of the given matrix.

    \[A=[\begin{array}{ll}5 & 2 \\ -6 & 3\end{array}]\]
    Bonisa impendulo
    \[\begin{array}{lll}\text{det}(A)=|\begin{array}{ll}5 & 2 \\ -6 & 3\end{array}| \\ =5(3)-(-6)(2) \\ =27\end{array}\]
  6. Solve the following \(2\times 2\) system using Cramer’s Rule.

    \[\begin{array}{l}12x+3y=15 \\ 2x-3y=13\end{array}\]
    Bonisa impendulo

    Solve for \(x.\)

    \[x=\frac{{D}_{x}}{D}=\frac{|\begin{array}{ll}15 & 3 \\ 13 & -3\end{array}|}{|\begin{array}{ll}12 & 3 \\ 2 & -3\end{array}|}=\frac{-45-39}{-36-6}=\frac{-84}{-42}=2\]

    Solve for \(y.\)

    \[y=\frac{{D}_{y}}{D}=\frac{|\begin{array}{ll}12 & 15 \\ 2 & 13\end{array}|}{|\begin{array}{ll}12 & 3 \\ 2 & -3\end{array}|}=\frac{156-30}{-36-6}=-\frac{126}{42}=-3\]

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

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

    \[\begin{array}{l}\ x+2y=-11 \\ -2x+y=-13\end{array}\]
    Bonisa impendulo

    \((3,-7)\)

  8. Find the determinant of the 3 × 3 matrix given

    \[A=[\begin{array}{lll}0 & 2 & 1 \\ 3 & -1 & 1 \\ 4 & 0 & 1\end{array}]\]
    Bonisa impendulo

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

    \[\begin{array}{lllllll}|A|=|\begin{array}{lll}0 & 2 & 1 \\ 3 & -1 & 1 \\ 4 & 0 & 1\end{array}|\begin{array}{l}0 \\ 3 \\ 4\end{array}\begin{array}{l}2 \\ -1 \\ 0\end{array}| \\ =0(-1)(1)+2(1)(4)+1(3)(0)-4(-1)(1)-0(1)(0)-1(3)(2) \\ =0+8+0+4-0-6 \\ =6\end{array}\]
  9. Find the determinant of the 3 × 3 matrix.

    \[\text{det}(A)=|\begin{array}{lll}1 & -3 & 7 \\ 1 & 1 & 1 \\ 1 & -2 & 3\end{array}|\]
    Bonisa impendulo

    \(-10\)

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

    \[\begin{array}{l}x+y-z=6 \\ 3x-2y+z=-5 \\ x+3y-2z=14\end{array}\]
    Bonisa impendulo

    Use Cramer’s Rule.

    \[D=|\begin{array}{lll}1 & 1 & -1 \\ 3 & -2 & 1 \\ 1 & 3 & -2\end{array}|,{D}_{x}=|\begin{array}{lll}6 & 1 & -1 \\ -5 & -2 & 1 \\ 14 & 3 & -2\end{array}|,{D}_{y}=|\begin{array}{lll}1 & 6 & -1 \\ 3 & -5 & 1 \\ 1 & 14 & -2\end{array}|,{D}_{z}=|\begin{array}{lll}1 & 1 & 6 \\ 3 & -2 & -5 \\ 1 & 3 & 14\end{array}|\]

    Then,

    \[\begin{array}{l}x=\frac{{D}_{x}}{D}=\frac{-3}{-3}=1 \\ y=\frac{{D}_{y}}{D}=\frac{-9}{-3}=3 \\ z=\frac{{D}_{z}}{D}=\frac{6}{-3}=-2\end{array}\]

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

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

    \[\begin{array}{l}x-3y+7z=13 \\ x+y+z=1 \\ x-2y+3z=4\end{array}\]
    Bonisa impendulo

    \((-2,\frac{3}{5},\frac{12}{5})\)

  12. Solve the system of equations using Cramer’s Rule.

    \[\begin{array}{l}3x-2y=4\ (1) \\ 6x-4y=0\ (2)\end{array}\]
    Bonisa impendulo

    We begin by finding the determinants \(D,{D}_{x},\text{and }{D}_{y}.\)

    \[D=|\begin{array}{ll}3 & -2 \\ 6 & -4\end{array}|=3(-4)-6(-2)=0\]

    We know that a determinant of zero means that either the system has no solution or it has an infinite number of solutions. To see which one, we use the process of elimination. Our goal is to eliminate one of the variables.

    1. Multiply equation (1) by \(-2.\)
    2. Add the result to equation \((2).\)
    \[\begin{array}{l}\underset{_______________}{\begin{array}{l}\begin{array}{l} \\ -6x+4y\ =-8\end{array} \\ 6x-4y=0\end{array}} \\ 0=-8\end{array}\]

    We obtain the equation \(0=-8,\) which is false. Therefore, the system has no solution. Graphing the system reveals two parallel lines. See .

  13. Solve the system with an infinite number of solutions.

    \[\begin{array}{ll}x-2y+3z=0 & (1) \\ 3x+y-2z=0 & (2) \\ 2x-4y+6z=0 & (3)\end{array}\]
    Bonisa impendulo

    Let’s find the determinant first. Set up a matrix augmented by the first two columns.

    \[|\begin{array}{lll}1 & -2 & 3 \\ 3 & 1 & -2 \\ 2 & -4 & 6\end{array}\ |\ \begin{array}{ll}1 & -2 \\ 3 & 1 \\ 2 & -4\end{array}|\]

    Then,

    \[1(1)(6)+(-2)(-2)(2)+3(3)(-4)-2(1)(3)-(-4)(-2)(1)-6(3)(-2)=0\]

    As the determinant equals zero, there is either no solution or an infinite number of solutions. We have to perform elimination to find out.

    1. Multiply equation (1) by \(-2\) and add the result to equation (3): \[\frac{\begin{array}{l}-2x+4y-6z=0 \\ 2x-4y+6z=0\end{array}}{0=0}\]
    2. Obtaining an answer of \(0=0,\) a statement that is always true, means that the system has an infinite number of solutions. Graphing the system, we can see that two of the planes are the same and they both intersect the third plane on a line. See .
  14. Illustrate each of the properties of determinants.

    Bonisa impendulo

    Property 1 states that if the matrix is in upper triangular form, the determinant is the product of the entries down the main diagonal.

    \[A=[\begin{array}{lll}1 & 2 & 3 \\ 0 & 2 & 1 \\ 0 & 0 & -1\end{array}]\]

    Augment \(A\) with the first two columns.

    \[A=[\begin{array}{lll}1 & 2 & 3 \\ 0 & 2 & 1 \\ 0 & 0 & -1\end{array}|\begin{array}{l}1 \\ 0 \\ 0\end{array}\begin{array}{l}2 \\ 2 \\ 0\end{array}]\]

    Then

    \[\begin{array}{l}\text{det}(A)=1(2)(-1)+2(1)(0)+3(0)(0)-0(2)(3)-0(1)(1)+1(0)(2) \\ =-2\end{array}\]

    Property 2 states that interchanging rows changes the sign. Given

    \[\begin{array}{lll}\begin{array}{lll} \\ A=[\begin{array}{ll}-1 & 5 \\ 4 & -3\end{array}],\ \text{det}(A)=(-1)(-3)-(4)(5)=3-20=-17\end{array} \\ \\ B=[\begin{array}{ll}4 & -3 \\ -1 & 5\end{array}],\ \text{det}(B)=(4)(5)-(-1)(-3)=20-3=17\end{array}\]

    Property 3 states that if two rows or two columns are identical, the determinant equals zero.

    \[\begin{array}{lllllll}A=[\begin{array}{lll}1 & 2 & 2 \\ 2 & 2 & 2 \\ -1 & 2 & 2\end{array}\ |\ \begin{array}{l}1 \\ 2 \\ -1\end{array}\begin{array}{l}2 \\ 2 \\ 2\end{array}] \\ \\ \text{det}(A)=1(2)(2)+2(2)(-1)+2(2)(2)+1(2)(2)-2(2)(1)-2(2)(2) \\ =4-4+8+4-4-8=0\end{array}\]

    Property 4 states that if a row or column equals zero, the determinant equals zero. Thus,

    \[A=[\begin{array}{ll}1 & 2 \\ 0 & 0\end{array}],\ \text{det}(A)=1(0)-2(0)=0\]

    Property 5 states that the determinant of an inverse matrix \({A}^{-1}\) is the reciprocal of the determinant \(A.\) Thus,

    \[\begin{array}{lll}A=[\begin{array}{ll}1 & 2 \\ 3 & 4\end{array}],\text{det}(A)=1(4)-3(2)=-2 \\ \\ {A}^{-1}=[\begin{array}{ll}-2 & 1 \\ \frac{3}{2} & -\frac{1}{2}\end{array}],\text{det}({A}^{-1})=-2(-\frac{1}{2})-(\frac{3}{2})(1)=-\frac{1}{2}\end{array}\]

    Property 6 states that if any row or column of a matrix is multiplied by a constant, the determinant is multiplied by the same factor. Thus,

    \[\begin{array}{lll}A=[\begin{array}{ll}1 & 2 \\ 3 & 4\end{array}],\text{det}(A)=1(4)-2(3)=-2 \\ \\ B=[\begin{array}{ll}2(1) & 2(2) \\ 3 & 4\end{array}],\text{det}(B)=2(4)-3(4)=-4\end{array}\]
  15. Find the solution to the given 3 × 3 system.

    \[\begin{array}{ll}2x+4y+4z=2 & (1) \\ 3x+7y+7z=-5 & (2) \\ x+2y+2z=4 & (3)\end{array}\]
    Bonisa impendulo

    Using Cramer’s Rule, we have

    \[D=|\begin{array}{lll}2 & 4 & 4 \\ 3 & 7 & 7 \\ 1 & 2 & 2\end{array}|\]

    Notice that the second and third columns are identical. According to Property 3, the determinant will be zero, so there is either no solution or an infinite number of solutions. We have to perform elimination to find out.

    1. Multiply equation (3) by –2 and add the result to equation (1). \[\frac{\begin{array}{l}-2x-4y-4x=-8 \\ \ 2x+4y+4z=2\ \end{array}}{\ 0=-6}\]

    Obtaining a statement that is a contradiction means that the system has no solution.

  16. Explain why we can always evaluate the determinant of a square matrix.

    Bonisa impendulo

    A determinant is the sum and products of the entries in the matrix, so you can always evaluate that product—even if it does end up being 0.

  17. Examining Cramer’s Rule, explain why there is no unique solution to the system when the determinant of your matrix is 0. For simplicity, use a \(2\times 2\) matrix.

  18. Explain what it means in terms of an inverse for a matrix to have a 0 determinant.

    Bonisa impendulo

    The inverse does not exist.

  19. The determinant of \(2\times 2\) matrix \(A\) is 3. If you switch the rows and multiply the first row by 6 and the second row by 2, explain how to find the determinant and provide the answer.

  20. \(|\begin{array}{ll}1 & 2 \\ 3 & 4\end{array}|\)

    Bonisa impendulo

    \(-2\)

  21. \(|\begin{array}{ll}-1 & 2 \\ 3 & -4\end{array}|\)

  22. \(|\begin{array}{ll}2 & -5 \\ -1 & 6\end{array}|\)

    Bonisa impendulo

    \(7\)

  23. \(|\begin{array}{ll}-8 & 4 \\ -1 & 5\end{array}|\)

  24. \(|\begin{array}{ll}1 & 0 \\ 3 & -4\end{array}|\)

    Bonisa impendulo

    \(-4\)

  25. \(|\begin{array}{ll}10 & 20 \\ 0 & -10\end{array}|\)

  26. \(|\begin{array}{ll}10 & 0.2 \\ 5 & 0.1\end{array}|\)

    Bonisa impendulo

    \(0\)

  27. \(|\begin{array}{ll}6 & -3 \\ 8 & 4\end{array}|\)

  28. \(|\begin{array}{ll}-2 & -3 \\ 3.1 & 4,000\end{array}|\)

    Bonisa impendulo

    \(-7,990.7\)

  29. \(|\begin{array}{ll}-1.1 & 0.6 \\ 7.2 & -0.5\end{array}|\)

  30. \(|\begin{array}{lll}-1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & -3\end{array}|\)

    Bonisa impendulo

    \(3\)

  31. \(|\begin{array}{lll}-1 & 4 & 0 \\ 0 & 2 & 3 \\ 0 & 0 & -3\end{array}|\)

  32. \(|\begin{array}{lll}1 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 0\end{array}|\)

    Bonisa impendulo

    \(-1\)

  33. \(|\begin{array}{lll}2 & -3 & 1 \\ 3 & -4 & 1 \\ -5 & 6 & 1\end{array}|\)

  34. \(|\begin{array}{lll}-2 & 1 & 4 \\ -4 & 2 & -8 \\ 2 & -8 & -3\end{array}|\)

    Bonisa impendulo

    \(224\)

  35. \(|\begin{array}{lll}6 & -1 & 2 \\ -4 & -3 & 5 \\ 1 & 9 & -1\end{array}|\)

  36. \(|\begin{array}{lll}5 & 1 & -1 \\ 2 & 3 & 1 \\ 3 & -6 & -3\end{array}|\)

    Bonisa impendulo

    \(15\)

  37. \(|\begin{array}{lll}1.1 & 2 & -1 \\ -4 & 0 & 0 \\ 4.1 & -0.4 & 2.5\end{array}|\)

  38. \(|\begin{array}{lll}2 & -1.6 & 3.1 \\ 1.1 & 3 & -8 \\ -9.3 & 0 & 2\end{array}|\)

    Bonisa impendulo

    \(-17.03\)

  39. \(|\begin{array}{lll}-\frac{1}{2} & \frac{1}{3} & \frac{1}{4} \\ \frac{1}{5} & -\frac{1}{6} & \frac{1}{7} \\ 0 & 0 & \frac{1}{8}\end{array}|\)

  40. \(\begin{array}{l}2x-3y=-1 \\ 4x+5y=9\end{array}\)

    Bonisa impendulo

    \((1,1)\)

Symbols used here

|x|
absolute value / modulus
Distance from zero: |−3| = 3. For a complex number, distance from the origin.
\leq,\ \geq
less/greater than or equal
Inequalities that allow equality; < and > exclude it.
\neq
not equal
The two sides are different.
\mathbf{v},\ \vec{v}
vector
A quantity with magnitude and direction; a column of numbers.
A = \begin{pmatrix} a & b \\ c & d \end{pmatrix}
matrix
A rectangular array of numbers; a linear map.
\det A,\ |A|
determinant
Scaling factor of area/volume under A; zero means singular.
A^{-1},\ A^{T}
inverse, transpose
The matrix that undoes A; A with rows and columns swapped.
\lambda
lambda (eigenvalue)
The factor by which an eigenvector is stretched: Av = λv.
\mathbf{u} \cdot \mathbf{v},\ \|\mathbf{v}\|
dot product, norm
Σ u_i v_i; the length of v, √(v·v).

How to: Solving Systems with Cramer's Rule

  1. Evaluate  2 × 2  determinants.
  2. Use Cramer’s Rule to solve a system of equations in two variables.
  3. Evaluate  3 × 3  determinants.
  4. Use Cramer’s Rule to solve a system of three equations in three variables.
  5. Know the properties of determinants.
  6. Use Cramer’s Rule to solve systems of equations (IA 4.6.3)

Questions people ask

What does a determinant mean geometrically?

It is the factor by which the matrix scales area (2×2) or volume (3×3), with a negative sign if orientation flips. Zero means the matrix flattens space and cannot be undone.

What is an eigenvector?

A direction the matrix does not turn — it only stretches it by the eigenvalue. Along eigenvectors a complicated matrix acts like multiplication by a number.

Why is matrix multiplication not commutative?

Because a matrix is a transformation and AB means "do B, then A". Rotating then reflecting is not the same as reflecting then rotating.

Zama wena

Parts of this page are adapted from OpenStax College Algebra 2e (CC BY-NC-SA 4.0), OpenStax Precalculus 2e (CC BY-NC-SA 4.0). Condensed and re-explained here; errors are ours.

Okuningi Linear Algebra