How to find the inverse of a matrix

What is the inverse of a matrix?

Let A be a n \times n matrix. We define the inverse matrix of A if there exists a n \times n matrix B such that AB = I = BA. Then we write the inverse B of A as A^{-1}. We also say that A is invertible if an inverse matrix of A exists. Note that not every matrix has an inverse.

Theorem 1. Let A be n \times n matrix. The matrix A has an inverse if and only if it has n pivots.

This theorem is possible the easiest one. It is also quite clear why the matrix needs n pivots. Take the assumption that this is not true. Then we have at least one zero row, without loss of generality, and take the last row as the zero row. Then it implies that multiplying two matrices will also contain at least one zero row. That is in contradiction with the definition of an inverse because we need AA^{-1} = A^{-1}A = I. Another way to check if the matrix A has an inverse is by checking its determinant.

Theorem 2. Let A be n \times n matrix. A has an inverse if and only if \det(A) \neq 0. Few notes to end this part. Let A be an invertible matrix. A has only one inverse (so it is unique). Let \vec{x},\vec{b} \in V, where V is a vector space, and A\vec{x} = \vec{b}. Then A\vec{x} = \vec{b} if and only if \vec{x} = A^{-1}\vec{b}.

The Gauss-Jordan Method

The Gauss-Jordan Method is the same as Gaus elimination, but then finding the inverse of that specific matrix. To perform the Gaus-Jordan, we need to follow the next steps: Algorithm. Algorithm to find the inverse:
  1. Put the A in an n \times 2n block matrix [A | I].
  2. Now perform the Gaus elimination till you get [I | A^{-1}]. If that fails, then A has no inverse as it doesn’t have n pivots.
We will end this by giving an example of performing the Gauss-Jordan Method. [A | I] =
\begin{bmatrix}\begin{array}{cc|cc}
1 & 2 &  1 & 0 \\
2 & 1 &  0 & 1
\end{array}
\end{bmatrix}
\sim
\begin{bmatrix}\begin{array}{cc|cc}
1 & 2 &  1 & 0 \\
0 & 3 &  2 & -1
\end{array}
\end{bmatrix}
\sim
\begin{bmatrix}\begin{array}{cc|cc}
1 & 2 &  1 & 0 \\
0 & 1 &  \frac{2}{3} & -\frac{1}{3}
\end{array}
\end{bmatrix}
\sim
\begin{bmatrix}\begin{array}{cc|cc}
1 & 0 &  -\frac{1}{3} & \frac{2}{3} \\
0 & 1 &  \frac{2}{3} & -\frac{1}{3}
\end{array}
\end{bmatrix}
= [I | A^{-1}]

When matrices are getting bigger, mistakes can be easily made. But after the calculation with the Gauss-Jordan method, the reader can check if the answer is correct by applying AA^{-1} = A^{-1}A = I. There is a more simple way to find the inverse matrix by using minors, cofactors, and adjugate.