Skip to content

Matrix Inverses and Determinants

The inverse lets you “undo” a matrix transformation, and the determinant tells you whether that’s even possible. In this lesson you’ll learn how to compute both for 2×22 \times 2 matrices and understand what they mean geometrically.

The inverse of a matrix AA (written A1A^{-1}) satisfies:

AA1=A1A=IA \cdot A^{-1} = A^{-1} \cdot A = I

where II is the identity matrix (1s on the diagonal, 0s elsewhere). Only square matrices can have inverses, and not all of them do.

The determinant of a 2×22 \times 2 matrix [abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix} is:

det(A)=adbc\det(A) = ad - bc

What it tells you:

  • det(A)0\det(A) \neq 0: AA is invertible
  • det(A)=0\det(A) = 0: AA is singular (no inverse exists)
  • The absolute value det(A)\lvert \det(A) \rvert is the area scaling factor of the transformation
  • A negative determinant means the transformation flips orientation

If det(A)0\det(A) \neq 0:

A1=1adbc[dbca]A^{-1} = \frac{1}{ad - bc} \begin{bmatrix} d & -b \\ -c & a \end{bmatrix}

Swap aa and dd, negate bb and cc, divide by the determinant.

Applying matrix A area = 1 A area = 3 |det(A)| = 3 Unit square (area 1) Transformed (area 3)

The matrix used in the diagram is:

A=[2101.5]A = \begin{bmatrix} 2 & 1 \\ 0 & 1.5 \end{bmatrix}

Its determinant: det(A)=(2)(1.5)(1)(0)=3\det(A) = (2)(1.5) - (1)(0) = 3

The blue unit square has area 1. After applying AA, the green parallelogram has area =det(A)=3= \lvert \det(A) \rvert = 3. The determinant is literally the area scaling factor of the transformation: whatever shape goes in, its area gets multiplied by det(A)\lvert \det(A) \rvert.

Applying A⁻¹ (undo) area = 3 A⁻¹ area = 1 back to original Transformed A⁻¹ (inverse) Restored

Here, A1A^{-1} maps the green parallelogram back to the original blue unit square. The inverse “undoes” the transformation completely.

Using the 2x2 inverse formula on A=[2101.5]A = \begin{bmatrix} 2 & 1 \\ 0 & 1.5 \end{bmatrix}:

A1=13[1.5102]=[0.513023]A^{-1} = \frac{1}{3} \begin{bmatrix} 1.5 & -1 \\ 0 & 2 \end{bmatrix} = \begin{bmatrix} 0.5 & -\frac{1}{3} \\ 0 & \frac{2}{3} \end{bmatrix}

Multiplying any point on the green parallelogram by A1A^{-1} sends it back to the corresponding point on the original unit square. That’s the power of the inverse: it reverses the transformation exactly.

Example 1: Computing the Inverse

A=[4321]A = \begin{bmatrix} 4 & 3 \\ 2 & 1 \end{bmatrix}

det(A)=(4)(1)(3)(2)=46=2\det(A) = (4)(1) - (3)(2) = 4 - 6 = -2

Since det(A)0\det(A) \neq 0, AA is invertible:

A1=12[1324]=[0.51.512]A^{-1} = \frac{1}{-2} \begin{bmatrix} 1 & -3 \\ -2 & 4 \end{bmatrix} = \begin{bmatrix} -0.5 & 1.5 \\ 1 & -2 \end{bmatrix}

Verify: AA1=[4(0.5)+3(1)4(1.5)+3(2)2(0.5)+1(1)2(1.5)+1(2)]=[1001]A \cdot A^{-1} = \begin{bmatrix} 4(-0.5)+3(1) & 4(1.5)+3(-2) \\ 2(-0.5)+1(1) & 2(1.5)+1(-2) \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}

Example 2: Determinant as Area Scaling

If det(A)=5\det(A) = 5, applying AA stretches areas by a factor of 5.

If det(A)=3\det(A) = -3, it stretches areas by 3 and flips orientation (mirrors the space).

Example 3: Singular Matrix

A=[2412]A = \begin{bmatrix} 2 & 4 \\ 1 & 2 \end{bmatrix}

det(A)=(2)(2)(4)(1)=0\det(A) = (2)(2) - (4)(1) = 0

No inverse exists. The rows are linearly dependent (row 1 = 2 ×\times row 2), so AA squashes 2D space down to a line.

  • Graphics and games: the inverse of a transformation matrix converts from world space back to object space (essential for collision detection and mouse picking)
  • Physics: inverses solve for unknown forces when working with mass matrices
  • Machine learning: least squares and normal equations rely on matrix inverses
  • Cryptography: some encryption schemes use matrix inverses over finite fields

Example: When you click on a 3D object in a game, the engine uses the inverse of the model-view-projection matrix to trace a ray from your mouse position back into the 3D scene and figure out which object you hit.

A matrix has an inverse only if its determinant is:
The inverse of matrix $A$ satisfies:
For $\begin{bmatrix} 3 & 1 \\ 2 & 4 \end{bmatrix}$, the determinant is:
If $\det(A) = 0$, the matrix is called:
In game development, the inverse of a transformation matrix is used for: