Lesson Explainer: Cramer’s Rule | Nagwa Lesson Explainer: Cramer’s Rule | Nagwa

Lesson Explainer: Cramer’s Rule Mathematics • First Year of Secondary School

Join Nagwa Classes

Attend live Mathematics sessions on Nagwa Classes to learn more about this topic from an expert teacher!

In this explainer, we will learn how to use Cramer’s rule to solve a system of linear equations.

This will involve using determinants to solve systems of two and three linear equations.

Cramer’s rule gives us a useful way of solving simultaneous equations; for example, it allows us to solve a system of equations for one variable independently without having to solve for all the variables.

Cramer’s rule was devised by Gabriel Cramer, a Genevan mathematician, in 1750, and what he devised was a way of solving a system of linear equations using a matrix equation and the determinants of the matrices involved.

We are now going to look at Cramer’s rule and how it is used. Let’s start with a system of two linear equations.

Definition: Cramer’s Rule for a System of Two Linear Equations in Two Unknowns

If we have the following system of two linear equations in two unknowns, π‘₯ and 𝑦, with constants π‘Žβ€“π‘“, π‘Žπ‘₯+𝑏𝑦=𝑒𝑐π‘₯+𝑑𝑦=𝑓, which can be converted to the matrix equation ο€Όπ‘Žπ‘π‘π‘‘οˆο€»π‘₯𝑦=ο€Όπ‘’π‘“οˆ, Cramer’s rule tells us that if the determinant of the coefficient matrix is nonzero, then π‘₯=|||𝑒𝑏𝑓𝑑||||||π‘Žπ‘π‘π‘‘|||=π‘’π‘‘βˆ’π‘π‘“π‘Žπ‘‘βˆ’π‘π‘π‘¦=|||π‘Žπ‘’π‘π‘“||||||π‘Žπ‘π‘π‘‘|||=π‘Žπ‘“βˆ’π‘’π‘π‘Žπ‘‘βˆ’π‘π‘and is the unique solution to this system of equations.

This is often simplified to π‘₯=ΔΔ,𝑦=ΔΔ,ο—ο˜ where Ξ”=|||𝑒𝑏𝑓𝑑|||, Ξ”=|||π‘Žπ‘’π‘π‘“|||, and Ξ”=|||π‘Žπ‘π‘π‘‘||| are the determinants of the matrices found by substituting the elements of the constants matrix with the elements from the columns of the π‘₯- and 𝑦-coefficients and the determinant of the coefficient matrix. Cramer’s rule can be extended to any number of linear equations. For example, for a system of three equations in three unknowns, we get the following.

Definition: Cramer’s Rule for a System of Three Equations in Three Unknowns

If we have the following system of three linear equations in three unknowns, π‘₯, 𝑦, and 𝑧, with constants π‘Žβ€“π‘™, π‘Žπ‘₯+𝑏𝑦+𝑐𝑧=𝑗,𝑑π‘₯+𝑒𝑦+𝑓𝑧=π‘˜,𝑔π‘₯+β„Žπ‘¦+𝑖𝑧=𝑙, which can be converted to the matrix equation οƒπ‘Žπ‘π‘π‘‘π‘’π‘“π‘”β„Žπ‘–οο€Ώπ‘₯𝑦𝑧=ο‚π‘—π‘˜π‘™οŽ, Cramer’s rule tells us that if Ξ” is nonzero, then π‘₯=ΔΔ,𝑦=ΔΔ,𝑧=Ξ”Ξ”ο—ο˜ο™ is the unique solution to this system of equations, where Ξ”=||||π‘—π‘π‘π‘˜π‘’π‘“π‘™β„Žπ‘–||||, Ξ”=|||||π‘Žπ‘—π‘π‘‘π‘˜π‘“π‘”π‘™π‘–|||||, Ξ”=||||π‘Žπ‘π‘—π‘‘π‘’π‘˜π‘”β„Žπ‘™||||, and Ξ”=||||π‘Žπ‘π‘π‘‘π‘’π‘“π‘”β„Žπ‘–|||| are the determinants of the matrices found by substituting the elements of the constants matrix with the elements from the columns of the π‘₯-, 𝑦-, and 𝑧-coefficients and the determinant of the coefficient matrix.

