M5.6.8 Chapter 8

Inverse matrices and equations

Can a matrix be undone, the way subtracting undoes adding?

Your guess

Pick one before you read on. It is fine to be wrong.

Your guess
  • You picked A. Read on. At the end, the chapter comes back to your guess.

  • You picked B. Read on. At the end, the chapter comes back to your guess.

  • You picked C. Read on. At the end, the chapter comes back to your guess.

By the end you can

  • Find the inverse of a 2 by 2 matrix
  • Solve two simultaneous equations with an inverse matrix

With numbers, you undo multiplying by 5 by multiplying by 1/5. The two together give 1. A matrix works the same way. The inverse of a square matrix A is the matrix A⁻¹ with A A⁻¹ = I and A⁻¹ A = I, where I is the identity matrix. Doing A and then A⁻¹ changes nothing, so A⁻¹ undoes A.

A grid with the x axis x and the y axis y. A triangle S with corners at (1, 0), (3, 0) and (1, 1). Its image S′, hatched, is the triangle moved by the matrix with rows (0, -2) and (2, 0). The text under the grid reads area S = 1, area S′ = 4.−2246−22460xySS′area S = 1, area S′ = 4
The matrix with rows (0, −2) and (2, 0) moves the triangle S to S′. Its determinant is 4, so the area is multiplied by 4.
A grid with the x axis x and the y axis y. The triangle S′ has corners at (0, 2), (0, 6) and (-2, 2). Its image S, hatched, is the triangle moved by the matrix with rows (0, 0.5) and (-0.5, 0). It is back at the corners (1, 0), (3, 0) and (1, 1). The text under the grid reads area S′ = 4, area S = 1.−2246−22460xyS′Sarea S′ = 4, area S = 1
The inverse, with rows (0, 0.5) and (−0.5, 0), moves S′ back onto S. Every corner of S′ returns to where it began, and the area is back to 1.

For a 2 × 2 matrix with rows (a, b) and (c, d), there is a short rule. Swap a and d. Change the signs of b and c. Then divide every entry by the determinant ad − bc. So A⁻¹ = (1 ÷ (ad − bc)) times the matrix with rows (d, −b) and (−c, a).

Why does this work? Multiply A by the matrix with the swapped entries and the changed signs, and see what you get. The picture does it for one matrix. The product is not I, but twice I. The number 2 is the determinant. Dividing by it leaves I. In general the product is (ad − bc) times I, which is why we divide by the determinant.

A product of two matrices. A has first row 3, 1 and second row 4, 2. The second matrix has the swapped entries and the changed signs: first row 2, −1 and second row −4, 3. The result has first row 2, 0 and second row 0, 2. The matrices are named A, swapped and 2I.3142A×2−1−43swapped=20022I
A has determinant 3 × 2 − 1 × 4 = 2. The product is 2 times the identity matrix.

Worked example

Find the inverse of the matrix A with rows (4, 3) and (1, 2).

  1. The determinant is not 0, so the inverse exists. It is ad − bc = 4 × 2 − 3 × 1 = 5.
  2. Swap a and d: the diagonal becomes 2 and 4. Change the signs of b and c: they become −3 and −1.
  3. This gives the matrix with rows (2, −3) and (−1, 4).
  4. Divide every entry by 5. The inverse has rows (0.4, −0.6) and (−0.2, 0.8).
  5. Check the top left entry of A A⁻¹: 4 × 0.4 + 3 × (−0.2) = 1. It is the top left entry of the identity.

Answer: The inverse has rows (0.4, −0.6) and (−0.2, 0.8).

Notice what a zero determinant does. The rule divides by ad − bc, which cannot be done when it is 0. A matrix with determinant 0 squashes the plane onto a line, as we saw in the last chapter. Two different points land on the same place, and no matrix can tell them apart again. So a singular matrix has no inverse.

