Tutorials › Linear Algebra › The Inverse of a Product

Elementary Matrices and Inverses · Tutorial 102 of 1000

The Inverse of a Product

Learn why undoing a product of two invertible matrices requires undoing the factors in reverse order.

Beginner 9 min read

What You'll Learn

  • State the conditions under which the inverse of a product is defined.
  • Prove that \(AB\) is invertible when \(A\) and \(B\) are invertible.
  • Verify the formula \((AB)^{-1}=B^{-1}A^{-1}\) by multiplication on both sides.
  • Explain how matrix multiplication represents composition of actions.
  • Identify why reversing the order is essential for noncommuting matrices.

Undoing a Product

When two actions are performed in succession, undoing the combined action requires undoing the last action first. Matrix multiplication follows this same order: in \(AB\mathbf{x}\), the matrix \(B\) acts on \(\mathbf{x}\) first, and \(A\) acts on the result. Therefore, if both matrices are invertible, the operation that undoes \(AB\) must first undo \(A\), and then undo \(B\). This is why the inverse factors appear in the opposite order.

In this tutorial, \(A\) and \(B\) are square matrices of the same size \(n\times n\) with real entries. The product \(AB\) is also \(n\times n\). We use associativity of matrix multiplication and the identity matrix \(\mathbf{I}_n\). The inverse of a matrix \(A\) is a matrix \(A^{-1}\) satisfying both \(AA^{-1}=\mathbf{I}_n\) and \(A^{-1}A=\mathbf{I}_n\).

Definition: A square matrix \(A\in\mathbb{R}^{n\times n}\) is invertible if there exists a matrix \(A^{-1}\in\mathbb{R}^{n\times n}\) such that \(AA^{-1}=A^{-1}A=\mathbf{I}_n\). The inverse must work on both the left and the right.

Suppose \(A\) and \(B\) are invertible. To find the inverse of \(AB\), we need a matrix that gives \(\mathbf{I}_n\) when multiplied by \(AB\), on either side. The proposed matrix is \(B^{-1}A^{-1}\), with the factors in reverse order. The proof is a direct check of both products. Checking only one side would not, by the definition alone, establish that the proposed matrix is an inverse.

The Product Inverse Theorem

Theorem: If \(A,B\in\mathbb{R}^{n\times n}\) are invertible, then \(AB\) is invertible and \((AB)^{-1}=B^{-1}A^{-1}\).

Proof. Since \(A\) and \(B\) are invertible, \(A^{-1}\) and \(B^{-1}\) exist, and their defining equations are \(AA^{-1}=A^{-1}A=\mathbf{I}_n\) and \(BB^{-1}=B^{-1}B=\mathbf{I}_n\). Consider \(B^{-1}A^{-1}\). By associativity and the inverse equations, multiplication on the right gives \((AB)(B^{-1}A^{-1})=A(BB^{-1})A^{-1}=A\mathbf{I}_nA^{-1}=AA^{-1}=\mathbf{I}_n\). Multiplication on the left gives \((B^{-1}A^{-1})(AB)=B^{-1}(A^{-1}A)B=B^{-1}\mathbf{I}_nB=B^{-1}B=\mathbf{I}_n\). Thus \(B^{-1}A^{-1}\) is a two-sided inverse of \(AB\), so \(AB\) is invertible and its inverse is \(B^{-1}A^{-1}\). \(\square\)

The reverse order is forced by the grouping in the proof. On the right, \(B\) meets \(B^{-1}\) first; on the left, \(A^{-1}\) meets \(A\) first. These adjacent inverse pairs simplify to the identity. If the proposed inverse factors were left in the original order, those cancellations would not generally occur.

Worked Example: A Product of Two Shear Matrices

Let \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\) and \(\mathbf{B}=\begin{bmatrix}1&0\\1&1\end{bmatrix}\). Find the inverse of \(\mathbf{A}\mathbf{B}\) using the theorem, and verify the result.

First check the inverses of the individual matrices. Take \(\mathbf{A}^{-1}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\). Then \(\mathbf{A}\mathbf{A}^{-1}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\), since its entries are \(1-0,\;-1+1,\;0,\;1\); and \(\mathbf{A}^{-1}\mathbf{A}=\begin{bmatrix}1&0\\0&1\end{bmatrix}\) as well. Similarly, take \(\mathbf{B}^{-1}=\begin{bmatrix}1&0\\-1&1\end{bmatrix}\). Both \(\mathbf{B}\mathbf{B}^{-1}\) and \(\mathbf{B}^{-1}\mathbf{B}\) equal \(\begin{bmatrix}1&0\\0&1\end{bmatrix}\).

