Lab 8: Inverses

due by the end of class on Wednesday, October 21, 2026

Each lab worksheet will contain several activities, most of which will involve writing math on paper, and some of which will involve running code in a Jupyter Notebook. To receive credit for today’s lab, you must show your lab TA your work on this worksheet.

While you must get checked off by your lab TA individually, we encourage you to form groups with 1-2 other students to complete the activities together.


Activities


Review: Inverses. For a square matrix \(A\), an inverse is a matrix \(A^{-1}\) satisfying

$$ A^{-1}A=AA^{-1}=I. $$

Thus \(A^{-1}(A\vec x)=\vec x\) for every input \(\vec x\). A square matrix with an inverse is invertible; one without an inverse is singular.


Activity 1: A quick check

Let \(D=\begin{bmatrix}-2&0\\0&3\end{bmatrix}\) and \(E=\begin{bmatrix}-1/2&0\\0&1/3\end{bmatrix}\). Verify that \(E=D^{-1}\) by computing both products in the definition above. Explain geometrically how \(E\) undoes \(D\).

Solution

Both products are the identity:

$$ DE=\begin{bmatrix}(-2)(-1/2)&0\\0&3(1/3)\end{bmatrix}=I, \qquad ED=\begin{bmatrix}(-1/2)(-2)&0\\0&(1/3)3\end{bmatrix}=I. $$

So \(\boxed{E=D^{-1}}\). The matrix \(D\) flips the sign of the horizontal coordinate and stretches it by a factor of \(2\), and stretches the vertical coordinate by a factor of \(3\). The matrix \(E\) flips the horizontal sign back and scales the coordinates by \(1/2\) and \(1/3\), undoing both stretches.


Activity 2: Undo the motion

Find the inverse of each matrix below without using the formula given in Activity 3. Instead, use geometry and/or your understanding of the given transformation. Verify your answers by multiplying.

a)

The matrix \(Q=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\) rotates counterclockwise by \(90^\circ\). Describe the inverse transformation and write \(Q^{-1}\).

Solution

To undo a counterclockwise rotation by \(90^\circ\), rotate clockwise by \(90^\circ\). This sends \(\begin{bmatrix}x\\y\end{bmatrix}\) to \(\begin{bmatrix}y\\-x\end{bmatrix}\), so

$$ \boxed{Q^{-1}=\begin{bmatrix}0&1\\-1&0\end{bmatrix}}. $$

Checking both orders,

$$ QQ^{-1}=\begin{bmatrix}0&-1\\1&0\end{bmatrix}\begin{bmatrix}0&1\\-1&0\end{bmatrix}=I, \qquad Q^{-1}Q=\begin{bmatrix}0&1\\-1&0\end{bmatrix}\begin{bmatrix}0&-1\\1&0\end{bmatrix}=I. $$
b)

The shear \(S=\begin{bmatrix}1&2\\0&1\end{bmatrix}\) sends \(\begin{bmatrix}x\\y\end{bmatrix}\) to \(\begin{bmatrix}x+2y\\y\end{bmatrix}\). Explain how to recover the original coordinates from the output, and use this to find \(S^{-1}\).

Solution

The second coordinate doesn’t change. To recover the first coordinate, subtract twice the second coordinate from the first. In other words, the inverse sends \(\begin{bmatrix}u\\v\end{bmatrix}\) to \(\begin{bmatrix}u-2v\\v\end{bmatrix}\), so

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

Indeed,

$$ SS^{-1}=\begin{bmatrix}1&2\\0&1\end{bmatrix}\begin{bmatrix}1&-2\\0&1\end{bmatrix} =\begin{bmatrix}1&-2+2\\0&1\end{bmatrix}=I, $$
$$ S^{-1}S=\begin{bmatrix}1&-2\\0&1\end{bmatrix}\begin{bmatrix}1&2\\0&1\end{bmatrix} =\begin{bmatrix}1&2-2\\0&1\end{bmatrix}=I. $$

Activity 3: A formula for \(2\times2\) inverses

For a \(2\times2\) matrix,

