Back to the on-screen lesson ·

Inverses by row reduction

What an inverse is and why it is unique, the two by two formula, Gauss-Jordan on the augmented identity, the reversal rule for products, and why elimination usually beats inversion.

Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.

1. What you will learn

By the end of this lesson you will be able to state what makes a matrix invertible and prove that an inverse is unique when it exists, apply the two by two formula in the right order and check it by multiplying back, invert a larger matrix by reducing the wide array $[A \mid I]$ and recognise from a zero row that no inverse exists, find the entry that makes a matrix singular, apply $(AB)^{-1} = B^{-1}A^{-1}$, and say why solving $Ax = b$ by elimination is usually preferable to computing an inverse.

2. Two things this lesson puts together

You can multiply matrices, and you can reduce one to its reduced row echelon form. An inverse is the meeting point: it is defined by multiplication and it is computed by reduction, and neither half makes sense without the other.

3. The words for undoing

A square matrix $A$ is invertible — equivalently non-singular — when there is a matrix $A^{-1}$ with $AA^{-1} = A^{-1}A = I$. A square matrix with no such partner is singular. The determinant of $\begin{pmatrix} a & b \\ c & d \end{pmatrix}$ is $ad - bc$; a $2 \times 2$ matrix is invertible exactly when it is non-zero. Only square matrices are candidates: the word does not apply to a rectangular one, which can have a one-sided inverse at best.

4. The matrix that undoes a matrix

$A^{-1}$ is the matrix for which $AA^{-1} = A^{-1}A = I$. Two facts come almost free.

It is unique. If $BA = I$ and $AC = I$ then $B = BI = B(AC) = (BA)C = IC = C$, so a left inverse and a right inverse of the same matrix are the same matrix, and there is only one of it. This is why we may write the inverse.

Not every matrix has one. $\begin{pmatrix} 1 & 2 \\ 2 & 4 \end{pmatrix}$ sends $(2, -1)$ to $(0, 0)$; no matrix can bring $(0,0)$ back to $(2,-1)$, because it also has to leave $(0,0)$ alone. Any matrix that sends a non-zero vector to zero is singular, and that is the whole of the reason.

For $2 \times 2$ there is a formula worth knowing by heart:

$$\begin{pmatrix} a & b \\ c & d \end{pmatrix}^{-1} = \frac{1}{ad - bc}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}, \qquad ad - bc \ne 0.$$

Swap the diagonal, negate the other two, divide by the determinant. There is no comparable formula worth using for larger matrices; from $3 \times 3$ upwards the method is reduction.

Gauss-Jordan. Write $[A \mid I]$ and row-reduce until the left block is $I$. The right block is then $A^{-1}$. The reason is the next lesson's, in one sentence: every row operation is multiplication on the left by some matrix, so reducing $A$ to $I$ means finding $E$ with $EA = I$, and the same operations applied to $I$ produce $EI = E$. If the left block cannot be reduced to $I$ — a row of zeros appears — then $A$ is singular and the algorithm has proved it.

Products reverse. $(AB)^{-1} = B^{-1}A^{-1}$, and $(A^{T})^{-1} = (A^{-1})^{T}$.

Another way: picture

A matrix is an action on the plane or on space. Invertible means the action can be run backwards: nothing was lost. Singular means it flattened something — a plane onto a line, space onto a plane — and once two different inputs have arrived at the same output, no rule can decide which one to send back. That is why the test does $A$ send some non-zero vector to zero? is the same question as is $A$ singular? rather than a separate one.

Another way: steps

  1. Check the matrix is square; if it is not, stop.
  2. For $2 \times 2$, compute $ad - bc$; if it is zero, the matrix is singular.
  3. Otherwise use the formula, or reduce $[A \mid I]$ for anything larger.
  4. A zero row on the left during the reduction means singular; stop and say so.
  5. Multiply the answer back against $A$ and check you get $I$ before using it.

5. Why you should almost never compute an inverse

Having met $x = A^{-1}b$, it is tempting to solve every system that way. Do not.

Inverting an $n \times n$ matrix is roughly three times the work of eliminating on $[A \mid b]$ — reducing one wide array of $n$ extra columns rather than one. So for a single right-hand side, inversion costs three times as much and then still requires a multiplication. It is also less accurate in floating point, because the entries of $A^{-1}$ can be enormous when $A$ is nearly singular, and the errors in them are then multiplied into the answer.

The honest uses of an inverse are these. It is a formula: $x = A^{-1}b$ says what the solution is as a function of $b$, which elimination does not. It is an object of algebra: $(AB)^{-1} = B^{-1}A^{-1}$ and $A^{-1}$ appearing in $P^{-1}AP$ are statements about matrices, not requests for arithmetic. And where many systems share one $A$, the work done once is reused — though even then, the factorisation of the next lesson is the better way to reuse it.

The rule of thumb professionals use: if you have written $A^{-1}b$ in a program, you meant solve $Ax = b$, and you should say that instead.

6. All the ways of saying invertible

For a square matrix $A$, the following say the same thing, and the course will keep adding to the list:

This is the invertible matrix theorem, and it is the reason the subject hangs together: a question about solutions, a question about columns and a question about undoing all turn out to be one question.

Every word of it needs "square". For a $3 \times 2$ matrix the columns can perfectly well be independent while $Ax = b$ is unsolvable for most $b$; the two conditions come apart immediately. Keeping track of which claims need squareness is most of the care this subject asks for.

