We now use the interpretation of Gauss reduction given above to find the inverse of a (if it has one). Theorem 2.70 (Row operations and the matrix inverse). If row operations are applied to a n×n matrix A to bring it to reduced row echelon form R, then either

(i) R = In (the identity matrix) and A is invertible, or (ii) R has at least one row of zeros and A is not invertible.

Proof. Since R is a , either: (i) R has a leading 1 in every column of the matrix or; (ii) the leading 1s skip (at least) one column so there is (at least) one row of zeros at the end. That is, either 1 0 ∗ 0 ... 0 1 0 ... 0 0 0 1 ∗ 0 ... 0 0 1 ... 0 0     0 0 0 1 ... 0 . . . . .   (i) R = ......  = I or (ii) R = ......  .   ......  0 0 ... 1 0     0 0 0 0 ... 1 0 0 ... 0 1   0 0 0 0 ... 0

Now suppose E1,E2,...,Ek are the elementary matrices such that R = Ek ...E2E1A and consider the two cases.

(i) Here R = I, so I = EA, where E = Ek ...E2E1 is the product of the elementary matrices used to reduce A to the reduced row echelon form R. We find E is the inverse of A. Certainly EA = I, so E works on the left of A. But also E is invertible (as it is a product of elementary matrices which are invertible), and hence

−1 −1 −1 −1 In = E E = E IE = E (EA)E = (E E)AE = IAE = AE, so E also works on the right. Thus

−1 (2.11) A = E = Ek ...E2E1.

(ii) Here R has a row of zeros, so any product RC has a row of zeros for any matrix C. Therefore RC 6= I for any matrix C. Thus R is not invertible, so neither is A (if A were invertible, then R = En ...E2E1A would be invertible too, since it would be a product of invertible matrices, which is a contradiction). 

The proof of Theorem 2.70 gives an algorithm for finding the inverse of a matrix (when it has one). In fact the argument shows that if A is invertible then it is row equivalent to the identity matrix I. Further if E1,E2,...,Ek are the elementary matrices such that R = I = Ek ...E2E1A, then the inverse is given by the formula (2.11)!

So to compute the inverse A−1 of an invertible matrix A, we simply apply row operations to A to reduce A to the identity matrix I and keep a record of the elementary matrices E1,E2,...,Ek involved. We then multiply these together in reverse order to find

−1 A = Ek ...E2E1.

1 1 3 Example 2.71. Given A = 0 1 1 , find A−1. 0 0 1

56 Solution:

4.1. The supermatrix method. A compact way of presenting the working above is to use the supermatrix method.

Write down the n × n matrix A and the identity matrix In in one large supermatrix A∗ = [A|I] of n rows and 2n columns. Now apply the row operations to A∗ that reduce A to reduced row echelon form R. As A is reduced to R = I, the same operations applied to I give A−1. If A is not row equivalent to I then A is not invertible.

That is, if row operations applied to the supermatrix A∗ = [A|I] produce [R|C], where R is in reduced row echelon form. If R = I, then C = A−1. On the other hand, if R has a row of zeros then A is not invertible. Example 2.72. Use the supermatrix method to find A−1, where A is the matrix of Example 2.71.

Solution:

The algorithm given in the supermatrix method is quite mechanical and produces the inverse in a rea- sonably straightforward way. The arithmetic may become a bit tedious for matrices bigger than 3 × 3, but there are computer packages available than do these sorts of matrix calculations.

1 1 −1 Example 2.73. Given A = 3 1 −2, use the supermatrix method to find A−1. 1 −2 1

57 Solution:

5. 5.1. The 2 × 2 case. a b Recall that, if A = is a 2 × 2 matrix, then by Lemma 2.53 the matrix A is invertible if and c d only if ab − cd 6= 0. In particular, the value of ad − bc determines whether or not A is invertible. This observation leads to the following definition. a b Definition 2.74 (). The determinant of a 2 × 2 matrix A = is the number ad − bc. c d We denote the determinant of A by det(A) or |A|. In the latter case we use vertical lines instead of brackets to border the array, so we write

a b det(A) = |A| = = ad − bc. c d

2 −5 1 0  3 −2 Example 2.75. Find the determinants of A = , I = , and B = . 3 7 0 1 −3 2 Solution:

In the next two results we list some properties of determinants, which we justify when A and B are 2 × 2 matrices and I = I2, the 2 × 2 identity matrix. However, later on we will define the determinant of a general n × n matrix, and these properties remain true (though we shall not prove them) when A and B are n × n matrices and I = In is the n × n identity matrix. Lemma 2.76 (Properties of determinants). If A and B are square matrices (of the same size) and I is the identity matrix then: (i) det(I) = 1. (ii) det(AT ) = det(A).

58 (iii) det(AB) = det(A) det(B). −1 1 (iv) If det(A) 6= 0, then A is invertible and det(A ) = det(A) . Conversely, if A is invertible, then det(A) 6= 0. Proof. As mention above, we only consider the 2 × 2 case. The first property (i) is contained in Example 2.75. For the remaining properties, we let a b e f ae + bg af + bh A = and B = , and so AB = . c d g h ce + dg cf + dh



