Lesson 7 of 8 · 17 min

Solving matrix equations

Solve matrix equations of the form AX=B\bm{AX} = \bm{B}, XA=B\bm{XA} = \bm{B} and AX+BX=C\bm{AX} + \bm{BX} = \bm{C} by multiplying by an inverse on the correct side, and justify each step.

What you will be able to do

  • Solve AX=B\bm{AX} = \bm{B} by pre-multiplying by A−1\bm{A}^{-1}, and XA=B\bm{XA} = \bm{B} by post-multiplying by A−1\bm{A}^{-1}.
  • Factorise equations such as AX+BX=C\bm{AX} + \bm{BX} = \bm{C} into (A+B)X=C(\bm{A} + \bm{B})\bm{X} = \bm{C}, and AX+X=C\bm{AX} + \bm{X} = \bm{C} into (A+I)X=C(\bm{A} + \bm{I})\bm{X} = \bm{C}.
  • Justify each step with a law of matrix algebra.

To solve 3x=123x = 12, you multiply both sides by 13\frac{1}{3}. To solve AX=B\bm{AX} = \bm{B} for an unknown matrix X\bm{X}, you multiply both sides by A−1\bm{A}^{-1}. The only new rule is the one from the last few lessons: order matters, so you must multiply on the same side of both sides of the equation.

Solving AX = B, one law at a time
AX=BA−1AX=A−1Bpre-multiply both sides by A−1IX=A−1BA−1A=IX=A−1BIX=X\begin{aligned} \bm{AX} &= \bm{B} \\ \bm{A}^{-1}\bm{AX} &= \bm{A}^{-1}\bm{B} && \text{pre-multiply both sides by } \bm{A}^{-1} \\ \bm{IX} &= \bm{A}^{-1}\bm{B} && \bm{A}^{-1}\bm{A} = \bm{I} \\ \bm{X} &= \bm{A}^{-1}\bm{B} && \bm{IX} = \bm{X} \end{aligned}

Unknown on the right: AX=B\bm{AX} = \bm{B}

A\bm{A} is on the left of X\bm{X}, so pre-multiply both sides by A−1\bm{A}^{-1}:

X=A−1B\bm{X} = \bm{A}^{-1}\bm{B}

Unknown on the left: XA=B\bm{XA} = \bm{B}

A\bm{A} is on the right of X\bm{X}, so post-multiply both sides by A−1\bm{A}^{-1}:

X=BA−1\bm{X} = \bm{BA}^{-1}

Worked example

Solve AX=B\bm{AX} = \bm{B}

  • Simple familiar
  • Technology free

Given A=[2153]\bm{A} = \begin{bmatrix} 2 & 1 \\ 5 & 3 \end{bmatrix} and B=[4−192]\bm{B} = \begin{bmatrix} 4 & -1 \\ 9 & 2 \end{bmatrix}, solve AX=B\bm{AX} = \bm{B} for the matrix X\bm{X}.

4 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Find A−1\bm{A}^{-1}, checking that det⁡(A)≠0\det(\bm{A}) \neq 0.

  2. Multiply both sides by A−1\bm{A}^{-1} on the same side as A\bm{A}.

  3. Check by multiplying back.

Watch out for

  • Calculating BA−1\bm{BA}^{-1} instead of A−1B\bm{A}^{-1}\bm{B}.

Interactive

Check a solution by multiplying back

This multiplies A\bm{A} by the solution X\bm{X} from the example, and the product is B\bm{B}. Change an entry of X\bm{X} and the product no longer matches: when det⁡(A)≠0\det(\bm{A}) \neq 0, AX=B\bm{AX} = \bm{B} has exactly one solution.

Using the same matrices, A=[2153]\bm{A} = \begin{bmatrix} 2 & 1 \\ 5 & 3 \end{bmatrix} and B=[4−192]\bm{B} = \begin{bmatrix} 4 & -1 \\ 9 & 2 \end{bmatrix}, solve XA=B\bm{XA} = \bm{B}.

Key idea

Factorising matrix equations

When the unknown appears more than once, collect it with a distributive law, keeping X\bm{X} on the same side in every term:

  • AX+BX=C  ⟹  (A+B)X=C  ⟹  X=(A+B)−1C\bm{AX} + \bm{BX} = \bm{C} \implies (\bm{A} + \bm{B})\bm{X} = \bm{C} \implies \bm{X} = (\bm{A} + \bm{B})^{-1}\bm{C}
  • XA+XB=C  ⟹  X(A+B)=C  ⟹  X=C(A+B)−1\bm{XA} + \bm{XB} = \bm{C} \implies \bm{X}(\bm{A} + \bm{B}) = \bm{C} \implies \bm{X} = \bm{C}(\bm{A} + \bm{B})^{-1}
  • AX+X=C  ⟹  (A+I)X=C\bm{AX} + \bm{X} = \bm{C} \implies (\bm{A} + \bm{I})\bm{X} = \bm{C}, because X=IX\bm{X} = \bm{IX}