Now to the main use. Two simultaneous equations such as 2x + y = 8 and x + y = 5 can be written as one matrix equation. The coefficients make a matrix, the unknowns make a column vector, and the right hand sides make another column vector. The matrix times the vector (x, y) gives (8, 5).

If the matrix is A, the vector of unknowns is v, and the right hand side is c, then A v = c. Multiply both sides on the left by A⁻¹. Since A⁻¹ A = I and I v = v, we get v = A⁻¹ c. The inverse is on the left of c, the same side that it was written on in the first step.

Worked example

Solve 2x + y = 8 and x + y = 5 with an inverse matrix.

  1. Write the equations as a matrix equation: the matrix with rows (2, 1) and (1, 1) times (x, y) equals (8, 5).
  2. The determinant is 2 × 1 − 1 × 1 = 1, so the inverse exists.
  3. The inverse has rows (1, −1) and (−1, 2).
  4. Then (x, y) = the inverse times (8, 5). The top number is 1 × 8 + (−1) × 5 = 3.
  5. The bottom number is −1 × 8 + 2 × 5 = 2.
  6. So x = 3 and y = 2. Check in the first equation: 2 × 3 + 1 × 2 = 8.

Answer: x = 3 and y = 2

A grid with the x axis x and the y axis y. Two straight lines, named L₁ and L₂, cross at the point P, (3, 2). The line L₁ is 2x + y = 8 and the line L₂ is x + y = 5.369−224680xyL₁L₂P
Each equation is a straight line. The solution (3, 2) is the point P where they cross. The inverse matrix finds P in one step.

Worked example

Solve 4x + 3y = 10 and x + 2y = 5, using the inverse found above.

  1. The matrix is the one with rows (4, 3) and (1, 2), and the right hand side is (10, 5). We found its inverse: rows (0.4, −0.6) and (−0.2, 0.8).
  2. The top number is 0.4 × 10 + (−0.6) × 5 = 1.
  3. The bottom number is −0.2 × 10 + 0.8 × 5 = 2.
  4. So x = 1 and y = 2. Check in the second equation: 1 + 2 × 2 = 5.

Answer: x = 1 and y = 2

What if the determinant is 0? Then there is no inverse, and the method stops. Look at x + 2y = 5 and 2x + 4y = 6. The matrix has determinant 1 × 4 − 2 × 2 = 0. The second equation is 2 times x + 2y = 3, but the first says x + 2y = 5. The equations disagree, so there is no solution. Their lines are parallel.

A grid with the x axis x and the y axis y. Two parallel straight lines, named L₁ and L₂, that never cross. The line L₁ is x + 2y = 5, through (1, 2) and (3, 1). The line L₂ is 2x + 4y = 6, through (1, 1) and (3, 0).246240xyL₁L₂
The matrix with rows (1, 2) and (2, 4) has determinant 0. The two lines are parallel, so there is no point that is on both. If the right hand sides had agreed, the lines would be the same line, with infinitely many solutions.

See it three ways

With things

A seller packs a small basket with 2 mangoes and 1 papaya, and a large basket with 4 mangoes and 3 papayas. An order needs 20 mangoes and 12 papayas in all. How many baskets of each kind should be packed?

As a picture

A matrix equation. The baskets matrix has first row 2, 4 and second row 1, 3. It multiplies the column of unknowns s and l, and the result is the column 20 and 12. The matrices are named baskets, numbers and fruit.2413baskets×slnumbers=2012fruit

In words

The matrix packs baskets into fruit. The inverse unpacks the fruit into baskets. The determinant is 2 × 3 − 4 × 1 = 2, so the inverse exists, and it gives 6 small baskets and 2 large ones.

In symbols

If A v = c, then v = A⁻¹ c. Here the inverse has rows (1.5, −2) and (−0.5, 1), and v = (6, 2).

Try it

Move a triangle and move it back