However, it is worth pointing out Cramer’s rule can be generalized to 𝑛 linear equations in 𝑛 unknowns and different notation may be seen; for example, for the determinant of a matrix, you might see 𝐷 or |Ξ”|. In this explainer, we will use notation in the form Δ and we will only deal with systems of linear equations with at most 3 unknowns.

Now we know what Cramer’s rule is and how to use it, but where does it come from?

To see where Cramer’s rule comes from, let’s attempt to solve the following system of linear equations: π‘Žπ‘₯+𝑏𝑦=π‘Ÿ,𝑐π‘₯+𝑑𝑦=π‘Ÿ.

We want to eliminate a variable; assuming both 𝑏 and 𝑑 are nonzero, we multiply the top equation by 𝑑 and the bottom equation by 𝑏 and then subtract: π‘Žπ‘‘π‘₯+𝑏𝑑𝑦=π‘‘π‘Ÿπ‘π‘π‘₯+𝑏𝑑𝑦=π‘π‘Ÿπ‘Žπ‘‘π‘₯βˆ’π‘π‘π‘₯=π‘‘π‘Ÿβˆ’π‘π‘Ÿ.

Factoring this gives us (π‘Žπ‘‘βˆ’π‘π‘)π‘₯=π‘‘π‘Ÿβˆ’π‘π‘Ÿ.

Finally, if π‘Žπ‘‘βˆ’π‘π‘β‰ 0, π‘₯=π‘‘π‘Ÿβˆ’π‘π‘Ÿπ‘Žπ‘‘βˆ’π‘π‘.

In our notation, this is ΔΔ; we could do exactly the same for 𝑦. In fact, we can do the same for higher-order matrices, provided the determinant is nonzero.

Now, for our first example, we are going to look at a question that explains a condition of the rule.

Example 1: Determining the Applicability of Cramer’s Rule in Solving a System of Linear Equations with an Infinite Solution Set

Is Cramer’s rule useful for finding solutions to systems of linear equations in which there is an infinite set of solutions?

Answer

The short answer to this question is no, as Cramer’s rule is not applicable when the system of linear equations has an infinite number of solutions.

Let us explore why. There are two ways for a system of linear equations to have an infinite number of solutions. First, there could be more variables than equations. In this case, Cramer’s rule is not applicable since we need the coefficient matrix to be square. Second, if the determinant of the coefficient matrix is zero, then there can be an infinite number of solutions or zero solutions. However, as we can see in our formula for Cramer’s rule, we divide by the determinant of the coefficient matrix; we cannot do this if it is equal to zero. Hence, Cramer’s rule is not applicable.

So, we can conclude that Cramer’s rule would not be useful for finding the solutions to systems of linear equations in which there is an infinite set of solutions.

We have now looked at the conditions of the rule, but before we move on to looking at examples of how to use the rule, we will quickly recap how to find the determinant of 2Γ—2 and 3Γ—3 matrices.

How To: Finding the Determinant of a 2 Γ— 2 and a 3 Γ— 3 Matrix

If we begin with a 2Γ—2 matrix, ο€Όπ‘Žπ‘π‘π‘‘οˆ, then

We get this result by subtracting the product of the diagonals.

Now, for a 3Γ—3 matrix, οƒπ‘Žπ‘π‘π‘‘π‘’π‘“π‘”β„Žπ‘–ο, then, using the first row to find the determinant, we get

When looking at the determinant of a 3Γ—3 matrix, an important key point to remember is that the coefficients, that you multiply the 2Γ—2 matrix minors by, the pattern +, βˆ’, + as shown above.