Each one needs the bracketed matrix to be non-singular. If X\bm{X} is on the left in one term and on the right in another, as in AX+XB\bm{AX} + \bm{XB}, you can't factorise this way.

Worked example

Solve AX+BX=C\bm{AX} + \bm{BX} = \bm{C}

  • Complex familiar
  • Technology free

Given A=[3124]\bm{A} = \begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix}, B=[−121−1]\bm{B} = \begin{bmatrix} -1 & 2 \\ 1 & -1 \end{bmatrix} and C=[5163]\bm{C} = \begin{bmatrix} 5 & 1 \\ 6 & 3 \end{bmatrix}, solve AX+BX=C\bm{AX} + \bm{BX} = \bm{C}.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Factorise, keeping X\bm{X} on its side: (A+B)X=C(\bm{A} + \bm{B})\bm{X} = \bm{C}.

  2. Check det⁡(A+B)≠0\det(\bm{A} + \bm{B}) \neq 0 and find the inverse.

  3. Pre-multiply by the inverse, then check.

Watch out for

  • Writing X(A+B)\bm{X}(\bm{A} + \bm{B}): the unknown is on the right of A\bm{A} and B\bm{B}.

  • Inverting A\bm{A} and B\bm{B} separately: (A+B)−1≠A−1+B−1(\bm{A} + \bm{B})^{-1} \neq \bm{A}^{-1} + \bm{B}^{-1}.

Common mistake

Three ways to lose the marks

  • Writing X=BA\bm{X} = \frac{\bm{B}}{\bm{A}}. There is no matrix division.
  • Writing X=BA−1\bm{X} = \bm{BA}^{-1} for AX=B\bm{AX} = \bm{B}. The inverse goes on the same side as A\bm{A}.
  • Writing AX+X=(A+1)X\bm{AX} + \bm{X} = (\bm{A} + 1)\bm{X}. You can't add a number to a matrix: it is (A+I)X(\bm{A} + \bm{I})\bm{X}.

Solve AX+X=C\bm{AX} + \bm{X} = \bm{C} for X\bm{X}, given that A+I\bm{A} + \bm{I} is non-singular.

Choose one answer

Worked example

Decode a secret message

  • Complex unfamiliar
  • Technology free

A simple code turns letters into numbers (A=1A = 1, B=2B = 2, …, Z=26Z = 26), writes them in pairs as the columns of a matrix M\bm{M}, and sends the coded matrix C=EM\bm{C} = \bm{EM}, where

E=[2132].\bm{E} = \begin{bmatrix} 2 & 1 \\ 3 & 2 \end{bmatrix}.

You receive

C=[27484176].\bm{C} = \begin{bmatrix} 27 & 48 \\ 41 & 76 \end{bmatrix}.

Find the four-letter message.

5 steps

Try it yourself first, then check the working one step at a time.

Method

  1. Write the decoding problem as a matrix equation.

  2. Multiply by the inverse of the coding matrix on the correct side.

  3. Convert back to letters and check the entries make sense.

Watch out for

  • Calculating CE−1\bm{CE}^{-1}. Since C=EM\bm{C} = \bm{EM}, the inverse must go on the left.

  • Reading the letters across the rows instead of down the columns.

Without technology

Find the inverse with the formula, then do one matrix multiplication. Check by multiplying back.

With technology

Enter the matrices and type the whole expression, such as A−1B\bm{A}^{-1}\bm{B} or (A+B)−1C(\bm{A} + \bm{B})^{-1}\bm{C}. You still have to choose the order: the calculator will happily compute BA−1\bm{BA}^{-1} when you meant A−1B\bm{A}^{-1}\bm{B}.

Solve for X\bm{X}:

[3243]X=[1021]\begin{bmatrix} 3 & 2 \\ 4 & 3 \end{bmatrix}\bm{X} = \begin{bmatrix} 1 & 0 \\ 2 & 1 \end{bmatrix}

Summary

  • AX=B  ⟹  X=A−1B\bm{AX} = \bm{B} \implies \bm{X} = \bm{A}^{-1}\bm{B} (pre-multiply). XA=B  ⟹  X=BA−1\bm{XA} = \bm{B} \implies \bm{X} = \bm{BA}^{-1} (post-multiply).

  • Collect the unknown with a distributive law, keeping it on its side: AX+BX=(A+B)X\bm{AX} + \bm{BX} = (\bm{A} + \bm{B})\bm{X} and AX+X=(A+I)X\bm{AX} + \bm{X} = (\bm{A} + \bm{I})\bm{X}.

  • The matrix you invert must be non-singular.

  • Check by multiplying back into the original equation.

Finished the lesson?

Try the 3 quick checks above and the lesson completes itself, or mark it complete now.

Lesson 7 of 80% read

Save your progress with a free account