We now state how the determinant of a matrix is affected by the elementary row operations of the last section. Again we only give the proof in the 2×2 case, but it also holds for general square n×n matrices. Lemma 2.77 (Row operations on determinants). If the square matrix B is obtained from A by: • multiplying a row of A by a scalar λ, then det(B) = λ det(A), • adding a multiple of one row of A to another, then det(B) = det(A), • interchanging two rows of A, then det(B) = − det(A). Further, each of these remains true if we replace row by column. Proof. We leave (i), (ii) and (iii) as exercises, and just consider the last remark on columns. Remember the rows of AT are the columns of A, so any column operation on A can be achieved by first taking the of A, then performing the corresponding row operation on AT , and then taking the transpose of the resulting matrix. Since by Lemma 2.76 a matrix and its transpose have the same determinant, the result follows. 

 1 2 Example 2.78. Compare det A and det B, for A = and B which is obtained from A by: −2 3 (i) multiplying the first row of A by 2; (ii) adding twice the first row of A to the second; (iii) interchanging the two rows of A.

59 Solution:

Beware: If B = 2A, and A is a 2 × 2 matrix, then both rows of A get multiplied by 2, so det(B) = 2 × 2 det(A) = 22 det(A).

5.2. The 3 × 3 case. Before defining the determinant of a 3 × 3 matrix A, we define some 2 × 2 subdeterminants of A called cofactors.

Definition 2.79. Let A = [aij] be a 3 × 3 matrix. The cofactor of the entry aij of A, denoted Aij, is given by

determinant of the 2 × 2 matrix obtained from A by deleting row i and A = (−1)i+j × ij column j of A.

1 2 3 Example 2.80. If A = 4 5 6 find A11,A12,A13 and A21. 7 8 0

Solution:

Remark: Since (−1)i+j is 1 if i + j is even and −1 if i + j is odd, the signs of the cofactors from a + − + ”chessboard” type pattern. For instance in the 3 × 3 case, the ± signs take the form − + −. + − +

60 Definition 2.81. The determinant of the 3 × 3 matrix A = [aij] is given by

det(A) = a11A11 + a12A12 + a13A13. That is, det(A) is the sum of the products of each entry in the first row of A times its corresponding cofactor. For this reason we say we have found det(A) by expanding about its first row. In terms of the elements of A

a11 a12 a13 a22 a23 a21 a23 a21 a22 det(A) = a21 a22 a23 = a11 − a12 + a13 . a32 a33 a31 a33 a31 a32 a31 a32 a33

Example 2.82. Find det(A), where A is the matrix of Example 2.80.

Solution:

5.3. Expansion of det(A) by any row or column. We have defined the determinant of a 3 × 3 matrix by expanding along the first row. However, it turns out that we may replace the first row, by any row or column.

Theorem 2.83 (Computing det(A) by expanding along any row or column). Let A = [aij] be a 3 × 3 matrix. (i) For i = 1, 2, or 3, we have

P3 det(A) = j=1 aijAij = ai1Ai1 + ai2Ai2 + ai3Ai3.

This is called the expansion about row i.

(ii) For j = 1, 2, or 3

P3 det(A) = i=1 aijAij = a1jA1j + a2jA2j + a3jA3j.

This is called the expansion about column j.

1 2 3 Example 2.84. If A = 4 5 6, find det(A) by expanding by (i) row 3; (ii) column 3. 7 8 0

61 Solution:

It is now quite easy to extend the idea behind the definition of a 3×3 determinant to give the determinant of an arbitrary n × n matrix. Just as we defined the determinant of a 3 × 3 matrix in terms of 2 × 2 determinants, we define the determinant of an n × n matrix in terms of (n − 1) × (n − 1) determinants. More precisely, we start with defining the relevant cofactors.

Definition 2.85 (Cofactors for a n × n matrix). Let A = [aij] be an n × n matrix (where n > 2). The cofactor of the entry aij of A, denoted by Aij , is given by

the determinant of the (n−1)×(n−1) matrix obtained by deleting A = (−1)i+j × ij row i and column j of A.

Note: Just as for a 3 × 3 matrix, the signs of the cofactors form a chessboard pattern as shown:  + − + ... (−1)1+n  − + − ... (−1)2+n  3+n  + − + ... (−1)    .  ......   . . . . .  (−1)n+1 (−1)n+2 (−1)n+3 ... +

 1 2 3 0  4 5 6 8 Example 2.86. If A =   , find A22 and A34. −1 3 −2 0 7 8 0 0

Solution:

62 The n × n determinant is now defined in a similar fashion to the 3 × 3 determinant.

Definition 2.87 (Determinant of a n × n matrix). Let A = [aij] be an n × n matrix (where n > 2). The determinant of A is given by

det(A) = a11A11 + a12A12 + ··· + a1nA1n,