7. Where inverses go wrong

There is no division. $\dfrac{b}{A}$ means nothing. $A^{-1}b$ and $bA^{-1}$ are different expressions and usually only one of them is even defined, so the side an inverse is applied on is part of the answer.

Negate the off-diagonal, not the diagonal. In the $2 \times 2$ formula, $a$ and $d$ swap places and keep their signs; $b$ and $c$ stay put and change sign. Multiplying back catches the error at once, which is why it is worth the ten seconds.

$(AB)^{-1}$ is $B^{-1}A^{-1}$. The other order is wrong for exactly the same reason it is wrong for transposes, and for the reason you take a coat off before a jumper.

"Singular" is not "nearly zero". A matrix of enormous entries can be singular and a matrix of tiny ones invertible. The test is the determinant, or equivalently whether the reduction reaches the identity.

A rectangular matrix has no inverse at all. Not a hard one to find — there is no such thing. $A^{T}A$ may be invertible, and that is a different and very useful statement, but it is not an inverse of $A$.

8. Gauss-Jordan on a three by three

  1. $A = \begin{pmatrix} 1 & 2 & 0 \\ 0 & 1 & 3 \\ 0 & 0 & 1 \end{pmatrix}$. Write $[A \mid I]$; the left block is already upper triangular with pivots $1$.

    No downward pass is needed here.

  2. Row $2$ minus $3$ times row $3$ clears the $3$; on the right, row $2$ becomes $(0, 1, -3)$.

    Every operation is done to the whole wide row.

  3. Row $1$ minus $2$ times the new row $2$ clears the $2$: the right block is $\begin{pmatrix} 1 & -2 & 6 \\ 0 & 1 & -3 \\ 0 & 0 & 1 \end{pmatrix}$, and multiplying back gives $I$. Note the $6$ — it is the product of the two multipliers, not either of them.

    Corrections accumulate; that is why reduction, not guesswork.

9. A matrix with no inverse, twice over

  1. $B = \begin{pmatrix} 3 & 6 \\ 1 & 2 \end{pmatrix}$: the determinant is $6 - 6 = 0$, so the formula's denominator vanishes and there is no inverse.

    The arithmetic test.

  2. Reducing $[B \mid I]$: row $1$ minus $3$ times row $2$ gives a zero row on the left. The reduction can go no further, so no sequence of operations turns $B$ into $I$.

    The algorithmic test, reaching the same verdict.

  3. And $B\begin{pmatrix} 2 \\ -1 \end{pmatrix} = \begin{pmatrix} 0 \\ 0 \end{pmatrix}$: a non-zero vector sent to zero. Three descriptions, one fact.

    The structural test — and the one that explains the other two.

10. Your turn: is $\begin{pmatrix} 2 & 1 \\ 4 & 3 \end{pmatrix}$ invertible, and if so what is its inverse?

  1. Determinant: $2 \times 3 - 1 \times 4 = 2$, which is not zero, so yes.

    Always the determinant first.

  2. Swap the diagonal and negate the rest: $\begin{pmatrix} 3 & -1 \\ -4 & 2 \end{pmatrix}$, then divide by $2$.

    The formula, in the order it is stated.

  3. Your turn: work this step out. Its working is at the end of the packet.

    $A^{-1} = \begin{pmatrix} 3/2 & -1/2 \\ -2 & 1 \end{pmatrix}$, and multiplying back gives $\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$.

11. Guided practice

Write the inverse of $A = \begin{pmatrix} 1 & 1 \\ 2 & 3 \end{pmatrix}$.

This task has no paper form; do it on a device.

12. Guided practice

Write the inverse of $L = \begin{pmatrix} 1 & 0 & 0 \\ 3 & 1 & 0 \\ 2 & 5 & 1 \end{pmatrix}$.

This task has no paper form; do it on a device.

13. Practice

For which value of $k$ does $\begin{pmatrix} 3 & 8 \\ 3 & k \end{pmatrix}$ fail to have an inverse?

Answer:

14. Practice

Put the stages of inverting $\begin{pmatrix} 5 & 2 \\ 2 & 1 \end{pmatrix}$ by row reduction into the order they are carried out.

Number the steps in order (write the number in the box):

15. Practice

$A$ and $B$ are invertible matrices of the same size. What is $(AB)^{-1}$?

16. Somewhere new

Solve $Ax = b$ for the column $x$, where $A = \begin{pmatrix} 1 & 2 \\ 2 & 5 \end{pmatrix}$ and $b = \begin{pmatrix} 5 \\ 3 \end{pmatrix}$.

This task has no paper form; do it on a device.

17. Lesson test

Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.

18. Test question

Write the inverse of $A = \begin{pmatrix} 1 & 1 \\ 3 & 4 \end{pmatrix}$.

This task has no paper form; do it on a device.

19. What you can do now

You can invert a matrix by formula and by reduction, detect a singular one, and use the reversal rule. Say in your own words why a matrix that sends some non-zero vector to zero can have no inverse. Next: the matrices that carry out row operations, and the factorisation they produce.

Working for the steps left to you

10. Your turn: is $\begin{pmatrix} 2 & 1 \\ 4 & 3 \end{pmatrix}$ invertible, and if so what is its inverse?, step 3

Never skip the check.