In this explainer, we will learn how to evaluate determinants using the cofactor expansion (the Laplace expansion) or the rule of Sarrus.
When working with a square matrix, we will often be interested in calculating the determinant in order to gain potentially useful information about the matrix. As well as being able to tell whether or not the matrix is invertible, the determinant provides information about the physical transformation of space that is encoded by the matrix in question. There are many other reasons that could justify calculating the determinant of a matrix but part of the appeal is the wide range of mathematical properties that are satisfied by the determinant and the variety of ways in which this quantity can be calculated.
This explainer will be split into two parts, with the first section providing a quick reminder of how to calculate the determinant of a matrix. Then, in the second part, we will explain how to calculate the determinant of a square matrix which has an order of , by incorporating the method known for matrices. The process that we will show is a generalization of Sarrus’ rule for the determinant of matrices and is extendable to any square matrix.
Definition: Determinant of a 2 × 2 Matrix
For a matrix the “determinant” of is denoted and is given by the formula
When calculating the determinant of a matrix, the most common errors typically occur if one of the entries is negative. In particular, if either or is negative, then the formula introduces a risk of a sign error in the rightmost term. In the following examples, we will show how the determinant is calculated for 3 different matrices, with the final example involving a matrix that has entries which are trigonometric functions, instead of numbers.
Example 1: Determinant of a 2 × 2 Matrix
Find the determinant of the following matrix:
We label the matrix as
Then, the determinant is calculated as
We have therefore found that .
Example 2: Determinant of a 2 × 2 Matrix
Find the determinant of the following matrix:
Then, we calculate
The answer is then .
Example 3: 2 × 2 Determinants with Trigonometric Functions
Find the value of
We define the matrix
We calculate the determinant as normal:
Although this is technically a correct form for , it is likely that an equivalent expression exists which has a simpler form. Because of this, we will attempt to simplify the expression above. By recalling that we can write that
To achieve a common denominator across all terms, we can also write to find
Finally, we know that , which gives which means that . This expression is equivalent to the form of the determinant that we originally calculated but is much more concise. The determinant being equal to zero in particular means that the original matrix is not invertible, irrespective of the value of .
With the determinant of matrices being well understood, it is now possible to calculate the determinant for larger square matrices. Although specific rules do exist for the determinants of and matrices, it is better to develop a more general approach, so that this can be applied in a way which minimizes the number of calculations that we have to complete.
Definition: Matrix Minors
Consider a matrix with order . Then, the matrix “minor” is the initial matrix after having removed the row and the column. This means that is a matrix with order .
It is easiest to illustrate this concept by example. Suppose that we have a matrix
We will begin by calculating the matrix minor , which will mean removing the second row and the third column from , as highlighted:
Then, all uncolored entries remain in the matrix minor:
If we wish to calculate the matrix minor , then we would be removing the third row of as well as the first column. The highlighted entries in will need to be removed. The resulting matrix minor is
This definition can equally be applied to matrices or any square matrix of a higher dimension, as we will demonstrate later in this explainer.
Definition: General Formula for the Determinant
Consider a square matrix with order . Then, the determinant of is calculated in one of two ways, both of which involve the determinant of particular matrix minors of . We can choose to calculate the determinant by using a particular row and matrix minors as follows:
Alternatively, we can choose one particular column :
This definition seems a little daunting at first, although it is much easier to apply than might initially seem apparent. Much of the confusion can be eradicated by approaching the calculations in a consistent and clear manner, highlighting the relevant entries and results as an inherent part of the method.
Example 4: 3 × 3 Determinants
Find the determinant of the matrix
We have a matrix that we will label as
We can choose to calculate by first selecting either one row or one column. For reasons that will be explained shortly, a good strategy is normally to find the row or column which contains the most number of zeros. For our matrix , this would be either the third row or the first column, which both contain one zero entry in the position . We choose the first column, as highlighted:
These entries are , , and . Now we calculate the corresponding matrix minors:
Using the method for calculating the determinant of a matrix that we used earlier in this explainer, we find that
The final preparation step is to calculate the values
We know that we can expand along column using the formula
It is now clear that we did not need to calculate because this value will be multiplied by . Writing out the calculation in full gives
This gives the final result .
We will complete another example for a matrix, although this time with an advantage being gained by expanding along a row, rather than a column as in the previous example. The technique is very similar to that used above and, using the same formatting of our working, there is little difference between this example and the previous one in terms of layout and the calculations involved.
Example 5: 3 × 3 Determinants
In order to simplify the subsequent calculations, we identify the row or column that contains the most number of entries which are zero. In this case, this is the second row of , as we have highlighted:
The relevant entries are , , and . Two of these entries are zero, which means that we will not need to calculate two matrix minors, as their determinants will eventually be multiplied by zero. For completeness, we give all relevant matrix minors:
The determinants of these matrix minors are
The final ingredient is to calculate the values
We can calculate the determinant of by expanding along row using the formula
We see that there are two matrix minors that we did not need to consider, since their determinants are being multiplied by a zero term. Nonetheless, we calculate
This gives the answer .
The techniques that we used in the question above are easy to extend to matrices of a higher order. For a matrix with order , the matrix minor will have order . For example, by repeating the steps from above, the determinant of a matrix can be expressed in terms of particular matrix minors that are all of order .
Example 6: Determinant of 4 × 4 Matrix
Find the determinant of the matrix
We set the above matrix equal to . Then, either the third row or the fourth column of would be good choices to expand along, since they both contain one entry which has a value of zero. With no reason to discriminate between these two choices, we arbitrarily select the third row:
The highlighted entries are , , , and . The matrix minors corresponding to these entries are
We are now in a position to calculate the determinants of these matrix minors. Given that , in reality there is no need to calculate , although we will do so regardless for the sake of completion. The results are
It is fortunate that two of the matrix minors have determinants which are zero, as this will simplify the resultant calculation for . The final preparation step provides the values
We will calculate by expanding along row :
Using all of the highlighted values above, we have
The presence of so many zeros means that we can quickly deduce that .
We will provide one more example of a matrix, for the sake of demonstrating the technique. At this stage, it might seem as though the technique is still a little mysterious, which is common to many concepts in linear algebra when they are initially studied. However, with practice the technique becomes fairly simple to apply. Furthermore, once a mathematician is familiar with all of the tricks for calculating determinants, there are normally shortcuts that can be taken to get to the answer. The following example provides another demonstration as to how the calculation can be streamlined by a correct choice of row or column.
Example 7: 4 × 4 Determinants
The fourth column contains the most number of zeros from any row or column, so we will expand along this column by first highlighting the relevant entries:
The highlighted entries are , , , and . Since , there is no need to calculate the matrix minors or , nor their determinants. The appropriate matrix minors are
From this, we use the techniques for calculating the determinant of a matrix to find
All that remains is to calculate
We can now derive the determinant of by expanding along column . The definition of the determinant gives the formula
Then, the determinant is
As we knew, the terms and are multiplied by zero, so there was certainly a need to calculate these quantities in this particular example. Simplifying the working above, the answer is .
In this explainer, we have given only one tool for calculating the determinant of a square matrix, albeit a very powerful tool. One interesting theme emerges when studying the determinant, namely, that we have many choice as to how we calculate it. For the examples of and matrices that we have given, we had the option to expand along a particular row or column of our choosing. To make the calculations as concise as possible, we looked for the row or column which contained the most number of zeros.
There are many other methods for calculating the determinant of a square matrix, most of which share the common aim of looking for ways to maximize the number of instances of zero that appear in the calculation. One such method uses row operations to reduce a square matrix to an upper-triangular matrix, which has zeroes in every entry under the diagonal entries. In the definition and examples above, we chose to prioritize rows and columns which contained as many zeros as possible, which is evidently a pragmatic approach. This rule of thumb is a key guideline when calculating the determinant of a square matrix, which would be most unwise to ignore!
- The determinant of a matrix is given by the formula .
- If the matrix has order , then the matrix minor is a matrix of order that is identical to after removing the row and column.
- The determinant of an matrix can be calculated either by expanding along row , or by expanding along column ,
- When expanding along a particular row or column, it is wisest to select the row which contains the most number of zeros.