Now form the product and use the reverse-order formula:

$$ \mathbf{A}\mathbf{B} = \begin{bmatrix}1&1\\0&1\end{bmatrix} \begin{bmatrix}1&0\\1&1\end{bmatrix} = \begin{bmatrix}2&1\\1&1\end{bmatrix}, \qquad (\mathbf{A}\mathbf{B})^{-1} =\mathbf{B}^{-1}\mathbf{A}^{-1} = \begin{bmatrix}1&-1\\-1&2\end{bmatrix}. $$

Check the product in one order. Its four entries are \(2-1,\;-2+2,\;1-1,\;-1+2\):

$$ \begin{bmatrix}2&1\\1&1\end{bmatrix} \begin{bmatrix}1&-1\\-1&2\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

For the other order, the entries are \(2-1,\;-1+1,\;-2+2,\;1\):

$$ \begin{bmatrix}1&-1\\-1&2\end{bmatrix} \begin{bmatrix}2&1\\1&1\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

Both checks give the identity, as the definition of an inverse requires.

Why the Order Reverses

Matrix multiplication can describe successive actions on a column vector. If \(B\) acts first and \(A\) acts second, the combined result is \(A(B\mathbf{x})=(AB)\mathbf{x}\). To return to \(\mathbf{x}\), apply \(A^{-1}\) first to undo the second action, then apply \(B^{-1}\) to undo the first. The corresponding matrix product is \(B^{-1}A^{-1}\): its rightmost factor acts first.

We can also see this using the theorem's calculation. In \((AB)(B^{-1}A^{-1})\), the middle pair \(BB^{-1}\) cancels, leaving \(AA^{-1}\). In \((B^{-1}A^{-1})(AB)\), the middle pair \(A^{-1}A\) cancels, leaving \(B^{-1}B\). The same order reversal makes both sides reduce to the identity.

Worked Example: Diagonal Matrices

Let \(\mathbf{C}=\begin{bmatrix}2&0\\0&1\end{bmatrix}\) and \(\mathbf{D}=\begin{bmatrix}1&0\\0&3\end{bmatrix}\). Each matrix is invertible, with \(\mathbf{C}^{-1}=\begin{bmatrix}\tfrac12&0\\0&1\end{bmatrix}\) and \(\mathbf{D}^{-1}=\begin{bmatrix}1&0\\0&\tfrac13\end{bmatrix}\). Multiplying each matrix by its proposed inverse, in either order, gives \(\begin{bmatrix}1&0\\0&1\end{bmatrix}\).

The matrices commute in this example: both \(\mathbf{C}\mathbf{D}\) and \(\mathbf{D}\mathbf{C}\) equal \(\begin{bmatrix}2&0\\0&3\end{bmatrix}\). The theorem gives

$$ (\mathbf{C}\mathbf{D})^{-1} =\mathbf{D}^{-1}\mathbf{C}^{-1} = \begin{bmatrix}1&0\\0&\tfrac13\end{bmatrix} \begin{bmatrix}\tfrac12&0\\0&1\end{bmatrix} = \begin{bmatrix}\tfrac12&0\\0&\tfrac13\end{bmatrix}. $$

Multiplying back verifies the answer in both directions:

$$ \begin{bmatrix}2&0\\0&3\end{bmatrix} \begin{bmatrix}\tfrac12&0\\0&\tfrac13\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}, \qquad \begin{bmatrix}\tfrac12&0\\0&\tfrac13\end{bmatrix} \begin{bmatrix}2&0\\0&3\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

Here reversing the inverse factors does not change their product, because the two diagonal matrices commute. This special case does not show that order can be ignored in general.

A Longer Product

The same reasoning applies to any finite sequence of invertible square matrices of the same size. Each step of the sequence must be undone in the reverse order. This follows by repeatedly applying the two-factor theorem, not by changing the rule for how matrix products act.

Corollary: If \(A_1,\dots,A_k\in\mathbb{R}^{n\times n}\) are invertible, where \(k\geq 1\), then \((A_1A_2\cdots A_k)^{-1}=A_k^{-1}A_{k-1}^{-1}\cdots A_1^{-1}\).

