JOVANA
Library Glossary Getting Started Three Levels Fields How it works Mission
Join the mission
All guides

Determinants and the Inverse of a Matrix

Every square matrix carries a single number called its determinant. When that number is non-zero, the matrix can be inverted — undone by multiplication. Here we compute 2×2 and 3×3 determinants and build the 2×2 inverse.

The determinant of a square matrix

The determinant is a single number we extract from a square matrix, written det(A) or |A|. For a 2 × 2 matrix it is wonderfully simple: multiply the main diagonal, multiply the other diagonal, and subtract. That one number tells us whether the matrix can be inverted.

        [ a  b ]
  A  =  [ c  d ]      det(A) = a*d - b*c

Example:
        [ 4  3 ]
  A  =  [ 2  5 ]      det(A) = 4*5 - 3*2 = 20 - 6 = 14
The 2×2 determinant: (main diagonal) − (anti-diagonal).

For a 3 × 3 matrix we expand along the first row: each top entry is multiplied by the 2 × 2 determinant of what remains when you delete its row and column, and the signs alternate +, −, +.

        [ 1  2  3 ]
  A  =  [ 0  4  5 ]
        [ 1  0  6 ]

det = 1*det[4 5; 0 6] - 2*det[0 5; 1 6] + 3*det[0 4; 1 0]
    = 1*(4*6 - 5*0) - 2*(0*6 - 5*1) + 3*(0*0 - 4*1)
    = 1*(24) - 2*(-5) + 3*(-4)
    = 24 + 10 - 12
    = 22
Expanding a 3×3 determinant along the top row with alternating signs.

When the determinant is zero

If det(A) = 0, the matrix is called a singular matrix and it has no inverse — much like the number 0 has no reciprocal. A non-zero determinant means the matrix is invertible (also called non-singular). So the determinant is a one-number test: zero blocks the inverse, non-zero permits it.

Building the inverse

The inverse of A, written A^(-1), is the matrix that satisfies A · A^(-1) = A^(-1) · A = I, the identity. It is the matrix analogue of a reciprocal. For a 2 × 2 matrix there is a tidy formula: swap the diagonal entries, negate the off-diagonal entries, and divide everything by the determinant.

        [ a  b ]                    1     [  d  -b ]
  A  =  [ c  d ]      A^(-1) = --------- [ -c   a ]
                               (ad - bc)

Example: A = [ 4  3 ],  det = 14
             [ 2  5 ]
              1  [  5  -3 ]      [  5/14  -3/14 ]
  A^(-1) = ---- [ -2   4 ]  =   [ -2/14   4/14 ]
            14

Check: A * A^(-1) should give the 2x2 identity I.
The 2×2 inverse: swap the diagonal, negate the off-diagonal, divide by the determinant.