Three equations as one
Take the three equations x + 2y + 3z = 14, y + 4z = 14 and 5x + 6y = 17. There are three unknowns, x, y and z, and each equation is one row of a matrix equation.
Two of the equations have a term missing. The second has no x term, so its coefficient of x is 0: it is 0x + y + 4z = 14. The third has no z term, so it is 5x + 6y + 0z = 17. Each 0 is written in, in the column of the unknown that is missing, so that every column of coefficients belongs to one unknown.
The coefficients make A = (1 2 3; 0 1 4; 5 6 0), the unknowns make the column X = (x; y; z), and the numbers on the right make b = (14; 14; 17). The three equations are now the single equation A X = b.
Multiplying back out
Each row of A times X gives back one equation. Row 1 gives 1 × x + 2 × y + 3 × z, which must equal 14: that is x + 2y + 3z = 14. Row 3 gives 5 × x + 6 × y + 0 × z, which must equal 17, and the 0 × z term is 0, so it is 5x + 6y = 17.
Row 3 of A times the column of unknowns is 5x + 6y + 0z, and it equals the bottom entry of b: 5x + 6y = 17.
One step to X
The step is the same as for two equations. Multiply both sides of A X = b on the left by the inverse of A. Since and I times X is X, the equation becomes .
The inverse must stand on the left. Written on the right, is a 3 × 1 times a 3 × 3, which cannot be found, and there is no dividing by a matrix.
This A has determinant 1, and its inverse, found from the cofactors, is the matrix (−24 18 5; 20 −15 −4; −5 4 1).
The product
Multiply the inverse by b = (14; 14; 17), row by column. Row 1 gives x = −24 × 14 + 18 × 14 + 5 × 17. The first two terms together are −6 × 14 = −84, so x = −84 + 85 = 1.
Row 2 gives y = 20 × 14 − 15 × 14 − 4 × 17 = 5 × 14 − 68 = 70 − 68 = 2. Row 3 gives z = −5 × 14 + 4 × 14 + 1 × 17 = −14 + 17 = 3.
So X is the column (1; 2; 3): x = 1, y = 2 and z = 3, all three unknowns from one product.
Row 2 of the inverse with the column b gives 20 × 14 − 15 × 14 − 4 × 17 = 2, the middle entry, which is y.
Checking in all three
Substitute x = 1, y = 2 and z = 3 into each equation. The first gives 1 + 2 × 2 + 3 × 3 = 1 + 4 + 9 = 14. The second gives 2 + 4 × 3 = 14. The third gives 5 × 1 + 6 × 2 = 5 + 12 = 17. All three hold.
Each of the three equations is a plane in space, and (1, 2, 3) is the one point that lies on all three planes. A point that fits only two of the equations is not a solution, so the check uses all three.
The same inverse, new totals
The inverse depends only on the coefficients. If the totals change to 7, 5 and 16, multiply the same inverse by (7; 5; 16). Row 1 gives −24 × 7 + 18 × 5 + 5 × 16 = −168 + 90 + 80 = 2; row 2 gives 20 × 7 − 15 × 5 − 4 × 16 = 140 − 75 − 64 = 1; and row 3 gives −5 × 7 + 4 × 5 + 1 × 16 = −35 + 20 + 16 = 1.
So x = 2, y = 1 and z = 1. Check: 2 + 2 + 3 = 7, 1 + 4 = 5 and 10 + 6 = 16. Finding the inverse takes work, but once it is found, every new set of totals costs one product.
When det A is 0
The method needs an inverse, and a 3 × 3 matrix has one only when its determinant is not 0. For the equations x + 2y + 3z = 6, 2x + 4y + 6z = 12 and 3x + y + z = 5, row 2 of the matrix, 2, 4, 6, is twice row 1, 1, 2, 3. The determinant is 0 and there is no inverse.
Here the second equation is the first one doubled, so it says nothing new, and two equations cannot fix three unknowns. In other systems with determinant 0 the equations contradict each other and there is no solution at all. Either way there is no single answer for an inverse to find. A coefficient of 0 is no problem: the matrix A above has two of them and an inverse.
Row 2 is twice row 1, so the determinant of this matrix is 0 and it has no inverse.
The usual mistakes
Reading the wrong row of the answer. X was built as the column (x; y; z), so the top entry is x, the middle entry is y and the bottom entry is z.
Giving a total as an unknown. The 17 in b is the right side of the third equation, not the value of z.
Losing a missing term. The third equation, 5x + 6y = 17, makes the row 5, 6, 0; leaving out the 0, or writing 0, 5, 6, puts the coefficients under the wrong unknowns.
Multiplying on the right, as , which cannot be found. The inverse goes on the left, where A was.
Feeding two herds
In the application below, three feeds each supply protein, fiber and fat. One equation for each nutrient gives a matrix with determinant 4, and its inverse is found once and then used for two herds with different needs.
Worked example: Three Animal Feeds Mixed to Supply Exact Amounts of Protein, Fiber and Fat
Question A farmer mixes three feeds. Each kilogram of feed A supplies 2 units of protein, 1 of fiber and 1 of fat; each kilogram of feed B supplies 1, 2 and 1; and each kilogram of feed C supplies 1, 1 and 2. A herd needs 14 units of protein, 12 of fiber and 10 of fat a day. (a) Using a, b and c kg of feeds A, B and C, write the needs as a matrix equation, find the inverse of its matrix, and find how much of each feed the herd needs a day. (b) A second herd needs 12 units of protein, 11 of fiber and 9 of fat. Use the same inverse to find how much of each feed it needs.
1.Protein gives 2a + b + c = 14, fiber gives a + 2b + c = 12 and fat gives a + b + 2c = 10, so Mabc = 141210 with M = 211121112.
One row for each nutrient and one column for each feed: M = 211121112, and Mabc = 141210. 2.Expand along the first row: det M = 2 × (4 − 1) − 1 × (2 − 1) + 1 × (1 − 2) = 6 − 1 − 1 = 4.
Expanding along the first row: det M = 2 × 3 − 1 × 1 + 1 × (−1) = 4. 3.Each entry on the leading diagonal has the minor 2 × 2 − 1 × 1 = 3. Every entry off the diagonal has a minor of 1 or −1, and with the sign from the pattern each of those cofactors is −1. So the cofactors are 3−1−1−13−1−1−13, which is its own transpose.
The minors on the diagonal are 3, and every other cofactor is −1: the cofactors are 3−1−1−13−1−1−13. 4.Divide the transposed cofactors by det M = 4: M−1 = 143−1−1−13−1−1−13.
M−1 = 143−1−1−13−1−1−13. 5.(a) M−1141210 = 1442 − 12 − 10−14 + 36 − 10−14 − 12 + 30 = 1420124 = 531: the herd needs 5 kg of A, 3 kg of B and 1 kg of C. Check: adding the three equations gives 4(a + b + c) = 36, so a + b + c = 9, and then protein gives a = 14 − 9 = 5.
(a) M−1141210 = 1420124 = 531: 5 kg of A, 3 kg of B and 1 kg of C. 6.(b) The same inverse serves the second herd: 1436 − 11 − 9−12 + 33 − 9−12 − 11 + 27 = 1416124 = 431, so it needs 4 kg of A, 3 kg of B and 1 kg of C. Check: 2 × 4 + 3 + 1 = 12, 4 + 6 + 1 = 11 and 4 + 3 + 2 = 9.
(b) M−112119 = 1416124 = 431: 4 kg of A, 3 kg of B and 1 kg of C.
Answer: (a) M = 211121112 and M−1 = 143−1−1−13−1−1−13; the herd needs 5 kg of A, 3 kg of B and 1 kg of C; (b) 4 kg of A, 3 kg of B and 1 kg of C
Common mistakes
- Leaving out the 14. The transposed cofactors are 4M−1, not M−1, and they give 20 kg of feed A, which alone supplies 40 units of protein, far more than 14.
- Putting each feed in a row instead of a column. Here M happens to equal its own transpose, so the slip does no harm, but each equation is one nutrient, so in general the rows must be the nutrients and each feed's amounts must run down a column.
More determinants and inverses problems, worked step by step →