Determinant of a matrix
In linear algebra, the determinant of a square matrix is a scalar value that reveals key properties of the matrix. Denoted by det(A) or |A|, it encapsulates both the algebraic and geometric characteristics of the matrix.
Example
For a square matrix
$$ A= \begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix} $$
its determinant is denoted by det(A):
$$ det(A) = -2 $$
or alternatively, using two vertical bars:
$$ | A | = \begin{vmatrix} 1 & 2 \\ 3 & 4 \end{vmatrix} = -2 $$
Note. The determinant can only be computed for square matrices, i.e., matrices with an equal number of rows and columns (m=n).
Finding the Determinant of a Matrix
Square Matrices of Order 1
For a 1x1 matrix, which contains a single element, the determinant is simply the value of that element, a11.
Example. A matrix A of order 1 has one element, a11 = 5. Thus, det(A) = 5.
Square Matrices of Order 2
For a 2x2 matrix, the determinant is calculated by taking the product of the elements on the main diagonal (a11·a22) and subtracting the product of the elements on the secondary diagonal (a21·a12).
Example. For the following 2x2 matrix A, which has two rows and two columns, det(A) = -2.
Sarrus' Rule
Sarrus' rule applies to 3x3 matrices (m=n=3) to find their determinant.
Consider a 3x3 matrix:
Place the first two columns to the right:
Then, add the products of the diagonals from the top left to the bottom right:
Next, subtract the products of the diagonals from the bottom left to the top right.
The resulting algebraic sum of these products is the determinant of the matrix.
The Sarrus rule summarized
Laplace's Method
Laplace's method is one of the most widely used techniques for calculating determinants. It systematically reduces a determinant of order n to smaller determinants of order n-1.
Named after Pierre-Simon Laplace, this method is explained as follows:
How it works
Laplace’s method transforms the determinant calculation into smaller sub-determinants.
- Choose any column j of the matrix.
Which column is best to choose? Any column will work, but selecting one with more zeros often reduces the number of steps.
- Once column j is chosen, compute the determinants of the submatrices A(ij) by eliminating row i and column j from matrix A, using the following formula.
Example. To find the determinant of a 3x3 matrix A, I use the Laplace expansion along column j=1. Summing the submatrix determinants results in det(A) = 0.
Row Laplace Method
Alternatively, the Laplace method can also be applied by selecting a row instead of a column.
In this case, the formula varies slightly as columns j are cycled from 1 to n.
This produces the same result.
Example. Here, I select the first row: $$ \begin{vmatrix} 2 & 3 & 5 & 1 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 5 & 1 \\ 0 & 0 & 0 & 2 \end{vmatrix} = 2 \cdot \begin{vmatrix} 1 & 2 & 3 \\ 0 & 5 & 1 \\ 0 & 0 & 2 \end{vmatrix} - 3 \cdot \begin{vmatrix} 0 & 2 & 3 \\ 0 & 5 & 1 \\ 0 & 0 & 2 \end{vmatrix} + 5 \cdot \begin{vmatrix} 0 & 1 & 3 \\ 0 & 0 & 1 \\ 0 & 0 & 2 \end{vmatrix} - 1 \cdot \begin{vmatrix} 0 & 1 & 2 \\ 0 & 0 & 5 \\ 0 & 0 & 0 \end{vmatrix} $$ Calculating the four submatrix determinants: $$ \begin{vmatrix} 2 & 3 & 5 & 1 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 5 & 1 \\ 0 & 0 & 0 & 2 \end{vmatrix} = 2 \cdot 10 - 3 \cdot 0 + 5 \cdot 0 - 1 \cdot 0 $$ The determinants of the submatrices are then multiplied by their coefficients and summed. $$ \begin{vmatrix} 2 & 3 & 5 & 1 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 5 & 1 \\ 0 & 0 & 0 & 2 \end{vmatrix} = 20 $$ The matrix determinant is 20.
A Tip to Simplify Calculations. When using this method, choosing the row or column with the most zeros simplifies the calculation. In this case, I select the fourth row. $$ \begin{vmatrix} 2 & 3 & 5 & 1 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 5 & 1 \\ 0 & 0 & 0 & 2 \end{vmatrix} = - 0 \cdot A_{(4,1)} + 0 \cdot A_{(4,2)} - 0 \cdot A_{(4,3)} + 2 \cdot \begin{vmatrix} 2 & 3 & 5 \\ 0 & 1 & 2 \\ 0 & 0 & 5 \end{vmatrix} $$ Since many coefficients are zero, I avoid calculating three determinants. $$ \begin{vmatrix} 2 & 3 & 5 & 1 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 5 & 1 \\ 0 & 0 & 0 & 2 \end{vmatrix} = 2 \cdot \begin{vmatrix} 2 & 3 & 5 \\ 0 & 1 & 2 \\ 0 & 0 & 5 \end{vmatrix} $$ Then, I repeat the process for the third row of the submatrix. $$ \begin{vmatrix} 2 & 3 & 5 & 1 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 5 & 1 \\ 0 & 0 & 0 & 2 \end{vmatrix} = 2 \cdot 5 \cdot \begin{vmatrix} 2 & 3 \\ 0 & 1 \end{vmatrix} = 2 \cdot 5 \cdot (2 \cdot 1) = 20 $$ This reduces a 4x4 matrix determinant to a 2x2. However, as this matrix is triangular, we could also find the determinant by multiplying the main diagonal elements. $$ \begin{vmatrix} 2 & 3 & 5 & 1 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 5 & 1 \\ 0 & 0 & 0 & 2 \end{vmatrix} = 2 \cdot 1 \cdot 5 \cdot 2 = 20 $$
Limitations of Laplace's Method. Using Laplace’s method for large matrices is inefficient. For high-order square matrices, methods like Gaussian elimination are far more efficient.
Gaussian Elimination Method
The Gaussian elimination method can also be used to find a matrix’s determinant.
Using Gaussian transformations, I convert the matrix into an upper triangular form.
In triangular matrices, the determinant is simply the product of the main diagonal elements, making the calculation straightforward.
However, I must account for any sign changes.
Swapping two rows (Rx⇔Ry) reverses the determinant’s sign (-1·det).
Multiplying a row by a scalar (k Rx) scales the determinant by that factor (k det).
Adding a row to a multiple of another row (Rx+k·Ry) does not affect the determinant’s sign.
Example. In this exercise, I use Gaussian elimination to calculate the determinant of matrix A.
Advantages of the Gaussian Method
For large matrices, Gaussian elimination is much faster than Laplace expansion.
And so on