Solving linear equations using the inverse of a matrix
Write the system as AX = B. If |A| ≠ 0, multiply on the left by A⁻¹ to get the unique solution X = A⁻¹B.
The matrix method, step by step
- 1Write the system as AX = B, with A the coefficient matrix, X = [x; y; z] and B the column of constants.
- 2★Find |A| and show that |A| ≠ 0. This guarantees a unique solution.
- 3Find the cofactors and write adj A, the transpose of the cofactor matrix.
- 4Write A⁻¹ = (1/|A|) adj A.
- 5Multiply X = A⁻¹B, row by column.
- 6Read off x, y and z, and check them in every equation.
★ key step
Example 1: two variables
Solve 2x + 3y = 13 and x − 2y = −4 by the matrix method.
- A = [2, 3; 1, −2], X = [x; y], B = [13; −4]
- |A| = 2 × (−2) − 3 × 1 = −4 − 3 = −7 ≠ 0, so a unique solution exists.
- adj A = [−2, −3; −1, 2]
- A⁻¹ = (−1/7)[−2, −3; −1, 2] = (1/7)[2, 3; 1, −2]
- X = A⁻¹B = (1/7)[2 × 13 + 3 × (−4); 1 × 13 + (−2)(−4)] = (1/7)[14; 21] = [2; 3]
- Check: 2(2) + 3(3) = 13 and 2 − 2(3) = −4. Both hold.
x = 2, y = 3
Example 2: three variables
Solve 2x − y + z = 3, x + 2y − z = 2, 3x + y + 2z = 11 by the matrix method.
- A = [2, −1, 1; 1, 2, −1; 3, 1, 2], B = [3; 2; 11]
- |A| = 2(4 + 1) + 1(2 + 3) + 1(1 − 6) = 10 + 5 − 5 = 10 ≠ 0
- Cofactors: A₁₁ = 5, A₁₂ = −5, A₁₃ = −5; A₂₁ = 3, A₂₂ = 1, A₂₃ = −5; A₃₁ = −1, A₃₂ = 3, A₃₃ = 5
- adj A = [5, 3, −1; −5, 1, 3; −5, −5, 5], so A⁻¹ = (1/10) adj A
- X = (1/10)[15 + 6 − 11; −15 + 2 + 33; −15 − 10 + 55] = (1/10)[10; 20; 30]
- X = [1; 2; 3]. Check: 2 − 2 + 3 = 3, 1 + 4 − 3 = 2, 3 + 2 + 6 = 11.
x = 1, y = 2, z = 3
Example 3: a word problem
Priya buys 2 kg of onions, 1 kg of tomatoes and 1 kg of potatoes for ₹ 130. Ravi buys 1 kg, 2 kg and 1 kg of the same for ₹ 120. Sana buys 1 kg, 1 kg and 2 kg for ₹ 110 (example prices). Find the price per kg of each, using matrices.
- Let the prices per kg be x (onions), y (tomatoes) and z (potatoes).
- 2x + y + z = 130, x + 2y + z = 120, x + y + 2z = 110
- A = [2, 1, 1; 1, 2, 1; 1, 1, 2], |A| = 2(4 − 1) − 1(2 − 1) + 1(1 − 2) = 6 − 1 − 1 = 4 ≠ 0
- adj A = [3, −1, −1; −1, 3, −1; −1, −1, 3], so A⁻¹ = (1/4) adj A
- X = (1/4)[390 − 120 − 110; −130 + 360 − 110; −130 − 120 + 330] = (1/4)[160; 120; 80]
- X = [40; 30; 20]
Onions ₹ 40 per kg, tomatoes ₹ 30 per kg, potatoes ₹ 20 per kg (example prices)
When the question gives you a product
Board questions often give two matrices A and B and ask you to find AB first. If AB = kI, then A⁻¹ = (1/k)B, so no cofactors are needed. Before you use it, check row by row that the coefficients of your equations really form A. Then X = A⁻¹C, where C is the column of constants.
A hostel mess can work out how many kg of rice, dal and vegetables to buy so that meals meet set targets of energy, protein and cost. That is a 3 × 3 system, solved exactly this way.
2 marks: “Solve 3x − 2y = 4 and 5x + 3y = 13 using the inverse of a matrix.” |A| = 9 + 10 = 19. adj A = [3, 2; −5, 3]. X = (1/19)[12 + 26; −20 + 39] = (1/19)[38; 19] = [2; 1]. So x = 2, y = 1.
5 marks: “If A = [1, 2, 0; 0, 1, 1; 1, 0, 2] and B = [2, −4, 2; 1, 2, −1; −1, 2, 1], find AB. Hence solve x + 2y = 5, y + z = 5, x + 2z = 7.” AB = 4I, so A⁻¹ = (1/4)B. The equations are AX = C with C = [5; 5; 7]. X = (1/4)B C = (1/4)[10 − 20 + 14; 5 + 10 − 7; −5 + 10 + 7] = (1/4)[4; 8; 12]. So x = 1, y = 2, z = 3.
AX = B, so X = A⁻¹B: inverse first, B last.