Note that this gives an easy way to write a formula for the inverse of an n×n matrix. Recall the definition of the inverse of a matrix in Definition 2.1.22 on Page 130.
Theorem 3.3.18 A^{−1} exists if and only if det(A)≠0. If det(A)≠0, then A^{−1} =

for cof
Proof: By Theorem 3.3.17 and letting

Now in the matrix A, replace the k^{th} column with the r^{th} column and then expand along the k^{th} column. This yields for k≠r,

because there are two equal columns by Corollary 3.3.9. Summarizing,

Using the other formula in Theorem 3.3.17, and similar reasoning,

This proves that if det

Now suppose A^{−1} exists. Then by Theorem 3.3.13,

so det
The next corollary points out that if an n×n matrix A has a right or a left inverse, then it has an inverse.
Corollary 3.3.19 Let A be an n × n matrix and suppose there exists an n × n matrix B such that BA = I. Then A^{−1} exists and A^{−1} = B. Also, if there exists C an n × n matrix such that AC = I, then A^{−1} exists and A^{−1} = C.
Proof: Since BA = I, Theorem 3.3.13 implies detB detA = 1 and so detA≠0. Therefore from Theorem 3.3.18, A^{−1} exists. Therefore,

The case where CA = I is handled similarly. ■
The conclusion of this corollary is that left inverses, right inverses and inverses are all the same in the context of n × n matrices.
Theorem 3.3.18 says that to find the inverse, take the transpose of the cofactor matrix and divide by the determinant. The transpose of the cofactor matrix is called the adjugate or sometimes the classical adjoint of the matrix A. It is an abomination to call it the adjoint although you do sometimes see it referred to in this way. In words, A^{−1} is equal to one over the determinant of A times the adjugate matrix of A.
In case you are solving a system of equations, Ax = y for x, it follows that if A^{−1} exists,

thus solving the system. Now in the case that A^{−1} exists, there is a formula for A^{−1} given above. Using this formula,

By the formula for the expansion of a determinant along a column,

where here the i^{th} column of A is replaced with the column vector,
Definition 3.3.20 A matrix M, is upper triangular if M_{ij} = 0 whenever i > j. Thus such a matrix equals zero below the main diagonal, the entries of the form M_{ii} as shown.

A lower triangular matrix is defined similarly as a matrix for which all entries above the main diagonal are equal to zero.
With this definition, here is a simple corollary of Theorem 3.3.17.
Corollary 3.3.21 Let M be an upper (lower) triangular matrix. Then det