You need: squared paper, a ruler, a pencil.

  1. Draw axes. Mark the corners (1, 0), (3, 0), (1, 1) of a triangle.
  2. Use the matrix with rows (0, −2) and (2, 0) on each corner. For example, (1, 0) goes to (0, 2). Mark the three image points and join them.
  3. Now use the inverse, with rows (0, 0.5) and (−0.5, 0), on each image point. The point (0, 2) should go back to (1, 0).
  4. Compare the last three points with the first three.

What you will see: Every point comes back to where it started. The inverse has undone the matrix.

If you cannot try it, this is what happens.
A table with the heads start, after A and undone (after the inverse). The rows read (1, 0), (0, 2) and (1, 0); (3, 0), (0, 6) and (3, 0); (1, 1), (−2, 2) and (1, 1).startafter Aundone(1, 0)(0, 2)(1, 0)(3, 0)(0, 6)(3, 0)(1, 1)(−2, 2)(1, 1)

A wrong idea many people have

To find the inverse of a matrix, replace each entry by 1 divided by it.

Why it feels right: The inverse of the number 5 is 1/5, so the inverse of a matrix of numbers seems to be a matrix of such inverses.

The test that breaks it: Take A with rows (4, 3) and (1, 2). Replacing each entry by 1 divided by it gives rows (0.25, 0.333) and (1, 0.5). The top left entry of the product is 4 × 0.25 + 3 × 1 = 4, and the identity needs 1.

What is true: The inverse is found with the determinant: swap a and d, change the signs of b and c, and divide by ad − bc. Check any inverse by multiplying: A A⁻¹ must be I.

A wrong idea many people have

Every square matrix has an inverse.

Why it feels right: Every non-zero number has an inverse, so every non-zero matrix seems to have one.

The test that breaks it: Take the matrix with rows (1, 2) and (2, 4). It is not the zero matrix, but its determinant is 0. The formula needs a division by 0, which cannot be done. It squashes the unit square onto a line, so two points share an image.

What is true: A matrix has an inverse only when its determinant is not 0. A non-zero matrix with determinant 0 is singular and has no inverse.

Key words

inverse
the matrix A⁻¹ that undoes A, so that A A⁻¹ = A⁻¹ A = I.
singular
a matrix with determinant 0, which has no inverse.
matrix equation
an equation A v = c, where A is a matrix and v and c are column vectors.
identity matrix
the matrix I with 1s on the diagonal and 0s elsewhere, which leaves a matrix unchanged.

Back to your guess

The answer is B: The matrix with rows (0, −1) and (1, 0) turns the plane 90° anticlockwise. A turn of 90° clockwise undoes it.

To undo a turn of 90° anticlockwise you turn 90° clockwise. The matrix for that has rows (0, 1) and (−1, 0). The two matrices multiply to the identity: rows (1, 0) and (0, 1). The matrix that undoes another is its inverse, and this chapter shows how to find it and use it.

Check yourself