At this point, we also remember that the determinant can be calculated using any row or column.

Let us recap how we found the 2Γ—2 cofactor:

If we take the element a and then we delete the column and row that it is in, then the four remaining elements form our cofactor.

Having reminded ourselves how to find determinants, we will now look at some examples of using Cramer’s rule to solve systems of linear equations.

Example 2: Solving a System of Two Equations Using Determinants

Use determinants to solve the system βˆ’8π‘₯βˆ’4𝑦=βˆ’8,9π‘₯βˆ’6𝑦=βˆ’9.

Answer

The first step is to set up a matrix equation for our system of equations: ο€Όβˆ’8βˆ’49βˆ’6οˆο€»π‘₯𝑦=ο€Όβˆ’8βˆ’9.

Now, as we are looking to solve the system of equations using determinants, we will recall Cramer’s rule.

Provided Ξ” is nonzero, π‘₯=ΔΔ,𝑦=Ξ”Ξ”ο—ο˜ is the unique solution to this system of equations, where Δ and Ξ”ο˜ are the determinants of the matrices found by substituting the elements of the constants matrix with the elements from the columns of the π‘₯- and 𝑦-coefficients, as follows:

To apply Cramer’s rule, we need to determine Ξ”, Δ, and Ξ”ο˜. We will start with Ξ”: Ξ”=||βˆ’8βˆ’49βˆ’6||=(βˆ’8Γ—βˆ’6)βˆ’(βˆ’4Γ—9)=48+36=84.

With this result, not only have we found Ξ”, but since Ξ” is nonzero, we have shown that we can find a unique solution to our system of equations.

Next, we will calculate Δ: Ξ”=||βˆ’8βˆ’4βˆ’9βˆ’6||=(βˆ’8Γ—βˆ’6)βˆ’(βˆ’4Γ—βˆ’9)=48βˆ’36=12.

Finally, we will calculate Ξ”ο˜: Ξ”=||βˆ’8βˆ’89βˆ’9||=(βˆ’8Γ—βˆ’9)βˆ’(βˆ’8Γ—9)=72+72=144.

We will now substitute in the values for our determinants into the solution given by Cramer’s rule to find the values of π‘₯ and 𝑦: π‘₯=ΔΔ,Ξ”=12,Ξ”=84; therefore, π‘₯=1284=17.

Now, if we look at 𝑦, 𝑦=ΔΔ,Ξ”=144,Ξ”=84; therefore, 𝑦=14484=127.

In conclusion, we can say that the unique solution to the system of linear equations is π‘₯=17𝑦=127.and

At this point, we can perform a quick check by substituting the values of π‘₯ and 𝑦 into the original set of equations to check that both equations are satisfied, as follows: βˆ’8π‘₯βˆ’4𝑦=βˆ’8,βœ“9π‘₯βˆ’6𝑦=βˆ’9.βœ“

In the first equation, βˆ’8ο€Ό17οˆβˆ’4ο€Ό127=βˆ’87βˆ’487=βˆ’567=βˆ’8.βœ“

In the second equation, 9ο€Ό17οˆβˆ’6ο€Ό127=97βˆ’727=βˆ’637=βˆ’9.βœ“

In our next example, we will look at a problem in which the system of equations will need to be rearranged before solving.

Example 3: Solving a System of Two Equations Using Determinants

Use determinants to solve the system βˆ’9π‘₯=βˆ’8+8𝑦,6𝑦=7+3π‘₯.

Answer

In this question, we are asked to solve a system of two linear equations in two variables. We could do this by eliminating a variable; however, we will use Cramer’s rule.

For a system of equations with two unknowns, Cramer’s rule states that if Ξ” is nonzero, then π‘₯=ΔΔ,𝑦=Ξ”Ξ”ο—ο˜ is the unique solution to the system.

