- Foundation
- About 16 min
- 5 practice questions
Solving three equations: Cramer's rule and the matrix method
Write a system of equations as AX = B, solve two and three unknowns by Cramer's rule with the replaced-column determinants, and use the value of the main determinant to see whether a unique solution exists.
If something looks wrong, please tell us.
A system of linear equations can be packaged as a matrix equation. This lesson shows two ways of solving it with determinants. Both need the main determinant to be non-zero.
Writing a system as AX = B
The system 3x + 2y = 8 and x + 4y = 6 is written as [3 2; 1 4] times the column (x, y) equals the column (8, 6). The coefficient matrix is A = [3 2; 1 4], the unknowns form the column X, and the constants form the column B. For three unknowns the matrix is 3 × 3 in the same way.
Cramer's rule
Let Δ be the determinant of the coefficient matrix. Let Δx be the determinant obtained by replacing the column of x-coefficients by the constants column; define Δy and Δz in the same way. If Δ ≠ 0, the system has exactly one solution: x = Δx/Δ, y = Δy/Δ, z = Δz/Δ.
Cramer's rule: x = Δx/Δ, y = Δy/Δ, z = Δz/Δ, where each numerator replaces the matching column of the coefficient matrix by the constants. It requires Δ ≠ 0.
Worked example 1: two unknowns
Solve 3x + 2y = 8 and x + 4y = 6. Δ = 3·4 − 2·1 = 10. Δx replaces the first column with (8, 6): Δx = 8·4 − 2·6 = 32 − 12 = 20. Δy replaces the second column: Δy = 3·6 − 8·1 = 18 − 8 = 10. So x = 20/10 = 2 and y = 10/10 = 1. Check: 3(2) + 2(1) = 8 and 2 + 4(1) = 6.
Worked example 2: three unknowns
Solve x + y + z = 6, 2x − y + z = 3, x + 2y − z = 2. The coefficient rows are (1, 1, 1), (2, −1, 1), (1, 2, −1). Δ = 1((−1)(−1) − (1)(2)) − 1((2)(−1) − (1)(1)) + 1((2)(2) − (−1)(1)) = 1(1 − 2) − 1(−2 − 1) + 1(4 + 1) = −1 + 3 + 5 = 7. For Δx, replace the first column by (6, 3, 2): Δx = 6(1 − 2) − 1(−3 − 2) + 1(6 + 2) = −6 + 5 + 8 = 7. For Δy, replace the second column: rows (1, 6, 1), (2, 3, 1), (1, 2, −1). Δy = 1(−3 − 2) − 6(−2 − 1) + 1(4 − 3) = −5 + 18 + 1 = 14. For Δz, rows (1, 1, 6), (2, −1, 3), (1, 2, 2): Δz = 1(−2 − 6) − 1(4 − 3) + 6(4 + 1) = −8 − 1 + 30 = 21. So x = 7/7 = 1, y = 14/7 = 2, z = 21/7 = 3. Check in the first equation: 1 + 2 + 3 = 6.
The matrix method in brief
Since AX = B, when Δ ≠ 0 the inverse exists and X = A⁻¹B. For two unknowns, A⁻¹ = (1/Δ)[d −b; −c a] for A = [a b; c d]. With A = [3 2; 1 4], A⁻¹ = (1/10)[4 −2; −1 3], and X = (1/10)[4·8 − 2·6; −8 + 18] = (1/10)[20; 10] = (2, 1), the same result.
What if Δ = 0?
Then neither Cramer's rule nor the inverse can be used. The system either has no solution or has infinitely many; you cannot say which from Δ alone. For example, x + y = 2 and 2x + 2y = 4 has Δ = 0 and infinitely many solutions, while x + y = 2 and 2x + 2y = 5 has Δ = 0 and none. The advanced course shows how to decide.
Key takeaways: write AX = B; Δ ≠ 0 means one solution; replace one column at a time to get Δx, Δy, Δz; check the answer in an original equation; if Δ = 0, stop and investigate.
Check your understanding
-
1. In Cramer's rule, Δx is formed by:
- replacing the first row by the constants
- multiplying Δ by x
- replacing every column by the constants
- replacing the x-column by the constants
Show answer
Answer: D. Δx is the determinant of the coefficient matrix with the column of x-coefficients replaced by the column of constants.
-
2. For 3x + 2y = 8 and x + 4y = 6, what is x?
- 1
- 2
- 10
- 20
Show answer
Answer: B. Δ = 10 and Δx = 20, so x = 2.
-
3. In the three-equation example, what is Δ?
- −7
- 14
- 7
- 21
Show answer
Answer: C. Δ = −1 + 3 + 5 = 7.
-
4. In that example, what is y = Δy/Δ?
- 2
- 3
- 1
- 14
Show answer
Answer: A. Δy = 14 and Δ = 7, so y = 2.
-
5. If Δ = 0 for a system of equations, then:
- the solution is x = y = 0
- there is always exactly one solution
- Cramer's rule cannot be used
- the system has no solution
Show answer
Answer: C. Division by Δ is impossible. The system has no solution or infinitely many, and Δ alone cannot say which.
Sign in to keep track of the lessons you finish.