Notes on Determinants and Matrix Inverse University of British Columbia, Vancouver Yue-Xian Li March 17, 2015 1
1 Definition of determinant Determinant is a scalar that measures the magnitude or size of a square matrix Notice that conclusions presented below are focused on rows and row expansions Similar results apply when the row-focus is changed to column-focus Definition (verbal): For each n n (square) matrix A, det A is the sum of n! terms, each is the product of n entries in which one and only one is taken from each row and column The sum exhausts all permutations of integers {1, 2,, n} Terms with even permutations carry a + sign and those with odd permutations a - sign Permutation: any rearrangement of an ordered list of numbers, say S, is a permutation of S Example 11: For S {1, 2, 3}, there are a total of 3! 6 permutations: {123, 231, 312, 132, 213, 321} Definition: For each permutation (j 1 j 2 j n ) of the ordered list S {1, 2,, n}, σ(j 1 j 2 j n ) min number of pairwise exchanges to recover order (12 n) Even/odd permutations: σ(j 1 j 2 j n ) is even/odd a permutation (j 1 j 2 j n ) is even/odd if the value of Example 12: For S {1, 2, 3}: σ(123) 0, σ(231) 2, σ(312) 2 are even; σ(132) 1, σ(213) 1, σ(321) 1 are odd 2
Example 131: Show that the determinant of diagonal and triangular matrices is equal to the product of diagonal entries Answer: In each one of these matrices, there is only one way of picking one and only one entry from each row and each column that is not a zero a 11 0 0 0 a 22 0 0 0 a nn a 11 0 0 a 22 0 a nn a 11 0 a 22 0 0 a nn a 11 a 22 a nn Example 132: Show that if A has a zero column (or row), det A 0 Answer: Since in every term of the determinant, there is one number from each row and each column Thus, there is at least a 0 in each product which makes every term equal to 0! a 11 a 1j a 1n 0 0 0 a n1 a nj a nn a 11 0 a 1n a i1 0 a in a n1 0 a nn 0 3
Definition (formula): n n matrix A [a ij ] (1 i, j n) a 11 a 12 a 1n a 21 a 22 a 2n det A ( 1) σ(j 1j 2 j n) a 1j1 a 2j2 a njn, a n1 a n2 a nn where the sum is taken over all possible permutations of integers (12 n) (a total of n!) and that { ( 1) σ(j 1j 2 j +1, if n) σ(j1 j 2 j n ) is even, 1, if σ(j 1 j 2 j n ) is odd A column focused formula reads a 11 a 12 a 1n a 21 a 22 a 2n det A a n1 a n2 a nn (i 1 i 2 i n) ( 1) σ(i 1i 2 i n) a i1 1a i2 2 a inn, Example 14: For a 3 3 matrix A [a ij ] (1 i, j 3), a 11 a 12 a 13 det A a 21 a 22 a 23 a 31 a n2 a 33 ( 1) σ(j 1j 2 j 3 ) a 1j1 a 2j2 a 3j3 (j 1 j 2 j 3 ) ( 1) σ(123)0 a 11 a 22 a 33 + ( 1) σ(231)2 a 12 a 23 a 31 + ( 1) σ(312)2 a 13 a 21 a 32 ( 1) σ(132)1 a 11 a 23 a 32 + ( 1) σ(213)1 a 12 a 21 a 33 + ( 1) σ(321)1 a 13 a 22 a 31 a 11 a 22 a 33 + a 12 a 23 a 31 + a 13 a 21 a 32 a 11 a 23 a 32 a 12 a 21 a 33 a 13 a 22 a 31 Remark: For matrices larger than 3 3, this formula is not practical to use by hand So, it shall be mainly employed in demonstrating important properties of determinants 4
2 Row and column expansion formulas As an engineer, you may not need to know how to prove each formula that we learn In this section, I will focus on the how-to without saying why For all practical purposes, an engineer should know how to calculate the determinant of a large matrix using either row or column expansions We have already learned how to calculate a 3 3 matrix using expansion in the first row of a matrix As a matter of fact, the first row is not always the best to use in an expansion formula So, we here extend that formulas to expansions in any row of a matrix a 11 a 1j a 1n a 11 a 1j a 1n a i1 a ij a in a i1 ( 1) i+1 a i1 a ij a in + a n1 a nj a nn a n1 a nj a nn a 11 a 1j a 1n a 11 a 1j a 1n +a ij ( 1) i+j a i1 a ij a in + +a in ( 1) i+n a i1 a ij a in a n1 a nj a nn a n1 a nj a nn a i1 c i1 + + a ij c ij + + a in c in row expansion formula, where A ij is the (n 1) (n 1) matrix obtained by deleting the i th row and j th column of A: a 11 a 1j a 1n a 11 a 1j a 1n A ij a i1 a ij a in, det A ij a i1 a ij a in a n1 a nj a nn a n1 a nj a nn det A ij is called the (i, j) th minor of A c ij ( 1) i+j det A ij is called the (i, j) th cofactor of A 5
Similarly, we can expand in the j th column of a matrix a 11 a 1j a 1n a 11 a 1j a 1n a i1 a ij a in a 1j ( 1) 1+j a i1 a ij a in + a n1 a nj a nn a n1 a nj a nn a 11 a 1j a 1n a 11 a 1j a 1n +a ij ( 1) i+j a i1 a ij a in + +a nj ( 1) n+j a i1 a ij a in a n1 a nj a nn a n1 a nj a nn a 1j c 1j + + a ij c ij + + a nj c nj column expansion formula Example 21: det A 2 0 2 4 0 0 3 2 2 2 4 4 3 0 6 2? Ans: Using expansion in the first row, we obtain det A ( 1) 1+1 2 2 0 2 4 0 0 3 2 2 2 4 4 3 0 6 2 2 0 3 2 2 4 4 0 6 2 + ( 1) 1+3 2 + 2 0 0 2 2 2 4 3 0 2 2 0 2 4 0 0 3 2 2 2 4 4 3 0 6 2 4 + ( 1) 1+4 4 0 0 3 2 2 4 3 0 6 2 0 2 4 0 0 3 2 2 2 4 4 3 0 6 2 6
Using expansion in the second row, we obtain det A ( 1) 2+3 3 2 0 2 4 0 0 3 2 2 2 4 4 3 0 6 2 +( 1) 2+4 2 2 0 2 4 0 0 3 2 2 2 4 4 3 0 6 2 But the simplest is to expand in the second column, 3 2 0 4 2 4 4 3 0 2 +2 2 0 2 2 2 4 3 0 6 det A ( 1) 3+2 2 2 0 2 4 0 0 3 2 2 2 4 4 3 0 6 2 ( 1) 5 2 2 2 4 0 3 2 3 6 2 ( 2)(12 + 12 36 24) 72 Remarks: (i) Row (column) expansion is the sum of the products between all entries of that row (column) multiplied by the corresponding cofactors (ii) The (i, j) th cofactor c ij ( 1) i+j det A ij, where A ij is the (n 1) (n 1) matrix obtained by deleting the i th row and the j th column of matrix A 7
Derivation/proof of the expansion formula (Not required!): det A a ij ( 1) i+j det A ij a ij c ij Proof: Based on the definition: det A (l 1 l i l n) (l 1 l i l n) (l 1 l i l n) ( 1) σ(l 1 l i l n) [a 1l1 a ili a nln ] ( 1) σ(l il 1 l (i 1) l (i+1) l n) (i 1) ( 1) σ(jl 1 l (i 1) l (i+1) l n) (i 1) (j 1) a ij ( 1) i+j a ij ( 1) i+j det A ij l k j for all k (l 1 l (i 1) l (i+1) l n) [a ili a 1l1 a (i 1)l(i 1) a (i+1)l(i+1) a nln ] [a ij a 1l1 a (i 1)l(i 1) a (i+1)l(i+1) a nln ] ( 1) σ(l 1 l (i 1) l (i+1) l n) ] [a 1l1 a (i 1)l(i 1) a (i+1)l(i+1) a nln In the derivation above, we used the following identities: (i) σ(l 1 l i l n ) σ(l i l 1 l (i 1) l (i+1) l n ) (i 1), because it takes (i 1) pairwise exchanges to turn (l i l 1 l (i 1) l (i+1) l n ) into (l 1 l i l n ) (ii) σ(l i l 1 l (i 1) l (i+1) l n ) σ(jl 1 l (i 1) l (i+1) l n ) (j 1), because it takes (j 1) pairwise exchanges to turn (1 j n) into (j1 (j 1)(j + 1) l n ) (iii) ( 1) (i+j) 2 ( 1) (i+j) ( 1) i+j 8
3 Important properties of determinants 31 det A det A T Because the row-focused and column-focused formulas are identical det A ( 1) σ(j 1j 2 j n) a 1j1 a 2j2 a njn (i 1 i 2 i n) ( 1) σ(i 1i 2 i n) a i1 1a i2 2 a inn det A T Example 31: 1 2 3 4 4 6 1 3 2 4 9
32 det A k l det A Proof: Suppose that matrix A A k l is obtained by swapping the k th and j th rows of A Thus, a ij a ij except that a kj a lj and a lj a kj for all 1 j n Then, det A ( 1) σ(j 1j 2 j k j l j n) a 1j 1 a 2j 2 a kj k a lj l a nj n ( 1) σ(j 1j 2 j k j l j n) a 1j1 a 2j2 a ljk a kjl a njn ( 1) σ(j 1j 2 j k j l j n) a 1j1 a 2j2 a kjl a ljk a njn ( 1) σ(j 1j 2 j l j k j n)+1 a 1j1 a 2j2 a kjl a ljk a njn det A Note that σ(j 1 j 2 j k j l j n ) σ(j 1 j 2 j l j k j n ) + 1 because the two differ by one pairwise swap Example 32: 1 2 3 4 4 6 2, but 3 4 1 2 2 1 4 3 6 4 2 10
33 det A kl 0 If two rows (columns) of a matrix A are identical (ie A A k l ), then det A det A k l det A 0 Alternatively, if two rows are identical or are constant multiples of each other, then the rows in A are not linearly independent Thus, A is not invertible which implies det A 0 Example 33: 1 2 1 2 2 2 0 11
34 Determinant is linear in each row/column Suppose a row vector is a linear combination of two row vectors, say the k th a k sb + tc (k 1, 2,, n), where s, t are scalars Then, row a 1 a 1 a 1 a 2 a 2 a 2 det s det + t det sb + tc ḅ c a n a n a n Equivalently, we can also express this property in the following form a 11 a 12 a 1n a 21 a 22 a 2n sb 1 + tc 1 sb 2 + tc 2 sb n + tc n a n1 a n2 a nn s a 11 a 12 a 1n a 21 a 22 a 2n b 1 b 2 b n a n1 a n2 a nn +t a 11 a 12 a 1n a 21 a 22 a 2n c 1 c 2 c n a n1 a n2 a nn Proof: det A ( 1) σ(j 1j 2 j n) a 1j1 a 2j2 a kjk a njn s ( 1) σ(j 1j 2 j n) a 1j1 a 2j2 (sb jk + tc jk ) a njn ( 1) σ(j 1j 2 j n) a 1j1 a 2j2 b jk a njn +t ( 1) σ(j 1j 2 j n) a 1j1 a 2j2 c jk a njn 12
This property can also be expressed in form of two related properties: (1) a 11 a 12 a 1n a 21 a 22 a 2n sa k1 sa k2 sa kn a n1 a n2 a nn s a 11 a 12 a 1n a 21 a 22 a 2n a k1 a k2 a kn a n1 a n2 a nn, (2) a 11 a 12 a 1n a 21 a 22 a 2n b 1 + c 1 b 2 + c 2 b n + c n a n1 a n2 a nn a 11 a 12 a 1n a 21 a 22 a 2n b 1 b 2 b n a n1 a n2 a nn + a 11 a 12 a 1n a 21 a 22 a 2n c 1 c 2 c n a n1 a n2 a nn Example 34: a b 3 5 5a 3b, 2a 2b 3 5 10a 6b 2(5a 3b) 2 a b 3 5 a + c b + d 3 5 a b 3 5 + c d 3 5 13
35 Adding a scalar multiple of one row to another Let matrix A be identical to A except that k th row multiplied by scalar s ( 0) is added to l th row (1 k < l n) Thus, a ij a ij for all 1 i, j n except that a lj a lj + sa kj Then, det A det A Proof: det A ( 1) σ(j 1j 2 j n) a 1j 1 a 2j 2 a lj k a nj n ( 1) σ(j 1j 2 j n) a 1j1 a kjk (a ljl + sa kjl ) a njn ( 1) σ(j 1j 2 j n) a 1j1 a kjk a ljl a njn +s det A + 0 det A ( 1) σ(j 1j 2 j n) a 1j1 a kjk a kjl a njn Example 35: a c b d ad bc a c + 2a b d + 2b a c b d + 2 a a b b a c b d 14
36 det AB det A det B Example 36: det A 2 1 3 4 8 3 5, det B 1 1 4 3 3 ( 4) 7 AB [ 2 5 13 15 ], det AB 2 5 13 15 30 ( 65) 35 det A det B 15
Proof(1): (Not required!) Case I: If at least one of A and B is noninvertible, ie either det A 0 or det B 0 or both, then AB as the composite transformation of the two must also be noninvertible Thus, det(ab) 0 det A det B Case II: If both A and B are invertible, then based on the results on elementary matrices: A A 1 A 2 A k, B B 1 B 2 B l, where A 1,, A k and B 1,, B l are all elementary matrices Therefore, det(ab) det(a 1 A 2 A k B 1 B 2 B l ) (det A 1 det A k )(det B 1 det B l ) det A det B 16
Proof(2): (Not required!) Note that AB [(AB) ij ], where (AB) ij a il b lj det AB ( 1) σ(j 1j 2 j n) l1 ( 1) σ(j 1j 2 j n) (AB) 1j1 (AB) 2j2 (AB) njn ( l 1 1 a 1l1 b l1 j 1) ( l 2 1 ) ( ) a 2l2 b l2 j 2 a nln b lnjn l n1 All non selfavoiding terms cancel (ie l 1,l 2,,l n must be distinct) because an identical term with opposite sign occurs when sumed over all permutations of ( 1) σ(j 1j 2 j n) (a 1l1 b l1 j 1 )(a 2l2 b l2 j 2 ) (a nln b lnjn ) det B det A ( 1) σ(j 1j 2 j n) ( 1) σ(j 1j 2 j n) (l 1 l 2 l n) (l 1 l 2 l n) (l 1 l 2 l n) ( 1) σ(j 1j 2 j n) (b 1j1 b 2j2 b njn ) (a 1l1 a 2l2 a nln )(b l1 j 1 b l2 j 2 b lnj n ) (a 1l1 a 2l2 a nln )( 1) σ(l 1l 2 l n) (b 1j1 b 2j2 b njn ) ( 1) σ(l 1l 2 l n) (a 1l1 a 2l2 a nln ) (l 1 l 2 l n) The key step in the proof above is to eliminate all the non-selfavoiding terms Here, a non-selfavoiding term refers to those terms in which l i l j (i j) happens for at least one pair of i, j (1 i, j n) To see this more clearly, we show the case when only two subscripts exists for 2 2 matrices In this case, det AB (12) or (21) (j 1 j 2 ) (12) or (21) (j 1 j 2 ) (12) or (21) (j 1 j 2 ) ( 1) σ(j 1j 2 ) ( 1) σ(j 1j 2 ) (AB) 1j1 (AB) 2j2 ( 2 l 1 1 a 1l1 b l1 j 1) ( 2 l 2 1 a 2l2 b l2 j 2 ) ( 1) σ(j 1j 2 ) (a 11 b 1j1 + a 12 b 2j1 ) (a 21 b 1j2 + a 22 b 2j2 ) (a 11 b 11 + a 12 b 21 ) (a 21 b 12 + a 22 b 22 ) (a 11 b 12 + a 12 b 22 ) (a 21 b 11 + a 22 b 21 ) Terms with identical color cancel each other Self avoiding colors! 17
a 11 b 11 a 22 b 22 + a 12 b 21 a 21 b 12 a 11 b 12 a 22 b 21 a 12 b 22 a 21 b 11 2 (a 1l1 b l1 1a 2l2 b l2 2 a 1l1 b l1 2a 2l2 b l2 1) l 1,l 2 1, (l 1 l 2 ) 2 ( 1) σ(j 1j 2 ) a 1l1 b l1 j 1 a 2l2 b l2 j 2 l 1,l 2 1, (l 1 l 2 ) (j 1 j 2 )( 1) σ(j1j2) a 1l1 b l1 j 1 a 2l2 b l2 j 2 (l 1 l 2 ) (j 1 j 2 ) (l 1 l 2 ) (j 1 j 2 )( 1) σ(j1j2) (a 1l1 a 2l2 )(b l1 j 1 b l2 j 2 ) ( 1) σ(j 1j 2 ) (a 1l1 a 2l2 )( 1) σ(l 1l 2 ) (b 1j1 b 2j2 ) (l 1 l 2 ) (j 1 j 2 ) ( 1) σ(l 1l 2 ) (a 1l1 a 2l2 ) ( 1) σ(j 1j 2 ) (b 1j1 b 2j2 ) (l 1 l 2 ) (j 1 j 2 ) det A det B Here, non-selfavoiding terms are terms like a 11 b 11 a 21 b 12 and a 12 b 21 a 22 b 22 in which entries from the same column or row of a matrix occur twice in the same product They all cancel out in the summation Therefore, self-avoiding means in each term of the expression, there must be one and only one entries from each row and each column of each matrix The same conclusion works in a similar way when the matrix is bigger For any term that contains at least one pair of non-selfavoiding entries, we can use the same argument for this particular pair of entries in exactly the same way as we treat the 2 2 case 18
4 Formula for the inverse of n n matrices Definition of minor and cofactor: n n matrices A [a ij ], the (i, j) th minor and (i, j) th cofactor are m ij det A ij, c ij ( 1) i+j m ij, where A ij is the (n 1) (n 1) matrix obtained by deleting the i th row and j th column of A Definition of cofactor matrix: n n matrices A [a ij ], its cofactor matrix is defined as c 11 c 12 c 1n c 21 c 22 c 2n C [c ij ], c n1 c n2 c nn where c ij ( 1) i+j det A ij is the (i, j) th cofactor of matrix A Formula for A 1 : invertible n n matrices A with a cofactor matrix C: ( ) 1 A 1 C T det A 19
Example 41: Consider the matrix A 0 2 1 1 1 0 2 5 2 (a) Show that it is invertible using the row expansion formula; (b) Find A 1 using the cofactor formula Ans: (a) First calculate the cofactors for the expansion in row 1: c 11 + 1 0 5 2 2; c 12 1 0 2 2 2; c 13 + 1 1 2 5 3 det A (0)c 11 + (2)c 12 + (1)c 13 4 + 3 7 0! (b) Then, calculate all the other cofactors: c 21 2 1 5 2 9; c 22 + 0 1 2 2 2; Therefore, Verify, c 31 + 2 1 1 0 1; C 2 2 3 9 2 4 1 1 2 c 32 A 1 0 1 1 0 c 23 0 2 2 5 4 1; c 33 + ( ) 1 C T 1 det A 7 0 2 1 1 2 9 1 2 2 1 3 4 2 2 A 1 A 1 7 2 9 1 2 2 1 3 4 2 0 2 1 1 1 0 2 5 2 1 7 7 0 0 0 7 0 0 0 7 1 0 0 0 1 0 0 0 1 I 3 20
Derivation/proof of the cofactor formula for inverse: (Not required!) A 1 ( ) 1 C T det A Proof: Based on the definition of det A: det A a ij c ij a ij c ij det A 1 Let A [a ij] be a matrix obtained by replacing the i th row of A by its l th row Then, det A a ijc ij a lj c ij If l i (no change), then A A det A a ijc ij a lj c ij a ij c ij det A a lj c ij det A 1 ( for l i) If l i, then A has two identical rows i and l, thus det A 0 a ijc ij a lj c ij a lj c ij det A 0 ( for l i) Therefore, a lj c ij det A { 1, if l i, 0, if l i 21
Introduce a new matrix B [b ij ] such that b ij c ji det A Now, let D AB [d ij ] Based on definition of matrix multiplication d li a lj b ji a lj c ij det A { 1, if l i, 0, if l i Therefore, D I AB c ji A 1 B [b ij ] [ det A ] ( ) 1 C T det A 22
5 Cramer s rule (not in syllabus) Cramer s Rule on component-wise solution of matrix equation Ax b: Let A [c 1 c 2 c n ] where c j (j 1, 2,, n) are its column vectors If det A 0, then x Thus, component-wise we have x i 1 det A x 1 x n c T ijb j 1 det A A 1 b 1 det A CT b b j c ji, (i 1, 2,, n), where b j c ji is deta in form of expansion in i th column with a ji replaced by b j! Thus, b j c ji det A (ib) det[c 1 c i 1 b c i+1 c n ] a 11 a 1(i 1) b 1 a 1(i+1) a 1n a n1 a n(i 1) b n a n(i+1) a nn, where A (ib) is obtained by replacing the i th column of A by the vector b! Therefore, x i det A (ib), (i 1, 2,, n) det A 23
Example 51: Solve Ax b for x component-wise using Cramer s Rule, where [ ] [ ] 2 1 10 A, b 1 1 20 Ans: Using Cramer s Rule x 1 det A (1b) det A x 2 det A (2b) det A 10 1 20 1 2 1 1 1 2 10 1 20 2 1 1 1 10 20 2 1 10 40 10 2 1 30 Therefore, x [ x1 x 2 ] [ 10 30 ] 24