Therefore, the first step is to rearrange our equations into a form that can be easily converted into a matrix equation: βˆ’9π‘₯βˆ’8𝑦=βˆ’8,βˆ’3π‘₯+6𝑦=7.

Now that we have our system in this form, we set up a matrix equation: ο€Όβˆ’9βˆ’8βˆ’36οˆο€»π‘₯𝑦=ο€Όβˆ’87.

At this point, we remember that Δ and Ξ”ο˜ are the determinants of the matrices found as a result of substituting the elements of the constants matrix with the elements from the columns of the π‘₯- and 𝑦-coefficients, as follows: Ξ”=||βˆ’8βˆ’876||Ξ”=||βˆ’9βˆ’8βˆ’37||.ο—ο˜and

The next stage is to calculate the required determinants. We will start with Ξ”: Ξ”=||βˆ’9βˆ’8βˆ’36||=(βˆ’9Γ—6)βˆ’(βˆ’8Γ—βˆ’3)=βˆ’54βˆ’24=βˆ’78.

With this result, not only have we found Ξ”, but we have also shown that we can solve our system of equations, since the determinant of the coefficient matrix is not zero.

Next, we will calculate Δ: Ξ”=||βˆ’8βˆ’876||=(βˆ’8Γ—6)βˆ’(βˆ’8Γ—7)=βˆ’48+56=8.

Finally, we will calculate Ξ”ο˜: Ξ”=||βˆ’9βˆ’8βˆ’37||=(βˆ’9Γ—7)βˆ’(βˆ’8Γ—βˆ’3)=βˆ’63βˆ’24=βˆ’87.

We have everything we need to use Cramer’s rule to solve our system of equations. We will now substitute in the values for the determinants to find the values of π‘₯ and 𝑦: π‘₯=ΔΔ,Ξ”=8,Ξ”=βˆ’78; therefore, π‘₯=βˆ’878=βˆ’439.

Now, if we calculate 𝑦, 𝑦=ΔΔ,Ξ”=βˆ’87,Ξ”=βˆ’78; therefore, 𝑦=βˆ’87βˆ’78=2926.

In conclusion, we can say that the unique solution to the system of equations is π‘₯=βˆ’439𝑦=2926.and

In the previous two examples, we have looked at problems involving two unknowns. In the next example, we will look at a system of three linear equations with three unknowns.

Example 4: Solving a System of Three Equations Using Determinants

Use determinants to solve the system 5π‘₯=βˆ’2π‘¦βˆ’5+3𝑧,βˆ’3π‘₯βˆ’π‘¦+1=2𝑧,2π‘¦βˆ’π‘§=βˆ’5π‘₯+3.

Answer

To solve a system of three equations in three unknowns by using determinants, we can use Cramer’s rule provided that the determinant of the coefficient matrix is nonzero.

Then, the unique solution is given by π‘₯=ΔΔ,𝑦=ΔΔ,𝑧=ΔΔ.ο—ο˜ο™

The first step is to rearrange our equations so that we have the constant terms on their own. We do this so that the system can be easily converted into a matrix equation: 5π‘₯+2π‘¦βˆ’3𝑧=βˆ’5,βˆ’3π‘₯βˆ’π‘¦βˆ’2𝑧=βˆ’1,5π‘₯+2π‘¦βˆ’π‘§=3.

Now that we have our system in this form, we set up a matrix equation: 52βˆ’3βˆ’3βˆ’1βˆ’252βˆ’1οŒο€Ώπ‘₯𝑦𝑧=ο€βˆ’5βˆ’13.

Next, using Cramer’s rule, we remember that Δ, Ξ”ο˜, and Δ are the determinants of the matrices that are the result of substituting the elements of the constants matrix with the elements from the columns of the π‘₯-, 𝑦-, and 𝑧-coefficients, as follows: Ξ”=||||βˆ’52βˆ’3βˆ’1βˆ’1βˆ’232βˆ’1||||.

