Skip to main content

Welcome to a Grasp lesson

Create a free account to keep studying and create your own study path.

Lesson 3

Inverting 2x2 Matrices: Algebraic Calculation and Geometric Reversal

Recommended resources

In our previous lesson, we established a critical principle: a linear transformation with a determinant of zero collapses space into a lower dimension and is therefore irreversible. We called such transformations, and their corresponding matrices, singular.

This lesson explores the other side of that coin: the rich and useful world of reversible transformations. When a transformation is non-singular (i.e., its determinant is not zero), we can "undo" it. This lesson will show you how to conceptualize and compute this "undoing" operation, known as the matrix inverse. We will interpret matrix inversion as the geometric reversal of a linear transformation and learn the specific formula for calculating the inverse of a 2x2 matrix.

The Inverse as a Reverse Transformation

Let's return to the core problem of solving a linear system, . Geometrically, this asks: "Which vector , after being transformed by matrix , lands on vector ?"

In the last lesson, we saw that if det(A) = 0, there might be no solution or infinitely many, but never a single, unique one. This is because the transformation is not one-to-one; multiple input vectors get mapped to the same output vector.

However, if det(A) ≠ 0, the transformation does not collapse space. Every output vector corresponds to exactly one input vector . This means we can devise a way to get back from to . We can "play the movie backwards." This reverse transformation is itself a linear transformation, and we call it the inverse of A, denoted by .

The 3Blue1Brown video you watched previously provides the perfect visual intuition for this.

Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra

This video from 3Blue1Brown, "Inverse matrices, column space and null space," elegantly explains the concept of an inverse by framing it as the reversal of a transformation.

Watch the following segments to solidify your intuition: The geometric setup: This recaps how solving Ax=v is equivalent to finding a vector x that lands on v after the transformation A. Playing it in reverse: This is the core idea. Notice how a rotation is undone by a rotation in the opposite direction, and a shear is undone by an opposing shear. This "reverse" operation is the inverse transformation, A^{-1}. The identity matrix: This part explains that applying a transformation and then its inverse gets you back to where you started. This "do nothing" transformation is represented by the identity matrix, I. Higher dimensions: This confirms that the concept extends beyond 2D. The irreversible case: This is a recap of our last lesson—you cannot "unsquish" a line to get back a plane, which is why singular matrices have no inverse.

The essential property of the inverse matrix is that when you compose it with the original matrix , they cancel each other out, resulting in the identity transformation. The identity transformation is the one that does nothing, leaving all vectors in their original positions. Its matrix, called the identity matrix , has 1s on the diagonal and 0s everywhere else. For a 2x2 case:

Algebraically, this relationship is expressed as:


Why Do We Need an Inverse? An Application

Before we compute an inverse, let's see why we might want one. The concept of an inverse operation is fundamental to solving for unknown inputs given a desired output.

What is the Inverse of a Matrix ??? : Data Science Basics

The video "What is the Inverse of a Matrix???" from the channel ritvikmath offers a simple, practical scenario that motivates the need for matrix inversion.

Please watch the first part of the video, from the beginning to 9:30. Focus on how the problem is framed as an input-output machine. Forward Problem: Given factors f (how much your ticket and merch sales will change), what will your total profits m be? This is calculated as P * f = m. Inverse Problem: Given a target profit m, what factors f do you need to achieve it? This requires "undoing" the matrix P, which is exactly what the inverse P⁻¹ does: f = P⁻¹ * m.

This example powerfully illustrates the role of the inverse: it reverses the mapping to solve for the original inputs. This pattern appears frequently in science and engineering, including in solving for the parameters of a linear model. If we have a model described by the matrix equation , where contains our feature data and the outcomes, solving for the model weights is achieved by .


Computing the 2x2 Inverse

Now that we have the geometric and practical intuition, let's look at the mechanics. For a 2x2 matrix, there is a straightforward formula to calculate its inverse.

2.4 Matrix Inverses

This document provides the standard mathematical definition and formula for the 2x2 matrix inverse.

Please read the section that begins just after the definition of the determinant and adjugate. Focus on Example 2.4.4. This section introduces the formula and proves that an inverse exists if and only if the determinant is non-zero.

As the text shows, for a general 2x2 matrix:

Its inverse is given by the formula:

Notice the term in the denominator: . This is precisely the determinant of ! This formula elegantly unites our last two lessons. It explicitly shows that you can only find an inverse if the determinant is non-zero, because division by zero is undefined.

Let's try an example. Find the inverse of the matrix .

  1. Calculate the determinant: . Since the determinant is not zero, an inverse exists.

  2. Apply the formula:

To verify our result, we can multiply by and check if we get the identity matrix:

It works! The matrix perfectly undoes the transformation performed by .

The image below provides a final geometric summary. The matrix transforms the standard basis vectors into its columns, forming the red parallelogram. The inverse matrix represents the transformation that would map that parallelogram back to the original unit square.

This image visualizes a linear transformation defined by the columns of matrix A (vectors a₁ and a₂, forming the red parallelogram) and the transformation defined by its inverse, A⁻¹ (with columns a¹ and a², forming the blue parallelogram). Each transformation geometrically "undoes" the other, mapping the distorted parallelogram back to the original unit square (and vice-versa).

This image visualizes a linear transformation defined by the columns of matrix A (vectors a₁ and a₂, forming the red parallelogram) and the transformation defined by its inverse, A⁻¹ (with columns a¹ and a², forming the blue parallelogram). Each transformation geometrically "undoes" the other, mapping the distorted parallelogram back to the original unit square (and vice-versa).


Conclusion

In this lesson, we moved from irreversible to reversible transformations. We've defined the matrix inverse both conceptually and computationally.

  • Key Takeaways:
    • The inverse of a matrix , denoted , represents a linear transformation that "reverses" or "undoes" the transformation of .
    • An inverse exists only if the matrix is non-singular, meaning its determinant is non-zero.
    • Composing a transformation with its inverse yields the identity transformation ().
    • For a 2x2 matrix , the inverse is .

We've now covered how matrices can scale, rotate, shear, and even collapse space, and how these operations can be reversed. In the next lesson, we will add one more crucial operation: translation (shifting). By combining a linear transformation with a translation, we get an affine transformation, which forms the mathematical basis of a single layer in a neural network.