┌ ┐ │ 5 0 1 4 │ │ -2 0 -3 2 │ A = │ 2 0 0 2 │ │ -2 -1 -1 2 │ └ ┘
The determinant can be computed by multiplying the entries in any row (or column) by their cofactors and adding the resulting products, where the cofactor of the entry located on i-th row and j-th column, is defined to be the determinant of the submatrix that remains after the i-th row and j-th column are deleted from the matrix, changing the sign if i+j is odd. From the previous definition it could be seen that cofactors involve determinants of lower order. Using this technique recursively together with the formulas for determinants of order 2 and 3, we have a method for calculating the determinant. In practice when expanding cofactors along a row or column to calculate the determinant, use the row or column with the greatest amount of zeros, because it is not needed to compute the associated cofactors. When a matrix is triangular, its determinant is the product of the entries on the main diagonal of the matrix.
│ 5 0 1 4 │ │ -2 0 -3 2 │ │ 5 1 4 │ │ 2 0 0 2 │ = - 1•│ -2 -3 2 │ │ -2 -1 -1 2 │ │ 2 0 2 │ │ 5 1 4 │ │ -2 -3 2 │ = 5•(-3)•2 + 1•2•2 + (-2)•0•4 - 4•(-3)•2 - 1•(-2)•2 - 2•0•5 = 2 │ 2 0 2 │ │ 5 0 1 4 │ │ -2 0 -3 2 │ │ 2 0 0 2 │ = - 1•2 = -2 │ -2 -1 -1 2 │
|A| = -2