The next stage is to calculate the required determinants; we will start with Ξ”: Ξ”=||||52βˆ’3βˆ’3βˆ’1βˆ’252βˆ’1||||=5||βˆ’1βˆ’22βˆ’1||βˆ’2||βˆ’3βˆ’25βˆ’1||βˆ’3||βˆ’3βˆ’152||=5(1+4)βˆ’2(3+10)βˆ’3(βˆ’6+5)=2.

With this result, not only have we found Ξ”, but we have also shown that we can find a unique solution to our system of equations. This is because the value of Ξ” is nonzero.

Next, we will calculate Δ: Ξ”=||||βˆ’52βˆ’3βˆ’1βˆ’1βˆ’232βˆ’1||||=βˆ’5||βˆ’1βˆ’22βˆ’1||βˆ’2||βˆ’1βˆ’23βˆ’1||βˆ’3||βˆ’1βˆ’132||=βˆ’5(5)βˆ’2(7)βˆ’3(1)=βˆ’42.

Then, we will calculate Ξ”ο˜: Ξ”=||||5βˆ’5βˆ’3βˆ’3βˆ’1βˆ’253βˆ’1||||=5||βˆ’1βˆ’23βˆ’1||+5||βˆ’3βˆ’25βˆ’1||βˆ’3||βˆ’3βˆ’153||=5(7)+5(13)βˆ’3(βˆ’4)=112.

Finally, we will calculate Δ: Ξ”=||||52βˆ’5βˆ’3βˆ’1βˆ’1523||||=5||βˆ’1βˆ’123||βˆ’2||βˆ’3βˆ’153||βˆ’5||βˆ’3βˆ’152||=5(βˆ’1)βˆ’2(βˆ’4)βˆ’5(βˆ’1)=8.

Now, we have everything we need to use Cramer’s rule to solve our system of equations; we substitute our values for the determinants into the unique solution given by Cramer’s rule to find the values of π‘₯, 𝑦, and 𝑧 as follows: π‘₯=ΔΔ,Ξ”=βˆ’42,Ξ”=2; therefore, π‘₯=βˆ’422=βˆ’21.

Now, we calculate 𝑦: 𝑦=ΔΔ,Ξ”=112,Ξ”=2; therefore, 𝑦=1122=56.

Finally, we calculate 𝑧: 𝑧=ΔΔ,Ξ”=8,Ξ”=2; therefore, 𝑧=82=4.

In conclusion, we can say that the unique solution to the system of linear equations is π‘₯=βˆ’21,𝑦=56,𝑧=4.and

For the final example, we will look at a question where the system of equations is given in terms of determinants.

Example 5: Solving a System of Three Equations Using Determinants

Solve, using Cramer’s rule, the simultaneous equations |||βˆ’1π‘§βˆ’4𝑦|||=23,|||2π‘¦βˆ’5π‘₯|||=13,||3π‘₯5𝑧||=51.

Answer

To enable us to use Cramer’s rule in this problem, the first step is to evaluate the determinants of the 2Γ—2 matrices: |||βˆ’1π‘§βˆ’4𝑦|||=(βˆ’1×𝑦)βˆ’(𝑧×(βˆ’4))=βˆ’π‘¦+4𝑧,|||2π‘¦βˆ’5π‘₯|||=(2Γ—π‘₯)βˆ’(𝑦×(βˆ’5))=2π‘₯+5𝑦,||3π‘₯5𝑧||=(3×𝑧)βˆ’(π‘₯Γ—5)=βˆ’5π‘₯+3𝑧.

Now that we have the determinants, we can form a system of three equations that can then be used to set up a matrix equation: βˆ’π‘¦+4𝑧=23,2π‘₯+5𝑦=13,βˆ’5π‘₯+3𝑧=51.

As we have been asked to solve the system of equations using determinants, we are going to recall Cramer’s rule: if the determinant of the coefficient matrix is nonzero, then there is a unique solution to the system given by π‘₯=ΔΔ,𝑦=ΔΔ,𝑧=ΔΔ.ο—ο˜ο™