$$ A=\begin{bmatrix}a&b\\c&d\end{bmatrix},\qquad A^{-1}=\frac{1}{ad-bc}\begin{bmatrix}d&-b\\-c&a\end{bmatrix} \quad\text{given }ad-bc\ne0. $$

The number \(ad-bc\) is called the determinant of \(A\). If \(ad-bc=0\), then \(A\) has no inverse.

a)

Find the inverse of \(A=\begin{bmatrix}4&-2\\3&2\end{bmatrix}\). Verify your result.

Solution

Here \(ad-bc=4(2)-(-2)(3)=14\), so

$$ \boxed{A^{-1}=\frac1{14}\begin{bmatrix}2&2\\-3&4\end{bmatrix}}. $$

Checking both products,

$$ AA^{-1}=\frac1{14}\begin{bmatrix}8+6&8-8\\6-6&6+8\end{bmatrix}=I, \qquad A^{-1}A=\frac1{14}\begin{bmatrix}8+6&-4+4\\-12+12&6+8\end{bmatrix}=I. $$
b)

For which values of \(t\) is \(M=\begin{bmatrix}4&-2\\3&t\end{bmatrix}\) invertible? For the value of \(t\) that makes \(M\) singular, describe the span of its columns and explain why some output vectors cannot be reached.

Solution

The determinant is \(4t-(-2)(3)=4t+6\). Thus, \(M\) is invertible exactly when

$$ \boxed{t\ne-\frac32}. $$

When \(t=-3/2\), the second column is \(-1/2\) times the first. Their span is therefore the line

$$ \operatorname{span}\!\left(\begin{bmatrix}4\\3\end{bmatrix}\right). $$

Every output \(M\vec x\) is a linear combination of these columns, so it lies on this line. A vector outside the line, such as \(\begin{bmatrix}1\\0\end{bmatrix}\), cannot be an output. There is no way to undo \(M\) on all of \(\mathbb R^2\).


Activity 4: Recover the input

Consider the equation

$$ A\vec x=\vec b, $$

where

$$ A=\begin{bmatrix}4&-2\\3&2\end{bmatrix},\qquad \vec x=\begin{bmatrix}x_1\\x_2\end{bmatrix},\qquad \vec b=\begin{bmatrix}6\\8\end{bmatrix}. $$

You found the inverse of \(A\) in Activity 3.

a)

Write \(A\vec x=\vec b\) as a system of two equations in the two unknowns \(x_1\) and \(x_2\). Then solve the system using \(A^{-1}\) and verify your solution.

Solution

Multiplying out \(A\vec x\) gives the system

$$ \begin{aligned} 4x_1-2x_2&=6,\\ 3x_1+2x_2&=8. \end{aligned} $$

Multiplying both sides of \(A\vec x=\vec b\) on the left by \(A^{-1}\) gives \(\vec x=A^{-1}\vec b\). Using our inverse from Activity 3,

$$ \vec x=\frac1{14}\begin{bmatrix}2&2\\-3&4\end{bmatrix}\begin{bmatrix}6\\8\end{bmatrix} =\frac1{14}\begin{bmatrix}12+16\\-18+32\end{bmatrix} =\boxed{\begin{bmatrix}2\\1\end{bmatrix}}. $$

Checking in the original equations, \(4(2)-2(1)=6\) and \(3(2)+2(1)=8\), as needed.

b)

Suppose the first entry of \(\vec b\) increases by \(1\) while the second stays fixed. How do \(x_1\) and \(x_2\) change? Explain how your answer is encoded in a column of \(A^{-1}\) and why the change does not depend on the original entries of \(\vec b\).

Solution

Increasing the first entry of \(\vec b\) by \(1\) adds \(\begin{bmatrix}1\\0\end{bmatrix}\) to \(\vec b\). The new solution is

$$ A^{-1}\!\left(\vec b+\begin{bmatrix}1\\0\end{bmatrix}\right) =A^{-1}\vec b+A^{-1}\begin{bmatrix}1\\0\end{bmatrix} =\vec x+\frac1{14}\begin{bmatrix}2\\-3\end{bmatrix}. $$

