Note that this gives an easy way to write a formula for the inverse of an n × n matrix.
Theorem 8.6.1 A^{−1} exists if and only if det(A)≠0. If det(A)≠0, then A^{−1} =

for cof
Proof: By Theorem 8.5.3 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,

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

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

This proves that if det

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

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 8.6.2 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 8.4.4 implies detB detA = 1 and so detA≠0. Therefore from Theorem 8.6.1, 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 8.6.1 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 8.6.3 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 8.5.3.
Corollary 8.6.4 Let M be an upper (lower) triangular matrix. Then det