Solving Systems with Cramer Rule
June 23, 2024 | by Bloom Code Studio
Learning Objectives
In this section, you will:
- 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.
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 × 2 MATRIX
The determinant of a 2×22×2 matrix, given
A=[acbd]𝐴=[𝑎𝑏𝑐𝑑]
is defined as
Notice the change in notation. There are several ways to indicate the determinant, including det(A)det(𝐴) and replacing the brackets in a matrix with straight lines, |A|.|𝐴|.
EXAMPLE 1
Finding the Determinant of a 2 × 2 Matrix
Find the determinant of the given matrix.
A=[5−623]𝐴=[52−63]
Solution
det(A)=∣∣∣5−623∣∣∣=5(3)−(−6)(2)=27det(𝐴)=|52−63|=5(3)−(−6)(2)=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 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.
a1x+b1y=c1(1)a2x+b2y=c2(2)𝑎1𝑥+𝑏1𝑦=𝑐1(1)𝑎2𝑥+𝑏2𝑦=𝑐2(2)
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.
b2a1x+b2b1y=b2c1−b1a2x−b1b2y=−b1c2Multiply R1by b2Multiply R2by−b1________________________________________________________ b2a1x−b1a2x=b2c1−b1c2𝑏2𝑎1𝑥+𝑏2𝑏1𝑦=𝑏2𝑐1Multiply 𝑅1by 𝑏2−𝑏1𝑎2𝑥−𝑏1𝑏2𝑦=−𝑏1𝑐2Multiply 𝑅2by−𝑏1________________________________________________________ 𝑏2𝑎1𝑥−𝑏1𝑎2𝑥=𝑏2𝑐1−𝑏1𝑐2
Now, solve for x.𝑥.
b2a1x−b1a2x=b2c1−b1c2x(b2a1−b1a2)=b2c1−b1c2 x=b2c1−b1c2b2a1−b1a2=∣∣∣c1c2b1b2∣∣∣∣∣∣a1a2b1b2∣∣∣𝑏2𝑎1𝑥−𝑏1𝑎2𝑥=𝑏2𝑐1−𝑏1𝑐2𝑥(𝑏2𝑎1−𝑏1𝑎2)=𝑏2𝑐1−𝑏1𝑐2 𝑥=𝑏2𝑐1−𝑏1𝑐2𝑏2𝑎1−𝑏1𝑎2=|𝑐1𝑏1𝑐2𝑏2||𝑎1𝑏1𝑎2𝑏2|
Similarly, to solve for y,𝑦, we will eliminate x.𝑥.
a2a1x+a2b1y=a2c1−a1a2x−a1b2y=−a1c2Multiply R1by a2Multiply R2by−a1________________________________________________________a2b1y−a1b2y=a2c1−a1c2𝑎2𝑎1𝑥+𝑎2𝑏1𝑦=𝑎2𝑐1Multiply 𝑅1by 𝑎2−𝑎1𝑎2𝑥−𝑎1𝑏2𝑦=−𝑎1𝑐2Multiply 𝑅2by−𝑎1________________________________________________________𝑎2𝑏1𝑦−𝑎1𝑏2𝑦=𝑎2𝑐1−𝑎1𝑐2
Solving for y𝑦 gives
a2b1y−a1b2y=a2c1−a1c2y(a2b1−a1b2)=a2c1−a1c2 y=a2c1−a1c2a2b1−a1b2=a1c2−a2c1a1b2−a2b1=∣∣∣a1a2c1c2∣∣∣∣∣∣a1a2b1b2∣∣∣𝑎2𝑏1𝑦−𝑎1𝑏2𝑦=𝑎2𝑐1−𝑎1𝑐2𝑦(𝑎2𝑏1−𝑎1𝑏2)=𝑎2𝑐1−𝑎1𝑐2 𝑦=𝑎2𝑐1−𝑎1𝑐2𝑎2𝑏1−𝑎1𝑏2=𝑎1𝑐2−𝑎2𝑐1𝑎1𝑏2−𝑎2𝑏1=|𝑎1𝑐1𝑎2𝑐2||𝑎1𝑏1𝑎2𝑏2|
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𝑥 and y,𝑦, but Cramer’s Rule also introduces new notation:
- D:𝐷: determinant of the coefficient matrix
- Dx:𝐷𝑥: determinant of the numerator in the solution of x𝑥x=DxD𝑥=𝐷𝑥𝐷
- Dy:𝐷𝑦: determinant of the numerator in the solution of y𝑦y=DyD𝑦=𝐷𝑦𝐷
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 x𝑥 and y𝑦 as a quotient of two determinants.
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.
a1x+b1y=c1a2x+b2y=c2𝑎1𝑥+𝑏1𝑦=𝑐1𝑎2𝑥+𝑏2𝑦=𝑐2
The solution using Cramer’s Rule is given as
x=DxD=∣∣∣c1c2b1b2∣∣∣∣∣∣a1a2b1b2∣∣∣,D≠0;y=DyD=∣∣∣a1a2c1c2∣∣∣∣∣∣a1a2b1b2∣∣∣,D≠0.𝑥=𝐷𝑥𝐷=|𝑐1𝑏1𝑐2𝑏2||𝑎1𝑏1𝑎2𝑏2|,𝐷≠0;𝑦=𝐷𝑦𝐷=|𝑎1𝑐1𝑎2𝑐2||𝑎1𝑏1𝑎2𝑏2|,𝐷≠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 2
Using Cramer’s Rule to Solve a 2 × 2 System
Solve the following 2×22×2 system using Cramer’s Rule.
12x+3y=15 2x−3y=1312𝑥+3𝑦=15 2𝑥−3𝑦=13
Solution
Solve for x.𝑥.
x=DxD=∣∣∣15133−3∣∣∣∣∣∣1223−3∣∣∣=−45−39−36−6=−84−42=2𝑥=𝐷𝑥𝐷=|15313−3||1232−3|=−45−39−36−6=−84−42=2
Solve for y.𝑦.
y=DyD=∣∣∣1221513∣∣∣∣∣∣1223−3∣∣∣=156−30−36−6=−12642=−3𝑦=𝐷𝑦𝐷=|1215213||1232−3|=156−30−36−6=−12642=−3
The solution is (2,−3).(2,−3).
TRY IT #1
Use Cramer’s Rule to solve the 2 × 2 system of equations.
x+2y=−11−2x+y=−13 𝑥+2𝑦=−11−2𝑥+𝑦=−13
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=⎡⎣⎢a1a2a3b1b2b3c1c2c3⎤⎦⎥𝐴=[𝑎1𝑏1𝑐1𝑎2𝑏2𝑐2𝑎3𝑏3𝑐3]
- Augment A𝐴 with the first two columns.det(A)=∣∣∣∣a1a2a3b1b2b3c1c2c3∣∣∣∣a1a2a3b1b2b3∣∣∣∣det(𝐴)=|𝑎1𝑏1𝑐1𝑎2𝑏2𝑐2𝑎3𝑏3𝑐3|𝑎1𝑎2𝑎3𝑏1𝑏2𝑏3|
- 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.
- 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|=a1b2c3+b1c2a3+c1a2b3−a3b2c1−b3c2a1−c3a2b1|𝐴|=𝑎1𝑏2𝑐3+𝑏1𝑐2𝑎3+𝑐1𝑎2𝑏3−𝑎3𝑏2𝑐1−𝑏3𝑐2𝑎1−𝑐3𝑎2𝑏1
EXAMPLE 3
Finding the Determinant of a 3 × 3 Matrix
Find the determinant of the 3 × 3 matrix given
A=⎡⎣⎢0342−10111⎤⎦⎥𝐴=[0213−11401]
Solution
Augment the matrix with the first two columns and then follow the formula. Thus,
|A|=∣∣∣∣0342−10111∣∣∣∣0342−10∣∣∣∣=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|𝐴|=|0213−11401|0342−10|=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
TRY IT #2
Find the determinant of the 3 × 3 matrix.
det(A)=∣∣∣∣111−31−2713∣∣∣∣det(𝐴)=|1−371111−23|
Q&A
Can we use the same method to find the determinant of a larger matrix?
No, this method only works for 2×22×2 and 3×33×3 matrices. 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.
x=DxD,y=DyD,z=DzD,D≠0𝑥=𝐷𝑥𝐷,𝑦=𝐷𝑦𝐷,𝑧=𝐷𝑧𝐷,𝐷≠0
where
If we are writing the determinant Dx,𝐷𝑥, we replace the x𝑥 column with the constant column. If we are writing the determinant Dy,𝐷𝑦, we replace the y𝑦 column with the constant column. If we are writing the determinant Dz,𝐷𝑧, we replace the z𝑧 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.
x+y−z=63x−2y+z=−5x+3y−2z=14𝑥+𝑦−𝑧=63𝑥−2𝑦+𝑧=−5𝑥+3𝑦−2𝑧=14
Solution
Use Cramer’s Rule.
D=∣∣∣∣1311−23−11−2∣∣∣∣,Dx=∣∣∣∣6−5141−23−11−2∣∣∣∣,Dy=∣∣∣∣1316−514−11−2∣∣∣∣,Dz=∣∣∣∣1311−236−514∣∣∣∣𝐷=|11−13−2113−2|,𝐷𝑥=|61−1−5−21143−2|,𝐷𝑦=|16−13−51114−2|,𝐷𝑧=|1163−2−51314|
Then,
x=DxD=−3−3=1y=DyD=−9−3=3z=DzD=6−3=−2𝑥=𝐷𝑥𝐷=−3−3=1𝑦=𝐷𝑦𝐷=−9−3=3𝑧=𝐷𝑧𝐷=6−3=−2
The solution is (1,3,−2).(1,3,−2).
TRY IT #3
Use Cramer’s Rule to solve the 3 × 3 matrix.
x−3y+7z=13x+y+z=1x−2y+3z=4𝑥−3𝑦+7𝑧=13𝑥+𝑦+𝑧=1𝑥−2𝑦+3𝑧=4
EXAMPLE 5
Using Cramer’s Rule to Solve an Inconsistent System
Solve the system of equations using Cramer’s Rule.
3x−2y=4 (1)6x−4y=0 (2)3𝑥−2𝑦=4 (1)6𝑥−4𝑦=0 (2)
Solution
We begin by finding the determinants D,Dx,and Dy.𝐷,𝐷𝑥,and 𝐷𝑦.
D=∣∣∣36−2−4∣∣∣=3(−4)−6(−2)=0𝐷=|3−26−4|=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.
- Multiply equation (1) by −2.−2.
- Add the result to equation (2).(2).
−6x+4y=−86x−4y=0_______________0=−8−6𝑥+4𝑦=−86𝑥−4𝑦=0_______________0=−8
We obtain the equation 0=−8,0=−8, which is false. Therefore, the system has no solution. Graphing the system reveals two parallel lines. See Figure 1.
Figure 1
EXAMPLE 6
Use Cramer’s Rule to Solve a Dependent System
Solve the system with an infinite number of solutions.
x−2y+3z=03x+y−2z=02x−4y+6z=0(1)(2)(3)𝑥−2𝑦+3𝑧=0(1)3𝑥+𝑦−2𝑧=0(2)2𝑥−4𝑦+6𝑧=0(3)
Solution
Let’s find the determinant first. Set up a matrix augmented by the first two columns.
∣∣∣∣132−21−43−26 ∣∣∣∣ 132−21−4∣∣∣∣|1−2331−22−46 | 1−2312−4|
Then,
1(1)(6)+(−2)(−2)(2)+3(3)(−4)−2(1)(3)−(−4)(−2)(1)−6(3)(−2)=01(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.
- Multiply equation (1) by −2−2 and add the result to equation (3):−2x+4y−6z=02x−4y+6z=00=0−2𝑥+4𝑦−6𝑧=02𝑥−4𝑦+6𝑧=00=0
- Obtaining an answer of 0=0,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 Figure 2.
Figure 2
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.
PROPERTIES OF DETERMINANTS
- 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𝐴−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.
EXAMPLE 7
Illustrating Properties of Determinants
Illustrate each of the properties of determinants.
Solution
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=⎡⎣⎢10022031−1⎤⎦⎥𝐴=[12302100−1]
Augment A𝐴 with the first two columns.
A=⎡⎣⎢10022031−1∣∣∣∣100220⎤⎦⎥𝐴=[12302100−1|100220]
Then
det(A)=1(2)(−1)+2(1)(0)+3(0)(0)−0(2)(3)−0(1)(1)+1(0)(2)=−2det(𝐴)=1(2)(−1)+2(1)(0)+3(0)(0)−0(2)(3)−0(1)(1)+1(0)(2)=−2
Property 2 states that interchanging rows changes the sign. Given
A=[−145−3],det(A)=(−1)(−3)−(4)(5)=3−20=−17B=[4−1−35],det(B)=(4)(5)−(−1)(−3)=20−3=17𝐴=[−154−3],det(𝐴)=(−1)(−3)−(4)(5)=3−20=−17𝐵=[4−3−15],det(𝐵)=(4)(5)−(−1)(−3)=20−3=17
Property 3 states that if two rows or two columns are identical, the determinant equals zero.
A=⎡⎣⎢12−1222222 ∣∣∣∣ 12−1 222⎤⎦⎥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𝐴=[122222−122 | 12−1 222]det(𝐴)=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
Property 4 states that if a row or column equals zero, the determinant equals zero. Thus,
A=[1020],det(A)=1(0)−2(0)=0𝐴=[1200],det(𝐴)=1(0)−2(0)=0
Property 5 states that the determinant of an inverse matrix A−1𝐴−1 is the reciprocal of the determinant A.𝐴. Thus,
A=[1324],det(A)=1(4)−3(2)=−2A−1=[−2321−12],det(A−1)=−2(−12)−(32)(1)=−12𝐴=[1234],det(𝐴)=1(4)−3(2)=−2𝐴−1=[−2132−12],det(𝐴−1)=−2(−12)−(32)(1)=−12
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,
A=[1324],det(A)=1(4)−2(3)=−2B=[2(1)32(2)4],det(B)=2(4)−3(4)=−4𝐴=[1234],det(𝐴)=1(4)−2(3)=−2𝐵=[2(1)2(2)34],det(𝐵)=2(4)−3(4)=−4
EXAMPLE 8
Using Cramer’s Rule and Determinant Properties to Solve a System
Find the solution to the given 3 × 3 system.
2x+4y+4z=23x+7y+7z=−5 x+2y+2z=4(1)(2)(3)2𝑥+4𝑦+4𝑧=2(1)3𝑥+7𝑦+7𝑧=−5(2) 𝑥+2𝑦+2𝑧=4(3)
Solution
Using Cramer’s Rule, we have
D=∣∣∣∣231472472∣∣∣∣𝐷=|244377122|
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.
- Multiply equation (3) by –2 and add the result to equation (1).−2x−4y−4x=−8 2x+4y+4z=20=−6−2𝑥−4𝑦−4𝑥=−8 2𝑥+4𝑦+4𝑧=20=−6
Obtaining a statement that is a contradiction means that the system has no solution.
RELATED POSTS
View all