Lesson Explainer: Cramer’s Rule Mathematics

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: 8496𝑥𝑦=89.

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 Δ: Δ=||8496||=(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 Δ: Δ=||8496||=(8×6)(4×9)=4836=12.

Finally, we will calculate Δ: Δ=||8899||=(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, 8174127=87487=567=8.

In the second equation, 9176127=97727=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: 9836𝑥𝑦=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: Δ=||8876||Δ=||9837||.and

The next stage is to calculate the required determinants. We will start with Δ: Δ=||9836||=(9×6)(8×3)=5424=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 Δ: Δ=||8876||=(8×6)(8×7)=48+56=8.

Finally, we will calculate Δ: Δ=||9837||=(9×7)(8×3)=6324=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, 𝑦=8778=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: 523312521𝑥𝑦𝑧=513.

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: Δ=||||523112321||||.

The next stage is to calculate the required determinants; we will start with Δ: Δ=||||523312521||||=5||1221||2||3251||3||3152||=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 Δ: Δ=||||523112321||||=5||1221||2||1231||3||1132||=5(5)2(7)3(1)=42.

Then, we will calculate Δ: Δ=||||553312531||||=5||1231||+5||3251||3||3153||=5(7)+5(13)3(4)=112.

Finally, we will calculate Δ: Δ=||||525311523||||=5||1123||2||3153||5||3152||=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 014250503𝑥𝑦𝑧=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: Δ=||||231413505103||||.

The next stage is to calculate the required determinants; we will start with Δ: Δ=||||014250503||||=0||5003||+1||2053||+4||2550||=0+1(60)+4(0+25)=106.

Next, we will calculate Δ: Δ=||||231413505103||||=23||5003||+1||130513||+4||135510||=23(15)+1(39)+4(255)=636.

Then, we will calculate Δ: Δ=||||023421305513||||=0||130513||23||2053||+4||213551||=023(6)+4(167)=530.

Finally, we will calculate Δ: Δ=||||012325135051||||=0||513051||+1||213551||+23||2550||=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.

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