11.4: Determinants and Cramer's Rule for n x n Matrices
( \newcommand{\kernel}{\mathrm{null}\,}\)
n×n Determinants
The 2×2 determinant we looked at in Section 11.3 can be used to find the determinant of larger matrices. We will now explore how to find the determinant of a 3×3 matrix, using several tools, including the 2×2 determinant.
We begin with the following definition.
Let A be a 3×3 matrix. The ijth minor of A, denoted as minor(A)ij, is the determinant of the 2×2 matrix which results from deleting the ith row and the jth column of A.
In general, if A is an n×n matrix, then the ijth minor of A is the determinant of the n−1×n−1 matrix which results from deleting the ith row and the jth column of A.
Hence, there is a minor associated with each entry of A. Consider the following example which demonstrates this definition.
Let A=[123432321] Find minor(A)12 and minor(A)23.
Solution
First we will find minor(A)12. By Definition 11.4.1, this is the determinant of the 2×2 matrix which results when you delete the first row and the second column. This minor is given by minor(A)12=det[4231]=−2
Similarly, minor(A)23 is the determinant of the 2×2 matrix which results when you delete the second row and the third column. This minor is therefore minor(A)23=det[1232]=−4 Finding the other minors of A is left as an exercise.
The ijth minor of a matrix A is used in another important definition, given next.
Suppose A is an n×n matrix. The ijth cofactor, denoted by Cij is defined to be Cij=(−1)i+jminor(A)ij
It is also convenient to refer to the cofactor of an entry of a matrix as follows. If aij is the ijth entry of the matrix, then its cofactor is just Cij.
Consider the matrix A=[123432321].
Find C12 and C23.
Solution
We will use Definition 11.4.2 to compute these cofactors.
First, we will compute C12:
C12=(−1)1+2det[4231]=(−1)(−2)=2.
Similarly, we can find C23:
C23=(−1)2+3det[1232]=(−1)(−4)=4.
You may wish to find the remaining cofactors for the above matrix. Remember that there is a cofactor for every entry in the matrix.
We have now established the tools we need to find the determinant of a 3×3 matrix.
Let A be a 3×3 matrix. Then, det(A) is calculated by picking a row (or column) and taking the product of each entry in that row (column) with its cofactor and adding these products together.
This process when applied to the ith row (column) is known as expanding along the ith row (column) and is given by det(A)=ai1Ci1+ai2Ci2+ai3Ci3
When calculating the determinant, you can choose to expand any row or any column. Regardless of your choice, you will always get the same number which is the determinant of the matrix A. This method of evaluating a determinant by expanding along a row or a column is called Cofactor Expansion.
Consider the following example.
Let A=[123432321] Find det(A) using the method of Cofactor Expansion.
Solution
First, we will calculate det(A) by expanding along the first column. Using Definition 11.4.3, we take the 1 in the first column and multiply it by its cofactor, 1(−1)1+1|3221|=(1)(1)(−1)=−1 Similarly, we take the 4 in the first column and multiply it by its cofactor, as well as with the 3 in the first column. Finally, we add these numbers together, as given in the following equation. det(A)=1C11⏞(−1)1+1|3221|+4C21⏞(−1)2+1|2321|+3C31⏞(−1)3+1|2332| Calculating each of these, we obtain det(A)=1(1)(−1)+4(−1)(−4)+3(1)(−5)=−1+16+−15=0 Hence, det(A)=0.
As mentioned in Definition 11.4.3, we can choose to expand along any row or column. Let’s try now by expanding along the second row. Here, we take the 4 in the second row and multiply it to its cofactor, then add this to the 3 in the second row multiplied by its cofactor, and the 2 in the second row multiplied by its cofactor. The calculation is as follows. det(A)=4C21⏞(−1)2+1|2321|+3C22⏞(−1)2+2|1331|+2C23⏞(−1)2+3|1232|
Calculating each of these products, we obtain det(A)=4(−1)(−4)+3(1)(−8)+2(−1)(−4)=0
You can see that for both methods, we obtained det(A)=0.
As mentioned above, we will always come up with the same value for det(A) regardless of the row or column we choose to expand along. You should try to compute the above determinant by expanding along other rows and columns. This is a good way to check your work, because you should come up with the same number each time.
We present this idea formally in the following theorem, which we state without proof.
Expanding the n×n matrix along any row or column always gives the same answer, which is the determinant.
There will be times when we need to find the determinant of a matrix with function entries instead of constants; we give an example here.
Suppose A(t)=[et000costsint0−sintcost].
Find the determinant of A(t).
Solution
It is clear we should expand about the first row or column and either way we get:
det(A(t))=et(cos2t+sin2t)=et.
We have now looked at the determinant of 2×2 and 3×3 matrices. It turns out that the method used to calculate the determinant of a 3×3 matrix can be used to calculate the determinant of any sized matrix.
For example, the ijth minor of a 4×4 matrix is the determinant of the 3×3 matrix you obtain when you delete the ith row and the jth column. Just as with the 3×3 determinant, we can compute the determinant of a 4×4 matrix by Cofactor Expansion, along any row or column
Consider the following example.
Find det(A) where A=[1234542313453432]
Solution
As in the case of a 3×3 matrix, you can expand this along any row or column. Lets pick the third column. Then, using Cofactor Expansion, det(A)=3(−1)1+3|543135342|+2(−1)2+3|124135342|+ 4(−1)3+3|124543342|+3(−1)4+3|124543135|
Now, you can calculate each 3×3 determinant using Cofactor Expansion, as we did above. You should complete these as an exercise and verify that det(A)=−12.
The following provides a formal definition for the determinant of an n×n matrix. You may wish to take a moment and consider the above definitions for 2×2 and 3×3 determinants in context of this definition.
Let A be an n×n matrix where n≥2 and suppose the determinant of an (n−1)×(n−1) has been defined. Then det(A)=n∑j=1aijCij=n∑i=1aijCij The first formula consists of expanding the determinant along the ith row and the second expands the determinant along the jth column.
The Determinant of a Triangular Matrix
There is a certain type of matrix for which finding the determinant is a very simple procedure. Consider the following definition.
An n×n matrix A is upper triangular if aij=0 whenever i>j. Thus the entries of such a matrix below the main diagonal equal 0, as shown. Here, ∗ refers to any number. [∗∗⋯∗0∗⋯⋮⋮⋮⋱∗0⋯0∗] A lower triangular matrix is defined similarly as a matrix for which all entries above the main diagonal are equal to zero.
The following theorem provides a useful way to calculate the determinant of a triangular matrix.
Let A be an upper or lower triangular matrix. Then det(A) is obtained by taking the product of the entries on the main diagonal.
The verification of this Theorem can be done by computing the determinant using Cofactor Expansion along the first row or column.
Consider the following example.
Let A=[12377026700333.7000−1] Find det(A).
Solution
From Theorem 11.4.2, it suffices to take the product of the elements on the main diagonal. Thus det(A)=(1)(2)(3)(−1)=−6.
Without using Theorem 11.4.2, you could use Cofactor Expansion. We will expand along the first column. This gives det(A)=1(−1)1+1|2670333.700−1|+0(−1)2+1|23770333.700−1|+0(−1)3+1|237726700−1|+0(−1)4+1|23772670333.7|
=1(−1)1+1|2670333.700−1|
=|2670333.700−1|
Now find the determinant of this 3×3 matrix, by expanding along the first column to obtain
det(A)=2(−1)1+1|333.70−1|+0(−1)2+1|670−1|+0(−1)3+1|67333.7|
=(1)(2)|333.70−1| Next find the determinant of this 2×2 matrix, which is just (3)(−1). Putting all these steps together, we have det(A)=(1)(2)(3)(−1)=−6 which is just the product of the entries down the main diagonal of the original matrix.
You can see that while both methods result in the same answer, Theorem 11.4.2 provides a much quicker result.
Cramer’s Rule for an n×n Matrix
Cramer's Rule for n×n matrices is similar to what we did in Section 11.3 for 2×2 matrices; we state the generalized theorem here.
Consider the following system of equations:
a11x1+a12x2+⋯+a1nxn=b1⋮an1x1+an2x2+⋯+annxn=bn
Let A=[a11⋯a1n⋮an1⋯ann] and b=[b1⋮bn].
Let Ai be the matrix where the ith column of A has been replaced with b.
Then xi=det(Ai)det(A)
Use Cramer's Rule to solve:
x1+2x2+x3=13x1+2x2+x3=22x1−3x2+2x3=3
We have A=[1213212−32] and b=[123].
Solution
In order to find x1, we calculate x1=det(A1)det(A) where A1 is the matrix obtained from replacing the first column of A with b.
Hence, A1 is given by A1=[1212213−32]
Therefore, x1=det(A1)det(A)=|1212213−32||1213212−32|=12
Similarly, to find x2 we construct A2 by replacing the second column of A with b. Hence, A2 is given by A2=[111321232]
Therefore, x2=det(A2)det(A)=|111321232||1213212−32|=−17
Similarly, A3 is constructed by replacing the third column of A with b. Then, A3 is given by A3=[1213222−33]
Therefore, x3 is calculated as follows.
x3=det(A3)det(A)=|1213222−33||1213212−32|=1114
Again, there will be times when we need to solve systems with functions as coefficients instead of constants; we give an example here.
Use Cramer's Rule to solve for x3:
x1=1(etcost)x2+(etsint)x3=t(−etsint)x2+(etcost)x3=t2
We have A=[1000etcostetsint0−etsintetcost] and b=[1tt2].
Solution
We are asked to find the value of x3 in the solution. We will solve using Cramer’s rule. Thus
x3=|1010etcostt0−etsintt2||1000etcostetsint0−etsintetcost|=t2etcost+tetsinte2tcos2t+e2tsin2t=t2e−tcost+te−tsint