Cramer’s Rule and Inverse Matrices
Suppose that we need to solve the n×n linear system
where
A=[aij],x=⎡⎣⎢⎢⎢⎢x1x2⋮xn⎤⎦⎥⎥⎥⎥andB=⎡⎣⎢⎢⎢⎢b1b2⋮bn⎤⎦⎥⎥⎥⎥.
(19)
We assume that the coefficient matrix A is invertible, so we know in advance that a unique solution x of (18) exists. The question is how to write x explicitly in terms of the coefficients aij and the constants bi. In the following discussion, we think of x as a fixed (though as yet unknown) vector.
If we denote by a1,a2,…,an the column vectors of the n×n matrix A, then
A=[a1a2⋯an].
(20)
By Fact 1 in Section 3.5, we can rewrite Eq. (18) as
Thus the constant vector b is expressed in terms of the entries x1,x2,…,xn of the solution vector x and the column vectors of A by
b=∑j=1nxjaj.
(21)
The trick for finding the ith unknown xi is to compute the determinant of the matrix
[a1⋯b⋯an]=⎡⎣⎢⎢⎢⎢⎢a11a21⋮an1⋯⋯⋱⋯b1b2⋮bn⋯⋯⋱⋯a1na2n⋮ann⎤⎦⎥⎥⎥⎥⎥
(22)
that we obtain by replacing the ith column ai of A with the constant vector b. Using
Eq. (21) to substitute for b, we find that
Note that, in the jth term of this summation, the vector aj appears in the ith position. Thus we have found that
Of the n determinants on the right-hand side here, all but the ith one have two identical columns and therefore are equal to zero. The coefficient of xi in the ith term is simply
Consequently, a result of our computation is that
|a1⋯b⋯an|=xi|A|.
(23)
We get the desired simple formula for xi after we divide each side by |A|≠0.