WordGPT
โ† Math: from algebra to machine learning

Linear algebra ยท Part 3 of 5

Determinants and inverses

Learn what a determinant measures, how to compute it for 2x2 and 3x3 matrices, and how to invert a matrix when the determinant is nonzero.

Linear algebra9 min read

Some square matrices can be 'undone': if a matrix transforms vectors, another matrix can transform them back. That undo-matrix is the inverse, and whether it exists is decided by a single number attached to the matrix, called the determinant. If the determinant is zero, the matrix squashes space in a way that loses information, and no inverse can recover it.

In this lesson you will learn to compute determinants of small matrices, use them to decide invertibility, and find inverses by a formula for matrices and by row reduction for larger ones.

The determinant of a 2x2 matrix

For a matrix

the determinant is the number

Geometrically, is the area of the parallelogram spanned by the columns of . A negative determinant means the transformation also flips the plane over, like a mirror, although areas are still scaled by . If the determinant is , the columns lie on one line: the matrix collapses the plane, and the transformation is not reversible.

A quick example: for , we get . Since , is invertible.

Interactive 2x2 matrix transformation with four sliders a, b, c, d. The unit square is mapped to a parallelogram whose area is the absolute value of ad โˆ’ bc; for the default matrix [[3,1],[4,2]] the area is 2.det = 2
Drag the matrix entries and watch the unit square shear into a parallelogram. Its area equals |det| = |ad โˆ’ bc|; when the determinant hits 0 the square collapses onto a line and the matrix is singular.

Example 1. Computing a 2x2 determinant Find .

Multiply the main diagonal, then subtract the product of the other diagonal.

The determinant is , nonzero, so this matrix is invertible.

The inverse of a 2x2 matrix

If has , its inverse is

Two things happen: the diagonal entries swap, the off-diagonal entries change sign, and everything is divided by the determinant. You can always verify an inverse by checking , the identity matrix.

If , the formula divides by zero and no inverse exists; such a matrix is called singular.

Parallelogram spanned by the column vectors (3,4) and (1,2) of the matrix A, with the third vertex at (4,6). Its area is 2, equal to the absolute determinant of A.52.2452.2452.24Ouvu+v
The columns of A = [[3,1],[4,2]] are the vectors (3,4) and (1,2). The parallelogram they span has area |3ยท2 โˆ’ 1ยท4| = 2, and since it is not squashed flat, the inverse exists.

Example 2. Inverting a 2x2 matrix Find the inverse of and verify it.

First compute the determinant.

Swap the diagonal, negate the off-diagonal, divide by .

Check by multiplying.

The product is the identity, so the inverse is correct.

Determinants of 3x3 matrices by cofactor expansion

For a matrix, expand along a row or column. Expanding along the first row of

gives

where is the matrix left when you delete row and column . The signs alternate as you move along the row: the entry in position gets the sign .

Tip: expand along a row or column containing zeros โ€” each zero kills a term and saves work.

Example 3. A 3x3 determinant with a zero entry Compute .

Expand along the first row, which contains a zero.

Evaluate each determinant.

Combine.

The determinant is .

Inverses of larger matrices by row reduction

The cofactor formula for inverses exists for matrices but gets messy. The standard method is row reduction: form the augmented matrix and apply row operations until the left block becomes the identity. The right block is then .

The row operations are the same ones used for solving systems: swap two rows, multiply a row by a nonzero constant, add a multiple of one row to another. If at any point the left side cannot become the identity (a row of zeros appears), then and has no inverse.

Example 4. Inverting a 3x3 matrix Find the inverse of .

First note the determinant is (expand along the first row: ), so an inverse exists. Row-reduce with row operations; the final augmented matrix is

So

Check by multiplying .

The product is the identity, so the inverse is correct.

Using inverses to solve systems

A linear system with square, invertible has the solution

This is why inverses matter: they turn 'solve the system' into one matrix multiplication. It is also why singular matrices are trouble โ€” for them, the system either has no solution or infinitely many, never exactly one.

Example 5. Solving a system with an inverse Solve using an inverse matrix.

Write the system as with , .

Compute the determinant.

So

Multiply.

Check by substituting back: and . Both hold, so , .

Key properties of determinants

Three facts you will use constantly:

  • for square matrices of the same size. A product is singular exactly when at least one factor is singular.
  • when is invertible.
  • : transposing does not change the determinant.

These follow from the geometric picture: determinants measure how a matrix scales area (or volume), and applying two transformations in a row scales area by the product of the two scaling factors.

Example 6. A determinant property in action If and , find and .

Use the product rule.

Use the inverse rule.

Note , so the product is invertible even though is negative.

Common mistakes

  • Computing instead of for a 2x2 determinant; the correct formula subtracts the second diagonal product.
  • Forgetting the alternating signs when expanding a 3x3 determinant along a row; position carries the sign .
  • Trying to invert a matrix whose determinant is zero; such a matrix is singular and has no inverse.
  • Swapping the wrong entries in the 2x2 inverse formula; the diagonal entries swap and only the off-diagonal entries change sign.
  • Assuming ; determinants multiply over products, not sums.

Practice

  1. Compute the determinant of .
  2. Find the inverse of the matrix , i.e. the matrix with . Write your answer as a 2x2 matrix of fractions.
  3. Compute the determinant of .
  4. Find all real values of for which the matrix has no inverse.
  5. Solve the system using an inverse matrix: . Verify your answer by substituting back.
Answers
  1. , since .
  2. , since and the formula swaps the diagonal and negates the off-diagonal.
  3. , obtained by expanding along the first row: .
  4. : the determinant is , which must equal zero for the matrix to be singular, so .
  5. , : the coefficient matrix has determinant , its inverse is , and multiplying by gives ; check: and .

Next, in Eigenvalues and eigenvectors, you will see that the determinant also controls which special vectors a matrix only stretches โ€” the eigenvectors.

Part of the free WordGPT Learn section. WordGPT is an AI writing workspace for documents, resumes, websites and study.

    Determinants and inverses โ€” Math: from algebra to machine learning | WordGPT