Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

3.6: Inverses

In Chapter 3.4, we saw matrices stretch, rotate, reflect, and project vectors. Some of those operations can be undone; others lose information. Here, we’ll connect the idea of undoing a transformation to the algebra of a matrix inverse.

Our goal is to understand what an inverse must do, find inverses in simple cases, and use them to solve equations. We’ll return to the broader question of which matrices are invertible soon.


What is an inverse?

With numbers, a multiplicative inverse is a number that multiplies with the original to give 1. For instance, the inverse of 2 is 12\frac12, because

2(12)=(12)2=1.2\left(\frac12\right)=\left(\frac12\right)2=1.

For matrices, the identity matrix plays the role of 1. Recall that InI_n leaves every vector in Rn\mathbb R^n unchanged, and InA=AIn=AI_nA=AI_n=A for an n×nn\times n matrix AA.

The result must be the identity matrix in both orders. For square matrices, however, checking one order is enough: if AA and BB both have shape n×nn\times n and AB=InAB=I_n, then BA=InBA=I_n as well. Thus, if a candidate for A−1A^{-1} gives AA−1=InAA^{-1}=I_n, the other order automatically gives A−1A=InA^{-1}A=I_n. These are matrix products, not products of entries in matching positions. In particular, finding A−1A^{-1} does not mean replacing each entry of AA by its reciprocal.

We’ll use the word “inverse” in this sense for square matrices. Being square allows a matrix to be invertible, but doesn’t guarantee that it is; projection onto the xx-axis will give us a counterexample below.

Can a matrix have more than one inverse?

No. Suppose BB and CC both satisfy the definition for AA. Then

B=BIn=B(AC)=(BA)C=InC=C.B=BI_n=B(AC)=(BA)C=I_nC=C.

So the inverse, when it exists, is unique. The definition also tells us that

In−1=In,(A−1)−1=A.I_n^{-1}=I_n,\qquad (A^{-1})^{-1}=A.

The second identity says that the inverse of the inverse is the original matrix: each one undoes the other.


The inverse of a 2×22\times2 matrix

For 2×22\times2 matrices, we have a convenient formula:

In words: exchange the diagonal entries, negate the off-diagonal entries, and divide the whole matrix by ad−bcad-bc. The number ad−bcad-bc is called the determinant of this 2×22\times2 matrix. We’ll study determinants more later; for now, this expression tells us whether the formula can be used.

Why does the formula work?

Set M=[d−b−ca]M=\begin{bmatrix}d&-b\\-c&a\end{bmatrix}. Multiplying in each order gives

AM=[ad−bc−ab+bacd−dc−cb+da]=(ad−bc)I2,MA=[da−bcdb−bd−ca+ac−cb+ad]=(ad−bc)I2.\begin{aligned} AM&=\begin{bmatrix}ad-bc&-ab+ba\\cd-dc&-cb+da\end{bmatrix} =(ad-bc)I_2,\\ MA&=\begin{bmatrix}da-bc&db-bd\\-ca+ac&-cb+ad\end{bmatrix} =(ad-bc)I_2. \end{aligned}

If ad−bc≠0ad-bc\ne0, dividing MM by that number makes both products equal I2I_2, exactly as the inverse definition requires. If ad−bc=0ad-bc=0, the matrix is singular, and division by zero cannot produce an inverse.

An example

Take

A=[2111].A=\begin{bmatrix}2&1\\1&1\end{bmatrix}.

Here, ad−bc=2(1)−1(1)=1ad-bc=2(1)-1(1)=1, so

A−1=[1−1−12].A^{-1}=\begin{bmatrix}1&-1\\-1&2\end{bmatrix}.

Let’s check both products. We don’t strictly need to check both: for square matrices, if one order gives the identity, so does the other. But checking both is a good habit, since order matters in matrix multiplication in general:

AA−1=[2111][1−1−12]=[1001],A−1A=[1−1−12][2111]=[1001].\begin{aligned} AA^{-1}&=\begin{bmatrix}2&1\\1&1\end{bmatrix} \begin{bmatrix}1&-1\\-1&2\end{bmatrix} =\begin{bmatrix}1&0\\0&1\end{bmatrix},\\ A^{-1}A&=\begin{bmatrix}1&-1\\-1&2\end{bmatrix} \begin{bmatrix}2&1\\1&1\end{bmatrix} =\begin{bmatrix}1&0\\0&1\end{bmatrix}. \end{aligned}

On the other hand, [1224]\begin{bmatrix}1&2\\2&4\end{bmatrix} has ad−bc=4−4=0ad-bc=4-4=0, so it is singular. Its second column is twice its first, which will matter when we discuss linear independence.


Undoing a transformation

What do the two identities in the definition mean geometrically? If we apply AA to a vector and then apply A−1A^{-1}, we get the original vector back:

x⃗→ A Ax⃗→ A−1 A−1(Ax⃗)=x⃗.\vec x\xrightarrow{\ A\ }A\vec x \xrightarrow{\ A^{-1}\ }A^{-1}(A\vec x)=\vec x.

This is the meaning of A−1A=InA^{-1}A=I_n. The other identity, AA−1=InAA^{-1}=I_n, says that starting with A−1A^{-1} and then applying AA also returns the original vector.

For the example above,

[10]→ A [21]→ A−1 [10],[01]→ A [11]→ A−1 [01].\begin{bmatrix}1\\0\end{bmatrix}\xrightarrow{\ A\ } \begin{bmatrix}2\\1\end{bmatrix}\xrightarrow{\ A^{-1}\ } \begin{bmatrix}1\\0\end{bmatrix},\qquad \begin{bmatrix}0\\1\end{bmatrix}\xrightarrow{\ A\ } \begin{bmatrix}1\\1\end{bmatrix}\xrightarrow{\ A^{-1}\ } \begin{bmatrix}0\\1\end{bmatrix}.

The columns of AA tell us where the standard basis vectors go. The inverse sends those outputs back to the corresponding basis vectors. It also returns every other point to its original position, as the picture shows.

Loading...

Stretching and rotating

If H=[2001]H=\begin{bmatrix}2&0\\0&1\end{bmatrix} doubles the horizontal coordinate, undoing it means halving that coordinate:

H−1=[1/2001].H^{-1}=\begin{bmatrix}1/2&0\\0&1\end{bmatrix}.

If RθR_\theta rotates counterclockwise by θ\theta, its inverse rotates by −θ-\theta:

Rθ−1=R−θ=[cos⁡θsin⁡θ−sin⁡θcos⁡θ].R_\theta^{-1}=R_{-\theta} =\begin{bmatrix}\cos\theta&\sin\theta\\-\sin\theta&\cos\theta\end{bmatrix}.

A reflection across the xx-axis is another useful example: reflecting twice returns every point to where it started, so that matrix is its own inverse.

Why a projection has no inverse

Projection onto the xx-axis uses

P=[1000].P=\begin{bmatrix}1&0\\0&0\end{bmatrix}.

It sends both [12]\begin{bmatrix}1\\2\end{bmatrix} and [15]\begin{bmatrix}1\\5\end{bmatrix} to [10]\begin{bmatrix}1\\0\end{bmatrix}. Given only this output, an inverse would have to recover two different original inputs from the same vector. A function can’t do that!

Algebraically, if P−1P^{-1} existed, multiplying the equation Px⃗=Py⃗P\vec x=P\vec y on the left by P−1P^{-1} would give x⃗=y⃗\vec x=\vec y. Our two inputs are different, so this is impossible.

An invertible transformation must preserve enough information to recover every input. In fact, for every b⃗∈Rn\vec b\in\mathbb R^n, there is exactly one x⃗∈Rn\vec x\in\mathbb R^n with Ax⃗=b⃗A\vec x=\vec b: it is x⃗=A−1b⃗\vec x=A^{-1}\vec b.


Which matrices are invertible?

We’ve seen a formula for 2×22\times2 matrices. What about larger square matrices?

Roughly, linear independence means that no column can be written as a linear combination of the others. In our singular example [1224]\begin{bmatrix}1&2\\2&4\end{bmatrix}, the second column is twice the first, so the columns are not linearly independent.

For a square matrix, independent columns give us a transformation that can be undone. We’ll define linear independence carefully and explore this connection more soon. For now, we can use the inverse identities and the 2×22\times2 formula without developing that theory.


