3.4: Applications of the Determinant
( \newcommand{\kernel}{\mathrm{null}\,}\)
- Use determinants to determine whether a matrix has an inverse, and evaluate the inverse using cofactors.
- Apply Cramer’s Rule to solve a 2×2 or a 3×3 linear system.
- Given data points, find an appropriate interpolating polynomial and use it to estimate points.
A Formula for the Inverse
The determinant of a matrix also provides a way to find the inverse of a matrix. Recall the definition of the inverse of a matrix in Definition 2.6.1. We say that A−1, an n×n matrix, is the inverse of A, also n×n, if AA−1=I and A−1A=I.
We now define a new matrix called the cofactor matrix of A. The cofactor matrix of A is the matrix whose ijth entry is the ijth cofactor of A. The formal definition is as follows.
Let A=[aij] be an n×n matrix. Then the cofactor matrix of A, denoted cof(A), is defined by cof(A)=[cof(A)ij] where cof(A)ij is the ijth cofactor of A.
Note that cof(A)ij denotes the ijth entry of the cofactor matrix.
We will use the cofactor matrix to create a formula for the inverse of A. First, we define the adjugate of A to be the transpose of the cofactor matrix. We can also call this matrix the classical adjoint of A, and we denote it by adj(A).
In the specific case where A is a 2×2 matrix given by A=[abcd] then adj(A) is given by adj(A)=[d−b−ca]
In general, adj(A) can always be found by taking the transpose of the cofactor matrix of A. The following theorem provides a formula for A−1 using the determinant and adjugate of A.
Let A be an n×n matrix. Then Aadj(A)=adj(A)A=det(A)I
Moreover A is invertible if and only if det(A)≠0. In this case we have: A−1=1det(A)adj(A)
Notice that the first formula holds for any n×n matrix A, and in the case A is invertible we actually have a formula for A−1.
Consider the following example.
Find the inverse of the matrix A=[123301121] using the formula in Theorem 3.4.1.
Solution
According to Theorem 3.4.1, A−1=1det(A)adj(A)
First we will find the determinant of this matrix. Using Theorems 3.2.1, 3.2.2, and 3.2.4, we can first simplify the matrix through row operations. First, add −3 times the first row to the second row. Then add −1 times the first row to the third row to obtain B=[1230−6−800−2] By Theorem 3.2.4, det(A)=det(B). By Theorem 3.1.2, det(B)=1×−6×−2=12. Hence, det(A)=12.
Now, we need to find adj(A). To do so, first we will find the cofactor matrix of A. This is given by cof(A)=[−2−264−2028−6] Here, the ijth entry is the ijth cofactor of the original matrix A which you can verify. Therefore, from Theorem 3.4.1, the inverse of A is given by A−1=112[−2−264−2028−6]T=[−161316−16−1623120−12]
Remember that we can always verify our answer for A−1. Compute the product AA−1 and A−1A and make sure each product is equal to I.
Compute A−1A as follows A−1A=[−161316−16−1623120−12][123301121]=[100010001]=I You can verify that AA−1=I and hence our answer is correct.
We will look at another example of how to use this formula to find A−1.
Find the inverse of the matrix A=[12012−1613−12−5623−12] using the formula given in Theorem 3.4.1.
Solution
First we need to find det(A). This step is left as an exercise and you should verify that det(A)=16. The inverse is therefore equal to A−1=1(1/6)adj(A)=6adj(A)
We continue to calculate as follows. Here we show the 2×2 determinants needed to find the cofactors. A−1=6[|13−1223−12|−|−16−12−56−12||−1613−5623|−|01223−12||1212−56−12|−|120−5623||01213−12|−|1212−16−12||120−1613|]T
Expanding all the 2×2 determinants, this yields A−1=6[1613161316−13−161616]T=[12−12111−21]
Again, you can always check your work by multiplying A−1A and AA−1 and ensuring these products equal I. A−1A=[12−12111−21][12012−1613−12−5623−12]=[100010001] This tells us that our calculation for A−1 is correct. It is left to the reader to verify that AA−1=I.
The verification step is very important, as it is a simple way to check your work! If you multiply A−1A and AA−1 and these products are not both equal to I, be sure to go back and double check each step. One common error is to forget to take the transpose of the cofactor matrix, so be sure to complete this step.
We will now prove Theorem 3.4.1.
- Proof
-
(of Theorem 3.4.1) Recall that the (i,j)-entry of adj(A) is equal to cof(A)ji. Thus the (i,j)-entry of B=A⋅adj(A) is : Bij=n∑k=1aikadj(A)kj=n∑k=1aikcof(A)jk By the cofactor expansion theorem, we see that this expression for Bij is equal to the determinant of the matrix obtained from A by replacing its jth row by ai1,ai2,…ain — i.e., its ith row.
If i=j then this matrix is A itself and therefore Bii=detA. If on the other hand i≠j, then this matrix has its ith row equal to its jth row, and therefore Bij=0 in his case. Thus we obtain: Aadj(A)=det(A)I Similarly we can verify that: adj(A)A=det(A)I And this proves the first part of the theorem.
Further if A is invertible, then by Theorem 3.2.5 we have: 1=det(I)=det(AA−1)=det(A)det(A−1) and thus det(A)≠0. Equivalently, if det(A)=0, then A is not invertible.
Finally if det(A)≠0, then the above formula shows that A is invertible and that: A−1=1det(A)adj(A)
This completes the proof.
This method for finding the inverse of A is useful in many contexts. In particular, it is useful with complicated matrices where the entries are functions, rather than numbers.
Consider the following example.
Suppose A(t)=[et000costsint0−sintcost] Show that A(t)−1 exists and then find it.
Solution
First note det(A(t))=et(cos2t+sin2t)=et≠0 so A(t)−1 exists.
The cofactor matrix is C(t)=[1000etcostetsint0−etsintetcost] and so the inverse is 1et[1000etcostetsint0−etsintetcost]T=[e−t000cost−sint0sintcost]
Cramer’s Rule
Another context in which the formula given in Theorem 3.4.1 is important is Cramer’s Rule. Recall that we can represent a system of linear equations in the form AX=B, where the solutions to this system are given by X. Cramer’s Rule gives a formula for the solutions X in the special case that A is a square invertible matrix. Note this rule does not apply if you have a system of equations in which there is a different number of equations than variables (in other words, when A is not square), or when A is not invertible.
Suppose we have a system of equations given by AX=B, and we want to find solutions X which satisfy this system. Then recall that if A−1 exists, AX=BA−1(AX)=A−1B(A−1A)X=A−1BIX=A−1BX=A−1B Hence, the solutions X to the system are given by X=A−1B. Since we assume that A−1 exists, we can use the formula for A−1 given above. Substituting this formula into the equation for X, we have X=A−1B=1det(A)adj(A)B Let xi be the ith entry of X and bj be the jth entry of B. Then this equation becomes xi=n∑j=1[aij]−1bj=n∑j=11det(A)adj(A)ijbj where adj(A)ij is the ijth entry of adj(A).
By the formula for the expansion of a determinant along a column, xi=1det(A)det[∗⋯b1⋯∗⋮⋮⋮∗⋯bn⋯∗] where here the ith column of A is replaced with the column vector [b1⋯⋅,bn]T. The determinant of this modified matrix is taken and divided by det(A). This formula is known as Cramer’s rule.
We formally define this method now.
Suppose A is an n×n invertible matrix and we wish to solve the system AX=B for X=[x1,⋯,xn]T. Then Cramer’s rule says xi=det(Ai)det(A) where Ai is the matrix obtained by replacing the ith column of A with the column matrix B=[b1⋮bn]
We illustrate this procedure in the following example.
Find x,y,z if [1213212−32][xyz]=[123]
Solution
We will use method outlined in Procedure 3.4.1 to find the values for x,y,z which give the solution to this system. Let B=[123]
In order to find x, we calculate x=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, x=det(A1)det(A)=|1212213−32||1213212−32|=12
Similarly, to find y we construct A2 by replacing the second column of A with B. Hence, A2 is given by A2=[111321232]
Therefore, y=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, z is calculated as follows.
z=det(A3)det(A)=|1213222−33||1213212−32|=1114
Cramer’s Rule gives you another tool to consider when solving a system of linear equations.
We can also use Cramer’s Rule for systems of non linear equations. Consider the following system where the matrix A has functions rather than numbers for entries.
Using Cramer’s Rule
Solve for z if [1000etcostetsint0−etsintetcost][xyz]=[1t0.05int2]
Solution
We are asked to find the value of z in the solution. We will solve using Cramer’s rule. Thus z=.05in|1010etcostt0−etsintt2||1000etcostetsint0−etsintetcost|=t((cost)t+sint)e−t
Polynomial Interpolation
In studying a set of data that relates variables x and y, it may be the case that we can use a polynomial to “fit” to the data. If such a polynomial can be established, it can be used to estimate values of x and y which have not been provided.
Consider the following example.
Given data points (1,4),(2,9),(3,12), find an interpolating polynomial p(x) of degree at most 2 and then estimate the value corresponding to x=12.
Solution
We want to find a polynomial given by p(x)=r0+r1x1+r2x22 such that p(1)=4,p(2)=9 and p(3)=12. To find this polynomial, substitute the known values in for x and solve for r0,r1, and r2. p(1)=r0+r1+r2=4p(2)=r0+2r1+4r2=9p(3)=r0+3r1+9r2=12
Writing the augmented matrix, we have [1114124913912]
After row operations, the resulting matrix is [100−30108001−1]
Therefore the solution to the system is r0=−3,r1=8,r2=−1 and the required interpolating polynomial is p(x)=−3+8x−x2
To estimate the value for x = \frac{1}{2}, we calculate p(\frac{1}{2}): \begin{aligned} p(\frac{1}{2}) &= -3 + 8(\frac{1}{2}) - (\frac{1}{2})^2\\ &= -3 + 4 - \frac{1}{4} \\ &= \frac{3}{4}\end{aligned}
This procedure can be used for any number of data points, and any degree of polynomial. The steps are outlined below.
Suppose that values of x and corresponding values of y are given, such that the actual relationship between x and y is unknown. Then, values of y can be estimated using an interpolating polynomial p(x). If given x_1, ..., x_n and the corresponding y_1, ..., y_n, the procedure to find p(x) is as follows:
- The desired polynomial p(x) is given by p(x) = r_0 + r_1 x + r_2 x^2 + ... + r_{n-1}x^{n-1}\nonumber
- p(x_i) = y_i for all i = 1, 2, ...,n so that \begin{array}{c} r_0 + r_1x_1 + r_2 x_1^2 + ... + r_{n-1}x_1^{n-1} = y_1 \\ r_0 + r_1x_2 + r_2 x_2^2 + ... + r_{n-1}x_2^{n-1} = y_2 \\ \vdots \\ r_0 + r_1x_n + r_2 x_n^2 + ... + r_{n-1}x_n^{n-1} = y_n \end{array}\nonumber
- Set up the augmented matrix of this system of equations \left[ \begin{array}{rrrrr|r} 1 & x_1 & x_1^2 & \cdots & x_1^{n-1} & y_1 \\ 1 & x_2 & x_2^2 & \cdots & x_2^{n-1} & y_2 \\ \vdots & \vdots & \vdots & &\vdots & \vdots \\ 1 & x_n & x_n^2 & \cdots & x_n^{n-1} & y_n \\ \end{array} \right]\nonumber
- Solving this system will result in a unique solution r_0, r_1, \cdots, r_{n-1}. Use these values to construct p(x), and estimate the value of p(a) for any x=a.
This procedure motivates the following theorem.
Given n data points (x_1, y_1), (x_2, y_2), \cdots, (x_n, y_n) with the x_i distinct, there is a unique polynomial p(x) = r_0 + r_1x + r_2x^2 + \cdots + r_{n-1}x^{n-1} such that p(x_i) = y_i for i=1,2,\cdots, n. The resulting polynomial p(x) is called the interpolating polynomial for the data points.
We conclude this section with another example.
Consider the data points (0,1), (1,2), (3,22), (5,66). Find an interpolating polynomial p(x) of degree at most three, and estimate the value of p(2).
Solution
The desired polynomial p(x) is given by: p(x) = r_0 + r_1 x + r_2x^2 + r_3x^3\nonumber
Using the given points, the system of equations is \begin{aligned} p(0) &= r_0 = 1 \\ p(1) &= r_0 + r_1 + r_2 + r_3 = 2 \\ p(3) &= r_0 + 3r_1 + 9r_2 + 27r_3 = 22 \\ p(5) &= r_0 + 5r_1 + 25r_2 + 125r_3 = 66\end{aligned}
The augmented matrix is given by: \left[ \begin{array}{rrrr|r} 1 & 0 & 0 & 0 & 1 \\ 1 & 1 & 1 & 1 & 2 \\ 1 & 3 & 9 & 27 & 22 \\ 1 & 5 & 25 & 125 & 66 \end{array} \right]\nonumber
The resulting matrix is \left[ \begin{array}{rrrr|r} 1 & 0 & 0 & 0 & 1 \\ 0 & 1 & 0 & 0 & -2 \\ 0 & 0 & 1 & 0 & 3 \\ 0 & 0 & 0 & 1 & 0 \end{array} \right]\nonumber
Therefore, r_0 = 1, r_1 = -2, r_2 = 3, r_3 = 0 and p(x) = 1 -2x + 3x^2. To estimate the value of p(2), we compute p(2) = 1 -2(2) + 3(2^2) = 1 - 4 + 12 = 9.