Mathematics Topic

Solving Simultaneous Equations with Matrices

  1. Read notes
  2. Flashcards
  3. Quiz
  4. Confident

Study focus - 3 things

  1. Write two linear equations as AX = B, where A holds the coefficients, X is the column of unknowns and B is the column of constants
  2. When the determinant of A is not 0, A has an inverse and the one solution is X = A^-1 B, with A^-1 multiplied on the LEFT of B; always check by substituting
  3. When the determinant is 0, there is no inverse and no unique solution: the lines are parallel (no solution) or the same line (infinitely many)

Section 1From two equations to one matrix equation

The pair ax + by = e and cx + dy = f can be written as one matrix equation [[a, b], [c, d]] × [[x], [y]] = [[e], [f]], or AX = B for short. Call the grid of x and y multipliers A (the coefficient matrix), put the unknowns in a column X, and put the right-hand numbers in a column B. To check it, multiply out the left side: the first row gives ax + by and the second gives cx + dy, which are the two original left-hand sides. Before you write A and B, rearrange each equation so that the x term comes first, then the y term, then the equals sign and the constant. A missing term has coefficient 0, and a sign moves with its term: y = 2x - 1 becomes -2x + y = -1, so its row of A is -2, 1 and its entry in B is -1.

Section 2Solving AX = B with the inverse

To solve 3x = 12 you multiply both sides by the inverse of 3. The matrix version is the same idea. If A has an inverse A^-1, multiply both sides of AX = B by A^-1: A^-1 (AX) = A^-1 B. Since A^-1 A is the identity matrix I and IX = X, this leaves X = A^-1 B. The inverse goes on the LEFT of B, on both sides of the equation, because matrix multiplication is not commutative: B × A^-1 is not even defined for a 2 by 1 column B. For a 2 by 2 matrix, A^-1 = (1/(ad - bc)) × [[d, -b], [-c, a]], where ad - bc is the determinant.

Section 3The method in five steps

1. Rearrange both equations and write down A, X and B. 2. Work out the determinant ad - bc. If it is 0, stop (see below). 3. Write the adjoint [[d, -b], [-c, a]] and, if you wish, A^-1. 4. Multiply: X = A^-1 B. A tidy way is to multiply the adjoint by B first, giving a column of two whole numbers, and then divide both entries by the determinant. 5. Read x and y from the column X. The inverse needs only one matrix multiplication to give both unknowns at once.

Section 4Checking the answer

Always substitute the values of x and y into BOTH original equations. If either fails, find the slip. You can also check in matrix form: multiply A by the column you found; the result must be B. For a word problem, also read the numbers back in the story: prices must be positive amounts of money, and the totals must match what the problem says. Checking only one equation is not enough, because a wrong pair can satisfy one equation by accident.

Section 5When the determinant is 0

If ad - bc = 0, the matrix A has no inverse, so X = A^-1 B cannot be used. A system with an invertible coefficient matrix has exactly one solution, whatever the constants are. When the determinant is 0 there is no unique solution. Two things can happen. If the second equation is a multiple of the first on both sides (for example 2x + 3y = 4 and 6x + 9y = 12), the equations describe the same line and there are infinitely many solutions. If the left sides are multiples but the right sides are not (for example x + 2y = 3 and 2x + 4y = 9), the lines are parallel and there is no solution. Either way, the matrix method gives no single answer.

Section 6Word problems

Choose a letter for each unknown price or amount, and write one equation for each total in the story, keeping the letters in the same order in both. Solve with the matrix method, then answer in words with units, for example 'a child ticket costs J$150'. All amounts in a question are given in the question; do not assume real prices. The Algebra section covers the same problems by elimination and substitution, so you can use that to double-check an answer. At this level the method is for two equations in two unknowns only.

Examples

Write the equations 4x + y = 14 and 3x - 2y = 5 as a matrix equation AX = B. Find the inverse of A, use it to solve for x and y, and check your answer.

The matrices are A = [[4, 1], [3, -2]], X = [[x], [y]] and B = [[14], [5]]. The determinant is 4 × (-2) - 1 × 3 = -8 - 3 = -11, which is not 0, so A has an inverse. The adjoint is [[-2, -1], [-3, 4]], so A^-1 = (1/-11) × [[-2, -1], [-3, 4]]. Then X = A^-1 B = (1/-11) × [[-2 × 14 + (-1) × 5], [(-3) × 14 + 4 × 5]] = (1/-11) × [[-33], [-22]] = [[3], [2]]. So x = 3 and y = 2. Check in both equations: 4 × 3 + 2 = 14 and 3 × 3 - 2 × 2 = 5. Both are true.

(a) At a roadside stall, 3 bags of mangoes and 2 bags of ackee cost J$1,350, and 5 bags of mangoes and 1 bag of ackee cost J$1,550. A bag of mangoes costs J$m and a bag of ackee costs J$k. Write this as a matrix equation, solve it with the inverse, and check the answer in the story. (b) Try the same method on 6x + 4y = 9 and 3x + 2y = 5, and explain what happens.

(a) The equations are 3m + 2k = 1350 and 5m + k = 1550, so A = [[3, 2], [5, 1]], X = [[m], [k]] and B = [[1350], [1550]]. The determinant is 3 × 1 - 2 × 5 = -7, so A has an inverse. The adjoint is [[1, -2], [-5, 3]]. Multiply the adjoint by B first: [[1, -2], [-5, 3]] × [[1350], [1550]] = [[1 × 1350 + (-2) × 1550], [(-5) × 1350 + 3 × 1550]] = [[-1750], [-2100]]. Now divide both entries by the determinant -7: [[250], [300]]. So m = 250 and k = 300: a bag of mangoes costs J$250 and a bag of ackee costs J$300. Check in the story: 3 × 250 + 2 × 300 = 750 + 600 = 1350 and 5 × 250 + 300 = 1250 + 300 = 1550. (b) Here A = [[6, 4], [3, 2]] and the determinant is 6 × 2 - 4 × 3 = 0. A has no inverse, so X = A^-1 B cannot be used and there is no unique solution. To see which case it is, double the second equation: 6x + 4y = 10. The first equation says 6x + 4y = 9, so the same expression would equal two different numbers. The lines are parallel and there is no solution at all.

Now let's water it

Session runs notes to flashcards to quiz back-to-back.

Where this comes from