The inverse of a product

Suppose AA and BB are invertible square matrices of the same shape. In Chapter 3.5, we saw that ABAB applies BB first and then AA. To undo both steps, which inverse should act first?

We need to undo the last step first: apply A−1A^{-1}, then B−1B^{-1}. The matrix for those two steps is B−1A−1B^{-1}A^{-1}.

Let’s verify both identities, keeping the factors in order and using associativity. Again, one check would suffice because these matrices are square, but it doesn’t hurt to check both:

(AB)(B−1A−1)=A(BB−1)A−1=AInA−1=In,(B−1A−1)(AB)=B−1(A−1A)B=B−1InB=In.\begin{aligned} (AB)(B^{-1}A^{-1})&=A(BB^{-1})A^{-1}=AI_nA^{-1}=I_n,\\ (B^{-1}A^{-1})(AB)&=B^{-1}(A^{-1}A)B=B^{-1}I_nB=I_n. \end{aligned}

Both products are the identity, so B−1A−1B^{-1}A^{-1} satisfies the inverse definition.

For example, let HH be our horizontal stretch and R=[0−110]R=\begin{bmatrix}0&-1\\1&0\end{bmatrix} our 90∘90^\circ counterclockwise rotation. Stretching first, then rotating, uses RHRH. Undoing this means rotating clockwise first, then halving the horizontal coordinate:

(RH)−1=H−1R−1=[1/2001][01−10]=[01/2−10].(RH)^{-1}=H^{-1}R^{-1} =\begin{bmatrix}1/2&0\\0&1\end{bmatrix} \begin{bmatrix}0&1\\-1&0\end{bmatrix} =\begin{bmatrix}0&1/2\\-1&0\end{bmatrix}.

The reversed order is essential: undo the last transformation first.


Solving equations with inverses

With numbers, we might solve 2x=52x=5 by dividing by 2. With matrices, we multiply by an inverse. We need to choose the correct side, so that the matrix and its inverse appear next to each other.

A vector equation

If AA is invertible and Ax⃗=b⃗A\vec x=\vec b, multiply both sides on the left by A−1A^{-1}:

A−1(Ax⃗)=A−1b⃗⟹x⃗=A−1b⃗.A^{-1}(A\vec x)=A^{-1}\vec b \quad\Longrightarrow\quad \boxed{\vec x=A^{-1}\vec b.}

For our earlier matrix AA, solving

[2111]x⃗=[53]\begin{bmatrix}2&1\\1&1\end{bmatrix}\vec x =\begin{bmatrix}5\\3\end{bmatrix}

gives

x⃗=[1−1−12][53]=[21].\vec x=\begin{bmatrix}1&-1\\-1&2\end{bmatrix} \begin{bmatrix}5\\3\end{bmatrix} =\begin{bmatrix}2\\1\end{bmatrix}.

Substituting this vector into the original equation gives [53]\begin{bmatrix}5\\3\end{bmatrix}, as required.

A matrix equation

The same reasoning works when the unknown is a matrix XX. If AX=BAX=B, then

A−1(AX)=A−1B⟹X=A−1B.A^{-1}(AX)=A^{-1}B \quad\Longrightarrow\quad \boxed{X=A^{-1}B.}

If instead XA=BXA=B, multiply on the right:

(XA)A−1=BA−1⟹X=BA−1.(XA)A^{-1}=BA^{-1} \quad\Longrightarrow\quad \boxed{X=BA^{-1}.}

In each case, assume AA is invertible and the shapes allow the original equation. The two answers have different orders because the unknown appears on different sides of AA.

For example, if AXB=CAXB=C, where AA and BB are invertible and all matrices have shape n×nn\times n, multiply on the left by A−1A^{-1} and on the right by B−1B^{-1}:

A−1(AXB)B−1=A−1CB−1⟹X=A−1CB−1.A^{-1}(AXB)B^{-1}=A^{-1}CB^{-1} \quad\Longrightarrow\quad X=A^{-1}CB^{-1}.

We haven’t moved any factors past one another. We’ve placed the inverses where they can cancel with their corresponding matrices.