So \(\boxed{x_1\text{ increases by }1/7}\) and \(\boxed{x_2\text{ decreases by }3/14}\). Multiplying by \(\begin{bmatrix}1\\0\end{bmatrix}\) picks out the first column of \(A^{-1}\). The change depends only on this column and the change in \(\vec b\), not on the original entries of \(\vec b\).


Activity 5: Undo a sequence

An image editor first stretches horizontally by a factor of \(2\), then applies a horizontal shear:

$$ D=\begin{bmatrix}2&0\\0&1\end{bmatrix},\qquad S=\begin{bmatrix}1&1\\0&1\end{bmatrix}. $$

Find the combined matrix \(C\) and its inverse. Express \(C^{-1}\) as a product involving \(D^{-1}\) and \(S^{-1}\), and explain the order in terms of undoing the two edits.

Solution

Stretching first and then shearing gives \(S(D\vec x)\), so

$$ C=SD=\begin{bmatrix}1&1\\0&1\end{bmatrix}\begin{bmatrix}2&0\\0&1\end{bmatrix} =\boxed{\begin{bmatrix}2&1\\0&1\end{bmatrix}}. $$

To undo the edits, first undo the shear, then undo the stretch. Since the matrix on the right acts first,

$$ C^{-1}=D^{-1}S^{-1} =\begin{bmatrix}1/2&0\\0&1\end{bmatrix}\begin{bmatrix}1&-1\\0&1\end{bmatrix} =\boxed{\begin{bmatrix}1/2&-1/2\\0&1\end{bmatrix}}. $$

This order also works algebraically:

$$ (D^{-1}S^{-1})(SD)=D^{-1}(S^{-1}S)D=I, $$
$$ (SD)(D^{-1}S^{-1})=S(DD^{-1})S^{-1}=I. $$

Activity 6: Solving matrix equations

a)

Suppose \(A\) is a square matrix satisfying

$$ A^4-3A^3+A^2+3A+5I=0, $$

where \(I\) and \(0\) are the identity and zero matrices of the same shape as \(A\). Find an expression for \(A^{-1}\) in terms of powers of \(A\), and justify why it is an inverse.

Solution

Move the constant term to the other side and factor out \(A\):

$$ A^4-3A^3+A^2+3A=-5I, \qquad A(A^3-3A^2+A+3I)=-5I. $$

Dividing by \(-5\) gives

$$ A\left[-\frac15(A^3-3A^2+A+3I)\right]=I. $$

We can also factor \(A\) on the right, because multiplying powers of \(A\) in either order gives the same result. Thus the proposed inverse multiplies with \(A\) to give \(I\) in both orders, and

$$ \boxed{A^{-1}=-\frac15A^3+\frac35A^2-\frac15A-\frac35I}. $$
b)

Suppose \(A=BC\), where

$$ A=\begin{bmatrix}5&-3\\10&1\end{bmatrix},\qquad B=\begin{bmatrix}2&1\\1&3\end{bmatrix}. $$

Find \(C\).

Solution

Multiply both sides of \(A=BC\) on the left by \(B^{-1}\):

$$ B^{-1}A=B^{-1}BC=C. $$

Since \(2(3)-1(1)=5\),

$$ B^{-1}=\frac15\begin{bmatrix}3&-1\\-1&2\end{bmatrix}. $$

Therefore,

$$ C=\frac15\begin{bmatrix}3&-1\\-1&2\end{bmatrix}\begin{bmatrix}5&-3\\10&1\end{bmatrix} =\frac15\begin{bmatrix}5&-10\\15&5\end{bmatrix} =\boxed{\begin{bmatrix}1&-2\\3&1\end{bmatrix}}. $$

As a check,

$$ BC=\begin{bmatrix}2&1\\1&3\end{bmatrix}\begin{bmatrix}1&-2\\3&1\end{bmatrix} =\begin{bmatrix}5&-3\\10&1\end{bmatrix}=A. $$