Try each one before you look. A wrong answer tells you where to go next.

  1. What is the inverse of the matrix with rows (3, 2) and (4, 3)?

    Tap your answer.
    1. Not this one. This is the matrix itself. Its product with itself is not the identity. Read this page again. Try another.

    2. Not this one. You changed the signs of the diagonal and kept the signs of the other two. Swap the diagonal, and change the signs of b and c. Read this page again. Try another.

    3. Yes, that is right. The determinant is 3 × 3 − 2 × 4 = 1. Swap a and d, change the signs of b and c, and divide by 1: rows (3, −2) and (−4, 3).

    4. Not this one. This swaps the rows and columns, which is a different operation. The inverse swaps a and d and changes the signs of b and c. Read this page again. Try another.

    See the answer

    rows (3, −2) and (−4, 3)

    The determinant is 3 × 3 − 2 × 4 = 1. Swap a and d, change the signs of b and c, and divide by 1: rows (3, −2) and (−4, 3).

    • If you chose A: This is the matrix itself. Its product with itself is not the identity. Read this page again.
    • If you chose B: You changed the signs of the diagonal and kept the signs of the other two. Swap the diagonal, and change the signs of b and c. Read this page again.
    • If you chose D: This swaps the rows and columns, which is a different operation. The inverse swaps a and d and changes the signs of b and c. Read this page again.
  2. Which of these matrices has no inverse?

    Tap your answer.
    1. Yes, that is right. The determinant of the matrix with rows (2, 3) and (4, 6) is 2 × 6 − 3 × 4 = 0. A matrix with determinant 0 has no inverse.

    2. Not this one. Its determinant is −2, not 0, so it has an inverse. Read this page again. Try another.

    3. Not this one. Its determinant is −2, not 0, so it has an inverse. Read this page again. Try another.

    4. Not this one. Its determinant is 2, not 0, so it has an inverse. Read this page again. Try another.

    See the answer

    rows (2, 3) and (4, 6)

    The determinant of the matrix with rows (2, 3) and (4, 6) is 2 × 6 − 3 × 4 = 0. A matrix with determinant 0 has no inverse.

  3. A matrix has determinant 8. What is the determinant of its inverse?

    Tap your answer.
    1. Not this one. This is the determinant of the matrix itself. Undoing a stretch of 8 in area shrinks areas by 8. Read this page again. Try another.

    2. Not this one. The sign does not change. The matrix and its inverse both keep or both flip the shape. Read this page again. Try another.

    3. Not this one. The determinant of the identity is 1, and that is the product of the two determinants, not the determinant of the inverse. Read this page again. Try another.

    4. Yes, that is right. A and its inverse multiply to I, and the determinant of I is 1. Determinants multiply, so det A × det A⁻¹ = 1 and det A⁻¹ = 1 ÷ 8 = 0.125.

    See the answer

    0.125

    A and its inverse multiply to I, and the determinant of I is 1. Determinants multiply, so det A × det A⁻¹ = 1 and det A⁻¹ = 1 ÷ 8 = 0.125.

    • If you chose A: This is the determinant of the matrix itself. Undoing a stretch of 8 in area shrinks areas by 8. Read this page again.
    • If you chose B: The sign does not change. The matrix and its inverse both keep or both flip the shape. Read this page again.
    • If you chose C: The determinant of the identity is 1, and that is the product of the two determinants, not the determinant of the inverse. Read this page again.
  4. The picture shows the lines x + y = 7 and x + 2y = 10. What is the solution of the two equations?

    A grid with the x axis x and the y axis y. Two straight lines, named L₁ and L₂, cross at the point P, (4, 3). The line L₁ is x + y = 7 and the line L₂ is x + 2y = 10.1234567824680xyL₁L₂P
    Tap your answer.
    1. Not this one. These are the right hand sides of the equations, not the solution. The solution is the point where the two lines cross. Read this page again. Try another.

    2. Yes, that is right. The solution is the point where the lines cross. As a check, the matrix with rows (1, 1) and (1, 2) has the inverse with rows (2, −1) and (−1, 1). The inverse times (7, 10) is (4, 3).

    3. Not this one. You may have swapped x and y. Read the x number first: it is how far along the x axis the point P is. Read this page again. Try another.

    4. Not this one. Check it in the equations: this point is not on both lines. Read this page again. Try another.

    See the answer

    x = 4 and y = 3

    The solution is the point where the lines cross. As a check, the matrix with rows (1, 1) and (1, 2) has the inverse with rows (2, −1) and (−1, 1). The inverse times (7, 10) is (4, 3).

    • If you chose A: These are the right hand sides of the equations, not the solution. The solution is the point where the two lines cross. Read this page again.
    • If you chose C: You may have swapped x and y. Read the x number first: it is how far along the x axis the point P is. Read this page again.
    • If you chose D: Check it in the equations: this point is not on both lines. Read this page again.
  5. From an earlier chapter

    A matrix has determinant −2 and moves a shape with area 7 cm². What is the area of the image?

    Tap your answer.
    1. Not this one. An area cannot be negative. The size of the determinant multiplies the area, and the sign shows only that the shape is flipped. Go to M5.6.7. Try another.

    2. Not this one. You added the determinant to the area. The area is multiplied by the size of the determinant. Go to M5.6.7. Try another.

    3. Yes, that is right. The area is multiplied by |−2| = 2, so it becomes 2 × 7 = 14 cm².

    See the answer

    14 cm²

    The area is multiplied by |−2| = 2, so it becomes 2 × 7 = 14 cm².

    • If you chose A: An area cannot be negative. The size of the determinant multiplies the area, and the sign shows only that the shape is flipped. Go to M5.6.7.
    • If you chose B: You added the determinant to the area. The area is multiplied by the size of the determinant. Go to M5.6.7.
  6. Find the inverse of the matrix with rows (7, 2) and (3, 1). Give the four entries of the inverse, row by row.

    See the answer

    rows (1, −2) and (−3, 7)

    The determinant is 1. Swap the diagonal and change the signs of the others: rows (1, −2) and (−3, 7).

  7. Solve 5x + 2y = 14 and 2x + y = 5 with an inverse matrix. Give x and y.

    See the answer

    x = 4 and y = −3

    The matrix with rows (5, 2) and (2, 1) has determinant 1 and inverse rows (1, −2) and (−2, 5). The inverse times (14, 5) is (4, −3).

  8. Find the inverse of the matrix with rows (2, 1) and (4, 3). Give the four entries of the inverse, row by row.

    See the answer

    rows (1.5, −0.5) and (−2, 1)

    The determinant is 2 × 3 − 1 × 4 = 2. Swap the diagonal, change the signs of the others, and divide by 2: rows (1.5, −0.5) and (−2, 1).

  9. A bundle P holds 3 sticks and 2 stones. A bundle Q holds 2 sticks and 1 stone. An order needs 16 sticks and 9 stones. Use an inverse matrix to find how many bundles of P and Q to pack.

    See the answer

    2 of P and 5 of Q

    With p bundles of P and q of Q, 3p + 2q = 16 and 2p + q = 9. The determinant is −1 and the inverse is rows (−1, 2) and (2, −3). So (p, q) = (2, 5). Check: 3 × 2 + 2 × 5 = 16.

  10. The equations are written as A v = c, and A has an inverse. Which line gives v?

    Tap your answer.
    1. Not this one. The inverse must multiply on the same side as A did, which is the left. Matrix multiplication depends on the order, so c A⁻¹ is not A⁻¹ c. Read this page again. Try another.

    2. Yes, that is right. Multiply both sides of A v = c on the left by the inverse. A⁻¹ A v = A⁻¹ c, and A⁻¹ A = I, so v = A⁻¹ c. The inverse goes on the left.

    3. Not this one. There is no division of matrices. We multiply by the inverse instead. Read this page again. Try another.

    See the answer

    v = A⁻¹c

    Multiply both sides of A v = c on the left by the inverse. A⁻¹ A v = A⁻¹ c, and A⁻¹ A = I, so v = A⁻¹ c. The inverse goes on the left.

    • If you chose A: The inverse must multiply on the same side as A did, which is the left. Matrix multiplication depends on the order, so c A⁻¹ is not A⁻¹ c. Read this page again.
    • If you chose C: There is no division of matrices. We multiply by the inverse instead. Read this page again.

Keep it

Copy this into your exercise book.

A A⁻¹ = I. For rows (a, b), (c, d): swap a and d, change signs of b and c, divide by ad − bc. No inverse if ad − bc = 0. A v = c gives v = A⁻¹ c.

Draw: Two lines crossing at a point, with the matrix equation written beside them.

Reading with a child? A short page for the adult: what this chapter teaches and three questions to ask.

No internet tomorrow? Save the whole book as one file (864 KB). It opens on any phone.