myLearning

Topic 2 of 8

Step 19: Linear algebra

Matrix algebra and inverses

Step 19 · Linear algebra topics

Multiply matrices, find inverses of invertible matrices, and use them to solve systems written as Ax = b.

Matrix multiplication

The entry in row i and column j of AB is row i of A dotted with column j of B. So the number of columns of A must match the number of rows of B: an m × n matrix times an n × p matrix gives an m × p matrix.

Example: A product

Find AB for A = (1234)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} and B = (5678)\begin{pmatrix} 5 & 6 \\ 7 & 8 \end{pmatrix}.

  1. Row 1 of A with column 1 of B: 1 × 5 + 2 × 7 = 19.
  2. Row 1 with column 2: 1 × 6 + 2 × 8 = 22.
  3. Row 2 gives 3 × 5 + 4 × 7 = 43 and 3 × 6 + 4 × 8 = 50.

Answer(19224350)\begin{pmatrix} 19 & 22 \\ 43 & 50 \end{pmatrix}

Example: A matrix times a vector

Find (2103)\begin{pmatrix} 2 & 1 \\ 0 & 3 \end{pmatrix} times the vector ⟨4, −1⟩.

  1. First entry: 2 × 4 + 1 × (−1), which is 7.
  2. Second entry: 0 × 4 + 3 × (−1), which is −3.

Answer⟨7, −3⟩

Inverse matrices

The identity matrix I has 1s on the diagonal and 0s elsewhere, and IA = AI = A. A square matrix A is invertible if some A⁻¹ has AA⁻¹ = A⁻¹A = I. For 2 × 2 matrices there is a formula.

(abcd)−1=1ad−bc(d−b−ca)\begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1} = \frac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}

Example: A 2 × 2 inverse

Find the inverse of (2153)\begin{pmatrix} 2 & 1 \\ 5 & 3 \end{pmatrix}.

  1. ad − bc = 6 − 5 = 1.
  2. Swap the diagonal entries, change the signs of the other two, and divide by 1.

Answer(3−1−52)\begin{pmatrix} 3 & -1 \\ -5 & 2 \end{pmatrix}

Example: Larger matrices

How do you invert a 3 × 3 matrix?

  1. Row reduce the block (A | I).
  2. If A turns into I, the right half has become A⁻¹. If a row of zeros appears on the left, A has no inverse.

AnswerRow reduce (A | I) to (I | A⁻¹)

Solving with inverses

A whole system can be written as one matrix equation, Ax = b. If A is invertible, multiply both sides by A⁻¹: x = A⁻¹b is the one and only solution.

Example: Using the inverse

Solve 2x + y = 4 and 5x + 3y = 11.

  1. A = (2153)\begin{pmatrix} 2 & 1 \\ 5 & 3 \end{pmatrix}, whose inverse was found above.
  2. x = 3 × 4 − 1 × 11 = 1 and y = −5 × 4 + 2 × 11 = 2.

Answerx = 1, y = 2

Try it yourself

Work each one on paper first, then open the answer to check.

  1. Find (1021)\begin{pmatrix} 1 & 0 \\ 2 & 1 \end{pmatrix} times ⟨3, 4⟩.

    Show answer

    ⟨3, 10⟩

  2. A is 2 × 3 and B is 3 × 4. What size is AB?

    Show answer

    2 × 4

  3. Find the inverse of (4724)\begin{pmatrix} 4 & 7 \\ 2 & 4 \end{pmatrix}.

    Show answer

    12\frac{1}{2}(4−7−24)\begin{pmatrix} 4 & -7 \\ -2 & 4 \end{pmatrix}

  4. Is (2412)\begin{pmatrix} 2 & 4 \\ 1 & 2 \end{pmatrix} invertible?

    Show answer

    No: ad − bc = 4 − 4 = 0

  5. A is 2 × 3 and B is 3 × 4. Is BA defined?

    Show answer

    No: B has 4 columns but A has only 2 rows

  6. Solve x + y = 3 and x + 2y = 5 using an inverse.

    Show answer

    x = 1, y = 2

What next?