where we have expanded det(A) by means of the first row.

Note: As in the 3 × 3 case we can expand by any row or column. So for instance, for any 1 6 j 6 n we have

det(A) = aj1Aj1 + aj2Aj2 + ··· + ajnAjn.

Since each cofactor Aij involves the determinant of an (n − 1) × (n − 1) matrix, which can be evaluated in terms of the determinants of (n − 2) × (n − 2) matrices and so on, eventually we can express det(A) in terms of 2 × 2 matrices (although the formula becomes very messy!).

 1 2 3 0  4 5 6 8 Example 2.88. If A =  , find det(A) by expanding about row 1. −1 3 −2 0 7 8 0 0

Solution:

5.4. Further properties of determinants. The determinant of an n×n matrix satisfies all the properties of Lemma 2.76, Lemma 2.77, and Theorem 2.83. However, they are not so easy to establish and we shall not justify them here (for example, even showing det(AB) = det(A) det(B) for 3×3 matrices A and B directly from the definition is very tedious, and is usually done by other means).

On the other hand, the following two properties are easy. Lemma 2.89 (Zero row or column implies zero determinant). Let A be a square (n × n) matrix. (i) If A has a row (or column) of zeros, then det(A) = 0.

(ii) If A has two rows (or columns) the same, then det(A) = 0.

Proof.

63 

1 2 3 1 2 3

Example 2.90. Find (i) −1 −2 −3 and (ii) 2 4 6 .

2 3 4 2 3 4 Solution:

When expanding a determinant, it is best to do so using a row (or column) with as many zeros as possible. If there aren’t any such rows (or columns) we can often perform row operations using Lemma 2.77 on the determinant to create more zeros and simplify calculations.

1 2 3 0 1 1 3 4 5 6 8 Example 2.91. Find (i) 2 −1 4 and (ii) . −1 3 −2 0 1 −4 2 7 8 0 0 Solution:

64 Summary of Chapter 2. Matrices, Linear Equations and Determinants Section 1: Matrices and matrix operations Assume matrix operations and standard properties contained in Lemma 2.12 and Lemma 2.18 known. (Importantly, typically we have AB 6= BA!) Transpose AT of A and the standard rules in Lemma 2.22: (A + B)T = AT + BT and (AB)T = BT AT .

Section 2: Systems of linear equations Assume these concepts known: Augmented matrix, reduced row echelon form, row operations, Gauss reduction, procedure for solving a system of linear equations, multiple solutions (involving a general solution), inconsistent systems.

Section 3: Inverses Identity matrix I such that IA = A = AI when A square. A is invertible if there is a matrix C such that AC = I = CA. Write (unique) inverse as A−1. a b  d −b Inverse of 2 × 2 matrices: If A = , where ad − bc 6= 0, then A−1 = 1 . c d ad−bc −c a If A invertible, then matrix equation AX = B has a (unique) solution X = A−1B. Main rules for inverses in Theorem 2.57 and Theorem 2.60: (i)( AB)−1 = B−1A−1, (ii)( λA)−1 = (1/λ)A−1 (provided λ 6= 0), (iii)( AT )−1 = (A−1)T .

Section 4: Elementary matrices and inverses Any row operation on A is also obtained by the EA, where E is the elementary matrix resulting from performing the same row operation on I. There are three types of elementary matrices corresponding to the three types of row operations. Each such elementary matrix is invertible with inverse of the same type.

Reinterpret Gauss reduction: There are elementary matrices E1,E2,...,En, such that

En ...E2E1A = R, where R is a reduced row echelon matrix of A. −1 A is invertible ⇐⇒ R = I (A can be reduced to I), and inverse is given by A = En ...E2E1. A has no inverse ⇐⇒ R has (at least one) row of zeros. Supermatrix method: Apply standard Gauss reduction to reduce [A|I] to [I|C] then C = A−1.

Section 5: Determinants A determinant is a number associated with a square matrix, denoted by det(A) or |A|. a b A is invertible ⇐⇒ det(A) 6= 0. Determinant of 2 × 2 matrix = ad − bc. c d Main properties in Lemma 2.76: (i) det(A) = det(AT ), (ii) det(AB) = det(A) det(B), (iii) det(A−1) = 1/ det(A).

Row operations and determinants (Lemma 2.77): If B obtained from A by (i) scaling a row of A by λ then det(B) = λ det(A); (ii) adding a multiple of one row of A to another then det(B) = det(A); (iii) interchanging two rows of A then det(B) = − det(A).

65 i+j Cofactor Aij of matrix A is = (−1) × (determinant of submatrix obtained by deleting row i and column j of A).

Determinant of n × n matrix A = [aij]:

det(A) = ai1Ai1 + ai2Ai2 + ··· + ainAin (expansion about row i)

= a1jA1j + a2jA2j + ··· + anjAnj (expansion about column j).

Properties in Lemma 2.89: det(A) = 0 if either (i) A has a row (col) of zeros; or (ii) A has two rows ( or columns) the same.

66