Introduction
In our last lesson, you learned how to construct matrices to represent specific geometric transformations like scaling, rotation, and shear. We established that a matrix is a tool for transforming space. Now, we'll explore two fundamental properties of these transformations: how to measure their effect on area/volume and how to reverse them.
This lesson addresses the learning outcome: Compute the determinant and inverse of a matrix. We will first study the determinant, a single number that tells us the factor by which a transformation scales space. Then, we will explore the inverse matrix, which represents the transformation that "undoes" or reverses the original one. Mastering these concepts is crucial for solving systems of linear equations and is a bedrock principle in many AI and machine learning algorithms.
1. The Determinant: A Measure of Scaling
A linear transformation can stretch, compress, or shear space. The determinant of a matrix gives us a precise number to quantify this effect.
- In 2D, the determinant is the factor by which the area of any shape changes after the transformation.
- In 3D, it's the factor by which volume changes.
A positive determinant means the orientation of space is preserved. A negative determinant means the orientation is flipped (like looking at a mirror image). But most critically, what if the determinant is zero?
Let's start with a video that provides the core geometric intuition behind determinants and their connection to matrix inverses.
Inverse matrices, column space and null space | Chapter 7, Essence of linear algebra
The video 'Inverse matrices, column space and null space' by 3Blue1Brown offers a superb visual explanation of why the determinant is so important. As you watch, focus on the connection between a transformation 'squishing' space and its determinant being zero.
Watch the segment from 02:28 to 07:26. Pay close attention to: The idea that a non-zero determinant means you can reverse the transformation. The geometric meaning of a zero determinant: space is squished into a lower dimension (e.g., a plane becomes a line). Why you can't have an 'inverse' for a transformation with a zero determinant.
As the video explained, a determinant of zero means the transformation is irreversible—you can't "un-squish" a line back into a plane because information has been lost. This makes the determinant a powerful test for invertibility.
Computing the Determinant
Now that you have the intuition, let's look at the mechanics of calculating this value.
For a 2x2 Matrix
For a general 2x2 matrix , the determinant, denoted as or , is calculated with a simple formula:
For a 3x3 Matrix (and larger)
For matrices larger than 2x2, we use a method called cofactor expansion. This method breaks down the determinant of a large matrix into a weighted sum of determinants of smaller sub-matrices.
The key steps involve:
- Minors: For any element in the matrix, its minor is the determinant of the sub-matrix formed by deleting that element's row and column.
- Cofactors: A cofactor is just a minor with a specific sign (+ or -) depending on its position in the matrix.
- Expansion: You pick a row or column, and for each element, you multiply it by its cofactor. The sum of these products is the determinant.

The following video walks through the entire calculation for both 2x2 and 3x3 matrices with clear, step-by-step examples.
Determinant of 3x3 Matrices, 2x2 Matrix, Precalculus Video Tutorial
This tutorial from The Organic Chemistry Tutor provides a practical guide to calculating determinants.
Watch the video from the beginning to 09:27. First (00:00 - 01:32), see how the ad - bc formula is applied to 2x2 matrices. Then (01:32 - 09:27), follow the detailed example of cofactor expansion for a 3x3 matrix. Notice how the problem is reduced to calculating three 2x2 determinants.
2. The Inverse Matrix: Undoing a Transformation
As we saw in the 3Blue1Brown video, if a transformation is reversible (i.e., its determinant is not zero), there exists another transformation that takes you back to where you started. This "reverse" transformation is represented by the inverse matrix.
For a square matrix , its inverse is denoted as . The defining property of the inverse is that when you multiply a matrix by its inverse, you get the identity matrix .
Geometrically, this means applying a transformation () and then its inverse () is the same as doing nothing ().
Computing the Inverse
How do we find this inverse matrix? The method depends on the size of the matrix.
For a 2x2 Matrix
There is a convenient formula for the inverse of a 2x2 matrix , which directly uses the determinant:
Notice that if the determinant is zero, this formula involves division by zero, which is undefined. This is the algebraic reason why a matrix with a zero determinant is not invertible.

For a General n x n Matrix: Gauss-Jordan Elimination
For larger matrices, we use a robust algorithm called Gauss-Jordan elimination. The procedure is as follows:
- Create an augmented matrix by placing your matrix on the left and the identity matrix of the same size on the right: .
- Perform a series of elementary row operations on the entire augmented matrix. Your goal is to transform the left side () into the identity matrix .
- The same operations you apply to turn into will simultaneously transform the right side () into the inverse, .
- When you are done, your augmented matrix will look like this: .
This method is essentially solving multiple systems of equations at once. For a deeper, more formal look at both the theory and the calculation, the following document is an excellent resource.
Inverse Matrices - MIT Mathematics
The document 'Inverse Matrices' from MIT Mathematics provides a comprehensive and rigorous treatment of this topic, which aligns with your theory-first preference. It formalizes the concepts and provides detailed examples.
Please read the following sections from this PDF: Section Introduction and Notes 1-6 (Pages 83-84): Read from the beginning of the section '2.5 Inverse Matrices' to the end of Note 6. This will give you the formal definition, properties, and the 2x2 inverse formula (Note 5). 'Calculating A⁻¹ by Gauss-Jordan Elimination' (Pages 86-87): Read this subsection carefully. It contains a fully worked-out example of finding the inverse of a 3x3 matrix K. Follow the row operations step by step to understand the process of transforming [K | I] into [I | K⁻¹].
Practice: A Quick Check
Let's put this together. Consider the matrix .
- Is it invertible? Calculate its determinant.
. Since the determinant is not zero, the matrix is invertible. - What is its inverse? Use the 2x2 formula.
- Verify the inverse. Check if .
It works! The result is the identity matrix.
Conclusion
In this lesson, you've learned to compute two of the most important properties of a square matrix: its determinant and its inverse.
Key Takeaways:
- The determinant is a scalar value that represents the scaling factor of a linear transformation on area or volume.
- A matrix is invertible if and only if its determinant is not zero. A zero determinant means the transformation collapses space into a lower dimension and is irreversible.
- The inverse matrix, , represents the transformation that reverses the action of , such that .
- For 2x2 matrices, there are simple formulas for both the determinant () and the inverse.
- For larger matrices, the determinant is found using cofactor expansion, and the inverse is calculated using Gauss-Jordan elimination.
Preview of the Next Lesson:
Now that we have the concept of an inverse matrix, we have the primary tool needed to solve systems of linear equations. In the next lesson, we will see how the equation can be elegantly solved for by using the inverse: . This is a cornerstone of computational mathematics and has direct applications in machine learning.