Lec 17: Inverse of a matrix and Cramers rule We are aware of algorithms that allow to solve linear systems
and invert a matrix. It turns out that determinants make possible to nd those by explicit formulas. For instance, if A is an n n invertible matrix, then A11 A21 An1 1 A12 A22 An2 A1 = (1) . . . ... . det(A) . . . A1n A2n Ann Note that the (i, j ) entry of matrix (1) is the cofactor Aji (not Aij !). In fact the entry Aji 1 is det( as we multiply the matrix by det( . [We can divide by det(A) since it is not 0 A) A) for an invertible matrix.] Curiously, in spite of the simple form, formula (1) is hardly applicable for nding A1 when n is large. This is because computing det(A) and the cofactors requires too much time for such n. Notice that det(A) can be found as soon as we know the cofactors, because of the cofactor expansion formula. Example. Find the inverse, if it exists, for 0 1 2 3 1 . A = 2 4 0 1 We have: A11 = 3 1 = 3, 0 1 A12 = 2 1 = 2, 4 1 A13 = 2 3 = 12. 4 0
Find the determinant by the expansion along the rst row: det(A) = a11 A11 + a12 A12 + a13 A13 = 0 3 + 1 (2) + 2 (12) = 26. Since det(A) = 0, we conclude that A is invertible, and we can continue computing cofactors1 : A21 = A31 = 1 2 = 1, 0 1 A22 = 0 2 = 8, 4 1 A23 = A33 = 0 1 = 4, 4 0 0 1 = 2. 2 3
1 2 = 7, 3 1
A32 =
0 2 = 4, 2 1
By formula (1) A1 3 1 7 3 1 7 26 26 26 1 4 2 1 = 2 8 4 = 13 . 13 13 26 6 2 1 12 4 2 13 13 13
The method of nding A1 using the augmented matrix [A|I3 ] seems to be faster for the previous example. It worth mentioning that in case of 2 2 matrix A formula (1) is especially simple: If A =
1
a b c d
and det(A) = ad bc = 0, then A1 =
1 d b . a ad bc c
If the determinant were 0, we would stop here and say that A is singular (there is no need to nd rest cofactors).
Make sure that AA1 = I2 (thus you will prove formula (1) for the case n = 2). For example, 1 3 1 3 1 2 1 1 2 2 . = = 2 4 3 2 1 2 4 Now describe the Cramers rule for solving linear systems Ax = b. It is assumed that A is a square matrix and det(A) = 0 (or, what is the same, A is invertible). Then, as we know, the linear system has a unique solution. The rule says that this solution is given by the formula x1 = det(A1 ) , det(A) x2 = det(A2 ) , det(A) ..., xn = det(An ) , det(A) (2)
where Ai is the matrix obtained from A by replacing the ith column of A by b. [Dont confuse with cofactors Aij !] Example. Solve the linear system 3x1 + x2 2x3 = 4 x1 + 2x2 + 3x3 = 1 2x1 + x2 + 4x3 = 2. We have (check all calculations!) 3 det(A) = 1 2 1 2 2 3 = 35 1 4
Since det(A) = 0, we can use the Cramers rule. Lets nd determinants of A1 , A2 , A3 : 4 det(A1 ) = 1 2 1 2 3 4 2 3 2 3 = 0, det(A2 ) = 1 1 3 = 70, det(A3 ) = 1 1 4 2 2 4 2 1 4 2 1 = 35. 1 2
Now by formula (2): x1 = 0 = 0, 35 x2 = 70 = 2, 35 x3 = 35 = 1. 35
Thus 0, 2, 1 is the solution to our system. As before, in case of the linear system with two equations and two variables the solution is particularly simple. Consider the system ax + by = e cx + dy = f with unknowns x and y . If ad bc = 0, then by Cramers rule x= de bf , ad bc y= af ce . ad bc
Make sure that these satisfy to the above system (thus you will prove Cramers rule for 2 2 case). For example, the system x + 3y = 0 2x + 7y = 1 has the solution x = 3 = 3, y = 1
1 1
= 1. 2