Matrices & linear transformations · Lesson 1 of 3

Matrix algebra and inverses

Adding and multiplying matrices, equal matrices and unknowns (including PQ = QP), the inverse of a 2 × 2 matrix, and solving two simultaneous equations with it.

18 minYou should already know: Matrices & determinants
  1. 1
  2. 2
  3. 3

This lesson builds on matrices and determinants.

Multiplying matrices

Each entry of a product is a row of the first matrix times a column of the second:

abcdpqrs=•• = ap + br
Row times columnMultiply across the row and down the column, then add

Order matters: in general AB≠BAAB \ne BA. The identity I=(1001)I = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix} leaves a matrix unchanged: AI=IA=AAI = IA = A.

Tap each entry of the answer to see which row and column make it, then try “Your turn”.

Multiplying matricesTap an entry of the answer
2135
×
1420
=
2, 1row 1 of the first1, 2column 1 of the second2 × 1 + 1 × 2 = 4entry in row 1, column 1
The entry in row 1, column 1 uses row 1 of the first matrix and column 1 of the second: multiply them in pairs and add, 2 × 1 + 1 × 2 = 4. The first matrix needs as many columns as the second has rows.

Worked example · WAEC 2018

WAEC 2018 · Paper 2 · Q3

Given that B=(2314)B = \begin{pmatrix} 2 & 3 \\ 1 & 4 \end{pmatrix} and B2+3B+2I=3NB^2 + 3B + 2I = 3N, where II is the 2×22 \times 2 unit matrix, find the matrix NN.

  1. B squared

    • B2=(4+36+122+43+16){B^2 = \begin{pmatrix} 4 + 3 & 6 + 12 \\ 2 + 4 & 3 + 16 \end{pmatrix}}.
    • =(718619){= \begin{pmatrix} 7 & 18 \\ 6 & 19 \end{pmatrix}}.

    Think first. Multiply B by itself, row by column.

  2. Add the three matrices

    • 3B=(69312){3B = \begin{pmatrix} 6 & 9 \\ 3 & 12 \end{pmatrix}} and 2I=(2002){2I = \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix}}.
    • 3N=(7+6+218+9+06+3+019+12+2){3N = \begin{pmatrix} 7 + 6 + 2 & 18 + 9 + 0 \\ 6 + 3 + 0 & 19 + 12 + 2 \end{pmatrix}}.
    • Add up: 3N=(1527933){3N = \begin{pmatrix} 15 & 27 \\ 9 & 33 \end{pmatrix}}.
  3. Divide by 3

    • N=(59311){N = \begin{pmatrix} 5 & 9 \\ 3 & 11 \end{pmatrix}}.

Equal matrices

Two matrices are equal when they have the same order and every entry matches the entry in the same place. So one equation between matrices is really one equation for each position:

x + y32x − y=7321x + y = 7x − y = 1
Match the placesSame place, same value: one equation per entry

When one side is a product, such as PQ=QPPQ = QP, work out each side as a single matrix first. Then match the entries, starting with the ones that hold only one unknown.

Worked example · WAEC 2014

WAEC 2014 · Paper 2 · Q10 (a)

If P=(42c3)P = \begin{pmatrix} 4 & 2 \\ c & 3 \end{pmatrix}, Q=(624d)Q = \begin{pmatrix} 6 & 2 \\ 4 & d \end{pmatrix} and PQ=QPPQ = QP, find the values of cc and dd.

  1. Multiply both ways

    • PQ=(24+88+2d6c+122c+3d){PQ = \begin{pmatrix} 24 + 8 & 8 + 2d \\ 6c + 12 & 2c + 3d \end{pmatrix}}.
    • Simplify: PQ=(328+2d6c+122c+3d){PQ = \begin{pmatrix} 32 & 8 + 2d \\ 6c + 12 & 2c + 3d \end{pmatrix}}.
    • QP=(24+2c12+616+cd8+3d){QP = \begin{pmatrix} 24 + 2c & 12 + 6 \\ 16 + cd & 8 + 3d \end{pmatrix}}.
    • Simplify: QP=(24+2c1816+cd8+3d){QP = \begin{pmatrix} 24 + 2c & 18 \\ 16 + cd & 8 + 3d \end{pmatrix}}.

    Think first. Work out PQ and QP, row by column.

  2. Match the entries

    • Top-left: 32=24+2c{32 = 24 + 2c}, so c=4{c = 4}.
    • Top-right: 8+2d=18{8 + 2d = 18}, so d=5{d = 5}.

    Think first. Which places hold only one unknown?

  3. Check the other two places

    • Bottom-left: 6(4)+12=36{6(4) + 12 = 36} and 16+4(5)=36{16 + 4(5) = 36} ✓.
    • Bottom-right: 2(4)+3(5)=23{2(4) + 3(5) = 23} and 8+3(5)=23{8 + 3(5) = 23} ✓.

More: equal matrices

The inverse of a 2 × 2 matrix