Proof. For \(k=1\), the statement is the definition of \(A_1^{-1}\). Assume the formula holds for a product of \(k\) invertible matrices. For \(k+1\) factors, group the first \(k\) factors as \(P=A_1\cdots A_k\). The induction assumption gives \(P^{-1}=A_k^{-1}\cdots A_1^{-1}\), and \(P\) is invertible. Applying the two-factor theorem to \(PA_{k+1}\) gives \((PA_{k+1})^{-1}=A_{k+1}^{-1}P^{-1}=A_{k+1}^{-1}A_k^{-1}\cdots A_1^{-1}\). This is the formula for \(k+1\). Therefore it holds for every integer \(k\geq 1\). \(\square\)

Worked Example: Two Noncommuting Matrices

Take \(\mathbf{E}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\) and \(\mathbf{F}=\begin{bmatrix}1&0\\2&1\end{bmatrix}\). Their inverses are \(\mathbf{E}^{-1}=\begin{bmatrix}1&-2\\0&1\end{bmatrix}\) and \(\mathbf{F}^{-1}=\begin{bmatrix}1&0\\-2&1\end{bmatrix}\). Direct multiplication in either order gives the identity for each matrix and its proposed inverse.

The product and its inverse, in the required order, are

$$ \mathbf{E}\mathbf{F} = \begin{bmatrix}1&2\\0&1\end{bmatrix} \begin{bmatrix}1&0\\2&1\end{bmatrix} = \begin{bmatrix}5&2\\2&1\end{bmatrix}, \qquad \mathbf{F}^{-1}\mathbf{E}^{-1} = \begin{bmatrix}1&0\\-2&1\end{bmatrix} \begin{bmatrix}1&-2\\0&1\end{bmatrix} = \begin{bmatrix}1&-2\\-2&5\end{bmatrix}. $$

Multiplying back, the entries are \(5-4,\;-10+10,\;2-2,\;-4+5\), so

$$ \begin{bmatrix}5&2\\2&1\end{bmatrix} \begin{bmatrix}1&-2\\-2&5\end{bmatrix} = \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

The opposite multiplication also gives the identity: its entries are \(5-4,\;-10+10,\;2-2,\;-4+5\). Thus the candidate is indeed a two-sided inverse.

Common Pitfall: Keeping the Original Order

A common error is to write \((AB)^{-1}=A^{-1}B^{-1}\), retaining the order of the original factors. The noncommuting matrices in the last example show concretely why this fails. The incorrect candidate is

$$ \mathbf{E}^{-1}\mathbf{F}^{-1} = \begin{bmatrix}1&-2\\0&1\end{bmatrix} \begin{bmatrix}1&0\\-2&1\end{bmatrix} = \begin{bmatrix}5&-2\\-2&1\end{bmatrix}. $$

Multiplying it by \(\mathbf{E}\mathbf{F}\) gives

$$ \begin{bmatrix}5&2\\2&1\end{bmatrix} \begin{bmatrix}5&-2\\-2&1\end{bmatrix} = \begin{bmatrix}21&-8\\8&-3\end{bmatrix} \ne \begin{bmatrix}1&0\\0&1\end{bmatrix}. $$

The incorrect result does not even give the identity on the right, so it cannot be the inverse. The issue is not that each individual inverse was wrong; it is that the product put the inverse factors in an order that did not allow the required cancellations. A useful check is to write the full product with parentheses: \((AB)(B^{-1}A^{-1})=A(BB^{-1})A^{-1}\).

Also keep the hypotheses in view. The theorem assumes that both factors are invertible square matrices of the same size. If either factor is not invertible, its inverse in the formula is not defined, and this argument does not apply. When the hypotheses hold, the theorem establishes both that the product is invertible and exactly what its inverse is.

Check Your Understanding

For each question, use the definition of a two-sided inverse and keep track of the multiplication order.

  1. In a product \(AB\mathbf{x}\), which matrix acts on \(\mathbf{x}\) first? Use this to explain why undoing the product starts with \(A^{-1}\).
  2. Write out both products that must equal \(\mathbf{I}_n\) to verify that \(B^{-1}A^{-1}\) is the inverse of \(AB\).
  3. For three invertible matrices \(A,B,C\), state the inverse of \(ABC\) in the correct order.
  4. Why does a diagonal-matrix example in which the factors commute fail to show that inverse factors may always be written in either order?
  5. For the matrices \(\mathbf{E}\) and \(\mathbf{F}\) above, explain why \(\mathbf{E}^{-1}\mathbf{F}^{-1}\) is not the inverse of \(\mathbf{E}\mathbf{F}\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon