Determinant#

The determinant is a scalar quantity associated with any square matrix ARn×n. It encodes important geometric and algebraic information about the transformation represented by A.

Geometrically, the determinant tells us:

  • How the matrix A scales volume: The absolute value |det(A)| is the volume-scaling factor for the linear transformation xAx.

  • Whether the transformation preserves or flips orientation: If det(A)>0, the transformation preserves orientation; if det(A)<0, it reverses it (like a reflection).

Algebraically, the determinant can be defined as:

det(A)=σSnsgn(σ)a1σ(1)a2σ(2)anσ(n)

where:

  • The sum is over all permutations σ of {1,2,,n},

  • sgn(σ) is +1 or 1 depending on the parity of the permutation.

This formula is computationally expensive and confusing, but conceptually important: it captures how the determinant depends on all possible signed products of entries, each taken once from a distinct row and column.

Let’s illustrate the determinant geometrically.

Hide code cell source
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon

# Define matrices to show area effects
matrices = {
    "Area = 1 (Identity)": np.array([[1, 0], [0, 1]]),
    "Area > 1": np.array([[2, 0.5], [0.5, 1.5]]),
    "Area < 0 (Flip)": np.array([[0, 1], [1, 0]]),
    "Rotation (Area = 1)": np.array([[np.cos(np.pi/4), -np.sin(np.pi/4)],
                                     [np.sin(np.pi/4),  np.cos(np.pi/4)]])
}

# Unit square
square = np.array([[0, 0],
                   [1, 0],
                   [1, 1],
                   [0, 1],
                   [0, 0]]).T

fig, axes = plt.subplots(1, 4, figsize=(20, 5))

for ax, (title, M) in zip(axes, matrices.items()):
    transformed_square = M @ square
    area = np.abs(np.linalg.det(M))
    det = np.linalg.det(M)

    # Plot original unit square
    ax.plot(square[0], square[1], 'k--', label='Unit square')
    ax.fill(square[0], square[1], facecolor='lightgray', alpha=0.4)

    # Plot transformed shape
    ax.plot(transformed_square[0], transformed_square[1], 'b-', label='Transformed')
    ax.fill(transformed_square[0], transformed_square[1], facecolor='skyblue', alpha=0.6)

    # Add vector arrows for columns of M
    origin = np.array([[0, 0]]).T
    for i in range(2):
        vec = M[:, i]
        ax.quiver(*origin, vec[0], vec[1], angles='xy', scale_units='xy', scale=1, color='red')

    ax.set_title(f"{title}\nDet = {det:.2f}, Area = {area:.2f}")
    ax.set_xlim(-2, 3)
    ax.set_ylim(-2, 3)
    ax.set_aspect('equal')
    ax.grid(True)
    ax.legend()

plt.suptitle("Geometric Interpretation of the Determinant (Area Scaling and Orientation)", fontsize=16)
plt.tight_layout(rect=[0, 0, 1, 0.93])
plt.show()
../_images/ee97e66adb3b31b886ee6c5d93bddacaf3acd491650ebc58f47abb5acfa69ec0.png
  1. Identity: No change — area = 1.

  2. Stretch: Expands area — determinant > 1.

  3. Flip: Reflects across the diagonal — determinant < 0.

  4. Rotation: Rotates without distortion — determinant = 1.

What is the Determinant?#

The determinant of a matrix ARn×n is a scalar that describes how A scales space. Algebraically, it is defined by a signed sum over all permutations of the matrix’s entries. Geometrically, it quantifies the change in signed volume of a unit shape under transformation by A. If the determinant is zero, the transformation collapses the volume entirely, and A is singular (non-invertible).


The determinant has several important properties:

(i) det(I)=1

(ii) det(A)=det(A)

(iii) det(AB)=det(A)det(B)

(iv) det(A1)=det(A)1

(v) det(αA)=αndet(A)


Practical Computation of the Determinant#

The algebraic definition of the determinant is computationally expensive. In practice, we compute the determinant using property (iii) and a matrix factorization such as the PLU decomposition:

A=PLU

where P is a permutation matrix, L is a unit lower triangular matrix, and U is an upper triangular matrix.

Theorem (Triangular Matrix Determinant)

Let TRn×n be a triangular matrix, either upper or lower triangular.

Then:

det(T)=i=1nTii

Then,

det(A)=det(P)det(L)det(U)

Since:

  • det(L)=1 (if unit lower triangular),

  • det(U)=i=1nuii,

  • det(P)=(1)s, where s is the number of row swaps,

this method reduces determinant computation to O(n) operations after LU decomposition. As the cost for the LU decomposition is O(n3), the total cost of computing the determinant is O(n3).

Cofactor Expansion: Definition#

Cofactor expansion (also called Laplace expansion) gives a recursive definition of the determinant.

Let ARn×n be a square matrix.

Then the determinant of A can be computed by expanding along any row or column.

For simplicity, we’ll define it for the first column.

det(A)=i=1n(1)i+1Ai1det(A(i,1))

Where:

  • Ai1 is the entry in row i, column 1

  • A(i,1) is the minor matrix obtained by deleting row i and column 1 from A

  • (1)i+1 is the sign factor for alternating signs (from the checkerboard sign pattern)

  • (1)i+jdet(A(i,j)) is called the cofactor of Aij

This formula recursively reduces the computation of a determinant to smaller and smaller submatrices.


Cofactor Expantion Example (3×3 Matrix)#

Let:

A=[123456789]

Expand along the first column:

det(A)=(+1)1|5689|4|2389|+7|2356|

Now compute the 2×2 determinants:

det(A)=1(5968)4(2938)+7(2635)
=1(3)4(6)+7(3)=3+2421=0

So:

det(A)=0

Proof. via Laplace Expansion / Cofactor Expansion

We’ll prove this for upper triangular matrices by induction on the matrix size n. The same argument applies symmetrically for lower triangular matrices.


Base Case: n=1

Let T=[t11]. Then clearly:

det(T)=t11=i=11Tii

The base case holds.


Inductive Step

Assume the result holds for (n1)×(n1) upper triangular matrices.

Now let TRn×n be upper triangular. That means all entries below the diagonal are zero:

T=[t11t12t1n0t22t2n00tnn]

Use cofactor expansion along the first column. Since the only nonzero entry in the first column is t11, we have:

det(T)=t11det(T(1,1))

Where T(1,1) is the (n1)×(n1) matrix obtained by deleting row 1 and column 1. But:

  • T(1,1) is still upper triangular.

  • By the inductive hypothesis:

    det(T(1,1))=i=2nTii

So:

det(T)=t11i=2nTii=i=1nTii

The inductive step holds.


Conclusion

By induction, for any upper (or lower) triangular matrix TRn×n,

det(T)=i=1nTii
  • The determinant accumulates only the diagonal entries because each pivot is isolated, and all other paths in the expansion have zero entries.

  • This result is frequently used in:

    • Computing determinants from LU decomposition

    • Checking invertibility efficiently

    • Proving properties of eigenvalues and characteristic polynomials