Chapter 7 Matrices Definition An m n matrix is an array of numbers set out in m rows and n columns Examples (i ( 1 1 5 2 0 6 has 2 rows and 3 columns and so it is a 2 3 matrix (ii 1 0 7 1 2 3 3 1 is a 4 2 matrix (iii 1 2 3 4 5 6 7 8 9 is a 3 3 matrix a (iv A vector b is a 3 1 matrix c The word matrix was inroduced into mathematics in 1850 by James Joseph Sylvester (1814-1897, though the idea of writing out coefficients of equations as rectangular arrays of numbers dates back to antiquity (there are Chinese examples from about 200BC, and Carl Friedrich Gauss (1777-1855 used this notation in his work on simultaneous equations Sylvester and Arthur Cayley (1821-1895 developed the theory of matrices we use today, and which we shall investigate in this Chapter 49
We write A (a ij m n to mean that A is an m n matrix whose (i, j-entry is a ij, that is, a ij is in the i-th row and j-th column of A If A (a ij m n then A a 11 a 12 a 1n a 21 a 22 a 2n a m1 a m2 a mn and we say that A has size m n An n n matrix is called a square matrix ( ( a11 a Example Let A (a ij 2 2 12 2 1 a 21 a 22 4 3 Then A is a square matrix of size 2 2 The (1, 2-entry of A is a 12 1, and the (2, 2-entry of A is a 22 3 Example We write out in full A (a ij 3 2 with a ij i(i + j a 11 a 12 A a 21 a 22, a 31 a 32 with a 11 1(1 + 1 2, a 12 1(1 + 2 3, a 21 2(2 + 1 6, a 22 2(2 + 2 8, a 31 3(3 + 1 12, a 32 3(3 + 2 15, and so A 2 3 6 8 12 15 Definition Matrices A and B are equal if they have the same size and the same (i, j-entry for every possible value of i and j, that is, A (a ij m n, B (b ij m n and a ij b ij for all i, j with 1 i m, 1 j n Notation 0 mn is the m n matrix with every entry 0 (0 mn may also be denoted by 0 m n ( 0 0 0 For example, 0 23 0 0 0 We call 0 mn the zero m n matrix I n is the (square n n matrix with (1, 1-entry (2, 2-entry (n, n-entry 1 and all other entries 0 We call I n the identity n n matrix 50
71 Addition of matrices If A (a ij m n and B (b ij m n then A + B is the m n matrix whose (i, j entry is a ij + b ij Note We can only add matrices of the same size If A (a ij m n, the negative of A, written A, is the m n matrix whose (i, j-entry is a ij Thus A D, where D (d ij m n with d ij a ij Examples ( ( ( 1 2 3 1 1 2 2 3 1 + 4 5 6 2 1 3 2 4 9 ( ( 1 2 1 2 3 4 3 4 72 Rules for matrix addition Theorem 71 Let A, B, C be m n matrices Then (i (A + B + C A + (B + C (ii A + B B + A (iii 0 mn + A A (iv A + ( A 0 mn Proof (i Let A (a ij m n, B (b ij m n, C (c ij m n Then A + B is an m n matrix whose (i, j-entry is a ij + b ij and so (A + B + C is an m n matrix whose (i, j-entry is (a ij + b ij + c ij Similarly, B + C is an m n matrix whose (i, j-entry is b ij + c ij and so A + (B + C is an m n matrix whose (i, j-entry is a ij + (b ij + c ij The result follows, since (a ij + b ij + c ij a ij + (b ij + c ij (by the associative law for addition of real numbers Proofs of (ii, (iii and (iv: exercises for you 51
73 Scalar multiplication of matrices Let A (a ij m n and let α be a scalar (that is, a real number Then αa is the m n matrix whose (i, j-entry is αa ij Thus, αa B, where B (b ij m n with b ij αa ij Note that ( 1A A Examples ( 1 2 ( 2 3 4 3 ( 0 1 + 4 1 0 1 3 2 5 7 6 ( 2 4 6 8 3 9 6 15 21 18 ( 0 4 + 4 0 74 Rules for scalar multiplication ( 2 8 2 8 Theorem 72 Let A and B be m n matrices and let α, β be scalars Then: (i α(a + B αa + αb (ii (α + βa αa + βa (iii α(βa (αβa (iv 1A A (v 0A 0 mn Proof (i Let A (a ij m n, B (b ij m n Then A + B is an m n matrix with (i, j- entry a ij +b ij and α(a+b is an m n matrix with (i, j-entry α(a ij +b ij αa ij +αb ij But αa is an m n matrix with (i, j-entry αa ij and αb is an m n matrix with (i, j- entry αb ij, and so αa + αb is an m n matrix with (i, j-entry αa ij + αb ij (iii Let A (a ij m n Then βa is an m n matrix with (i, j-entry βa ij and so α(βa is an m n matrix with (i, j-entry α(βa ij (αβa ij But (αβa is also an m n matrix with (i, j-entry (αβa ij Proofs of (ii,(iv,(v: exercises for you 75 Matrix multiplication This is rather more interesting and more complicated than scalar multiplication It will become clearer later why we define matrix multiplication in the way that we do Let A (a ij m n and B (a ij n p Then the product AB is the m p matrix with (i, j-entry n a ik b kj a i1 b 1j + a i2 b 2j + + a 1n b nj k1 52
Thus AB C, where C (c ij m p with c ij n a ik b kj a i1 b 1j + a i2 b 2j + + a 1n b nj k1 Observe that to get the (i, j-entry of AB, we focus on the i-th row of A and the j-th column of B: a i1 a i2 a in b 1j b 2j b nj and we form their dot product, the sum a i1 b 1j + a i2 b 2j + + a 1n b nj Example 1 Let A ( 1 1 3 7 ( 2 9 5, B 6 4 8 A is a 2 2 matrix and B is a 2 3 matrix They can be multiplied since the number of columns of A equals the number of rows of B The product AB will be a 2 3 matrix as it will have the same number of rows as A and the same number of columns as B To get the (1, 3-entry of AB for example, we pick out the 1st row of A and the 3rd column of B: 1 1 5 8 and we form their dot product, the sum 1 5 + ( 1 8 3 In full: ( ( 1 2 + ( 1 6 1 9 + ( 1 4 1 5 + ( 1 8 4 5 3 AB 3 2 + 7 6 3 9 + 7 4 3 5 + 7 8 48 55 71 Example 2 ( 1 0 2 2 1 4 1 2 3 ( 1 1 + 0 ( 2 + ( 2 3 2 1 + 1 ( 2 + 4 3 ( 5 12 Example 3 ( 6 4 9 6 ( 6 4 9 6 53 ( 0 0 0 0 0 22
Example 4 ( 1 0 Let A 1 1 and so AB BA, B AB ( 1 2 3 4 ( 1 2 4 6 ( 3 2, BA 7 4, 76 Rules for matrix multiplication Theorem 73 Let A (a ij m n, B (b ij m n, X (x ij n p, Y (y ij n p Then: (i (A + BX AX + BX, A(X + Y AX + AY ; (ii α(ax (αax A(αX for every scalar α Let A (a ij m n, B (b ij n p, C (c ij p q Then: (iii (ABC A(BC; (iv I m A AI n A Proof (i Let C A + B Then C (c ij m n with c ij a ij + b ij We have that (A + BX CX is an m p matrix, with (i, j-entry n k1 c ikx kj c i1 x 1j + c i2 x 2j + + c in x nj (a i1 + b i1 x 1j + (a i2 + b i2 x 2j + + (a in + b in x nj (a i1 x 1j + a i2 x 2j + + a in x nj + (b i1 x 1j + b i2 x 2j + b in x nj ((i, j entry of AX + ((i, j entry of BX Since, in addition, AX + BX has the same size, m p, as (A + BX, we conclude that (A + BX AX + BX The proof that A(X + Y AX + AY is similar, and is left as an exercise, as is the proof of (ii (iii Let AB X, where X (x ij m p and let BC Y, where Y (y ij n q The (ABC XC is an m q matrix with (i, j-entry x i1 c 1j + x i2 c 2j + + x ip c pj But x i1 a i1 b 11 + a i2 b 21 + + a in b n1 x i2 a i1 b 12 + a i2 b 22 + + a in b n2 x ip a i1 b 1p + a i2 b 2p + + a in b np 54
Thus the (i, j-entry of (ABC is (a i1 b 11 + a i2 b 21 + + a in b n1 c 1j + (a i1 b 12 + a i2 b 22 + + a in b n2 c 2j + + (a i1 b 1p + a i2 b 2p + + a in b np c pj p n (a ir b rs c sj s1 r1 that is to say the sum of all terms (a ir b rs c sj as r varies over 1, 2,, n and s varies over 1, 2,, p A similar calculation shows that the (i, j-entry of the m q matrix AY A(BC is n p a ir (b rs c sj r1 s1 But by the associative law for multiplying real numbers (a ir b rs c sj a ir (b rs c sj for all i, j, r, s Thus (ABC and A(BC are both m q matrices and their (ij-entries are the same for all possible i, j Hence (ABC A(BC Note Since (ABC A(BC we can just write ABC for this product (iv We prove that I m A A, and leave the proof that AI n A as an exercise I m is an m m matrix and so I m A is an m n matrix The ith row of I m has zero entries everywhere except for the (i, i-entry, which is 1 Thus I m A has (i, j-entry 0a 1j + + 0a i 1,j + 1a ij + 0a i+1,j + + 0a mj a ij Example Let A ( 1 2 3 4 ( 1 1, B 0 1 ( 1 1, C 2 3 We compute (ABC and A(BC and check that they are the same: (( ( ( 1 2 1 1 1 1 (ABC 3 4 0 1 2 3 ( ( ( 1 1 1 1 1 2 ; 3 1 2 3 1 0 ( (( ( 1 2 1 1 1 1 A(BC 3 4 0 1 2 3 ( ( ( 1 1 3 4 1 2 3 4 2 3 1 0 55
77 Some useful notation For an n n matrix A we write A 2 for AA, A 3 for AAA, and so on For m n matrices B and C we write B C for B + ( C 78 Inverses of matrices Every non-zero real number α has a multiplicative inverse, that is, if 0 α R there exists β R such that αβ βα 1 What about matrices? Definition An n n matrix A is said to be invertible if there is some n n matrix B such that AB BA I n Example 1 ( ( ( 2 3 2 3 1 0 I 1 2 1 2 0 1 2 ( ( ( 2 3 2 3 1 0 I 1 2 1 2 0 1 2 ( ( 2 3 2 3 Thus A is invertible (and so is B by the same calculation 1 2 1 2 ( 1 2 Example 2 is not invertible, because no matter what entries we take for the ( 0 0 p q matrix B we get r s ( 1 2 0 0 ( p + 2r q + 2s B 0 0 I 2 Theorem 74 Let A be an n n matrix and let B, C be n n matrices such that AB BA I n and AC CA I n Then B C Proof B BI n B(AC (BAC I n C C Definition If A is an invertible n n matrix then the unique matrix B such that AB BA I n is called the inverse of A We denote the inverse of A by A 1 Note If A is invertible, then AA 1 A 1 A I n, and so by the definitions of invertible and inverse, we see that A 1 is invertible and (A 1 1 A Theorem 75 If A, B are invertible n n matrices then AB is invertible, and (AB 1 B 1 A 1 56
Proof and AB(B 1 A 1 A(BB 1 A 1 AI n A 1 AA 1 I n (B 1 A 1 AB B 1 (A 1 AB B 1 I n B B 1 B I n 57