The inverse A−1A^{-1} undoes AA: AA−1=A−1A=IAA^{-1} = A^{-1}A = I. It exists only when the determinant ad−bcad - bc is not zero.

A⁻¹ =1ad − bcd−b−caswap a, d · change signs of b, c
The inverseA⁻¹ = (1 ÷ (ad − bc)) × (d, −b / −c, a)

Worked example · WAEC 2020

WAEC 2020 · Paper 2 · Q2

Given that P=(3456)P = \begin{pmatrix} 3 & 4 \\ 5 & 6 \end{pmatrix} and Q=(−25−31)Q = \begin{pmatrix} -2 & 5 \\ -3 & 1 \end{pmatrix}, find PQ−1PQ^{-1}, where Q−1Q^{-1} is the inverse of QQ.

  1. The inverse of Q

    • ∣Q∣=(−2)(1)−(5)(−3){|Q| = (-2)(1) - (5)(-3)}.
    • =−2+15=13{= -2 + 15 = 13}.
    • Q−1=113(1−53−2){Q^{-1} = \frac{1}{13}\begin{pmatrix} 1 & -5 \\ 3 & -2 \end{pmatrix}}.

    Think first. ad − bc for Q?

  2. Multiply

    • PQ−1=113(3+12−15−85+18−25−12){PQ^{-1} = \frac{1}{13}\begin{pmatrix} 3 + 12 & -15 - 8 \\ 5 + 18 & -25 - 12 \end{pmatrix}}.
    • =113(15−2323−37){= \frac{1}{13}\begin{pmatrix} 15 & -23 \\ 23 & -37 \end{pmatrix}}.

More: the inverse

Solving simultaneous equations

Two equations ax+by=pax + by = p and cx+dy=qcx + dy = q are the matrix equation A(xy)=(pq)A\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} p \\ q \end{pmatrix}. Multiply both sides on the left by A−1A^{-1}:

(xy)=A−1(pq)\begin{pmatrix} x \\ y \end{pmatrix} = A^{-1}\begin{pmatrix} p \\ q \end{pmatrix}
Solving with an inverse matrixSet the coefficients and the right-hand sides
−8−6−4−22468−8−6−4−22468xy(2, 3)
2x + y = 7first line3x + 4y = 18second line5determinant ad − bc(2, 3)solution (x, y)
|A| = (2)(4) − (1)(3) = 5. A⁻¹ = (1/5) × (4, −1 / −3, 2). Then x = (4 × 7 − 1 × 18) ÷ 5 = 2 and y = ((−3) × 7 + 2 × 18) ÷ 5 = 3. Check: 2 × 2 + 1 × 3 = 7 ✓. On the graph, (2, 3) is where the two lines cross.

Worked example · NECO 2023

NECO 2023 · Paper 1 · Q13

If (3−111)(xy)=(137)\begin{pmatrix} 3 & -1 \\ 1 & 1 \end{pmatrix}\begin{pmatrix} x \\ y \end{pmatrix} = \begin{pmatrix} 13 \\ 7 \end{pmatrix}, find the value of yy.

  1. The inverse

    • ∣A∣=3(1)−(−1)(1)=4{|A| = 3(1) - (-1)(1) = 4}, so A−1=14(11−13){A^{-1} = \frac14\begin{pmatrix} 1 & 1 \\ -1 & 3 \end{pmatrix}}.
  2. Multiply

    • (xy)=14(13+7−13+21){\begin{pmatrix} x \\ y \end{pmatrix} = \frac14\begin{pmatrix} 13 + 7 \\ -13 + 21 \end{pmatrix}}.
    • =14(208)=(52){= \frac14\begin{pmatrix} 20 \\ 8 \end{pmatrix} = \begin{pmatrix} 5 \\ 2 \end{pmatrix}}.
    • So y=2{y = 2}: option B.

Your turn

WAEC 2018 · Paper 2 · Q11 (a)

  1. (a)

    Given the matrix A=(385−2)A = \begin{pmatrix} 3 & 8 \\ 5 & -2 \end{pmatrix}, find its inverse.

    Show the answer

    A−1=(123423546−346)A^{-1} = \begin{pmatrix} \frac{1}{23} & \frac{4}{23} \\ \frac{5}{46} & -\frac{3}{46} \end{pmatrix}

Worked solution (try it first)

(a)

  1. The determinant is ∣A∣=3(−2)−8(5)=−6−40=−46|A| = 3(-2) - 8(5) = -6 - 40 = -46.
  2. Swap the leading diagonal and change the signs of the other two entries: (−2−8−53)\begin{pmatrix} -2 & -8 \\ -5 & 3 \end{pmatrix}.
  3. Divide by the determinant: A−1=−146(−2−8−53)A^{-1} = -\dfrac{1}{46}\begin{pmatrix} -2 & -8 \\ -5 & 3 \end{pmatrix}
    =(123423546−346)= \begin{pmatrix} \frac{1}{23} & \frac{4}{23} \\ \frac{5}{46} & -\frac{3}{46} \end{pmatrix}.

Report a problem with this question