To apply Cramer’s rule, we will rewrite the system as a matrix equation; however, we need to be careful to include zero coefficients in our coefficient matrix. To help us do this, we can rewrite our system of equations to include the zero coefficients before writing it as a matrix equation: 0π‘₯βˆ’π‘¦+4𝑧=23,2π‘₯+5𝑦+0𝑧=13,βˆ’5π‘₯+0𝑦+3𝑧=51.

When written as a matrix equation, we get 0βˆ’14250βˆ’503οŒο€Ώπ‘₯𝑦𝑧=231351.

At this point, we remember that Δ, Ξ”ο˜, and Δ, from Cramer’s rule, are the determinants of the matrices that are formed as a result of substituting the elements of the constants matrix with the elements from the columns of the π‘₯-, 𝑦-, and 𝑧-coefficients, as follows: Ξ”=||||23βˆ’1413505103||||.

The next stage is to calculate the required determinants; we will start with Ξ”: Ξ”=||||0βˆ’14250βˆ’503||||=0||5003||+1||20βˆ’53||+4||25βˆ’50||=0+1(6βˆ’0)+4(0+25)=106.

Next, we will calculate Δ: Ξ”=||||23βˆ’1413505103||||=23||5003||+1||130513||+4||135510||=23(15)+1(39)+4(βˆ’255)=βˆ’636.

Then, we will calculate Ξ”ο˜: Ξ”=||||02342130βˆ’5513||||=0||130513||βˆ’23||20βˆ’53||+4||213βˆ’551||=0βˆ’23(6)+4(167)=530.

Finally, we will calculate Δ: Ξ”=||||0βˆ’1232513βˆ’5051||||=0||513051||+1||213βˆ’551||+23||25βˆ’50||=0+1(167)+23(25)=742.

We will now substitute our values for the determinants into the unique solution from Cramer’s rule to find our values of π‘₯, 𝑦, and 𝑧: π‘₯=ΔΔ,Ξ”=βˆ’636,Ξ”=106; therefore, π‘₯=βˆ’636106=βˆ’6.

Now, we calculate 𝑦: 𝑦=ΔΔ,Ξ”=530,Ξ”=106; therefore, 𝑦=530106=5.

Finally, we will look at 𝑧: 𝑧=ΔΔ,Ξ”=742,Ξ”=106; therefore, 𝑧=742160=7.

In conclusion, we can say that the unique solution to the system of linear equations is π‘₯=βˆ’6,𝑦=5,𝑧=7.and

Let us finish by recapping some basic points.

Key Points

  • For the following system of equations with two unknowns, π‘Žπ‘₯+𝑏𝑦=𝑒𝑐π‘₯+𝑑𝑦=𝑓, Cramer’s rule tells us that if Ξ” is nonzero, then the system has a unique solution given by π‘₯=ΔΔ,𝑦=ΔΔ.ο—ο˜
  • For the following system of equations with three unknowns, π‘Žπ‘₯+𝑏𝑦+𝑐𝑧=𝑗,𝑑π‘₯+𝑒𝑦+𝑓𝑧=π‘˜,𝑔π‘₯+β„Žπ‘¦+𝑖𝑧=𝑙, Cramer’s rule tells us that if Ξ” is nonzero, then the system has a unique solution given by π‘₯=ΔΔ,𝑦=ΔΔ,𝑧=ΔΔ.ο—ο˜ο™
  • Cramer’s rule can be extended to 𝑛 linear equations in 𝑛 unknowns.
  • To find Δ, Ξ”ο˜, or Δ, we substitute the values in the constants matrix for the column in the coefficient matrix that is identified and find the determinant of the newly formed matrix.
  • A necessary condition of Cramer’s rule is that the determinant of the coefficient matrix Ξ” is not equal to zero.

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy