How to Calculate the Inverse of a Matrix: A Step-by-Step Guide

Part 1: The Tools – Elementary Row Operations
In our previous post, we defined what it means for a matrix to be “invertible.” Now, we need to learn how to actually find that inverse. We can’t just divide by a matrix; instead, we use a specific set of manipulations called Elementary Row Operations.
Think of these as the “legal moves” you are allowed to make in the game of simplifying a matrix.
The Three Types of Operations
There are exactly three types of operations we can perform on the rows of a matrix \(A\):
- Type 1 (Interchange): Swap any two rows.
- Example: Swap Row 1 and Row 2.
- Type 2 (Scaling): Multiply any row by a nonzero scalar (a constant number).
- Example: Multiply all numbers in Row 1 by \(5\).
- Type 3 (Replacement): Add a scalar multiple of one row to another row.
- Example: Multiply Row 1 by \(-2\) and add the result to Row 2. (This replaces Row 2 with the new values).
A Simple Example
Let’s look at a Type 3 operation (Replacement), as this is the one used most often to eliminate numbers (make them zero).
Suppose we have this matrix:
$$
A = \begin{pmatrix} 1 & 2 \\ 3 & 8 \end{pmatrix}
$$
We want to turn the \(3\) in the second row into a \(0\). We can use Type 3: Multiply Row 1 by \(-3\) and add it to Row 2.
- Operation: \(R_2 = R_2 + (-3)R_1\)
- Calculation:
- New Entry 1: \(3 + (-3)(1) = 0\)
- New Entry 2: \(8 + (-3)(2) = 8 – 6 = 2\)
The matrix becomes:
$$
\begin{pmatrix} 1 & 2 \\ 0 & 2 \end{pmatrix}
$$
Part 2: The Augmented Matrix & The Algorithm
Now that we have our tools (row operations), we need a workspace. That workspace is called the Augmented Matrix.
What is an Augmented Matrix?
In linear algebra, we often need to manipulate two matrices at the same time.
Definition: Let \(A\) and \(B\) be matrices with the same number of rows (\(m \times n\) and \(m \times p\)). The augmented matrix denoted as \((A|B)\) is simply the matrix formed by placing \(A\) and \(B\) side-by-side.
- The first \(n\) columns come from \(A\).
- The last \(p\) columns come from \(B\).
Usefulness: The Inverse Algorithm
The most powerful application of this concept is finding the inverse of a matrix.
We set up an augmented matrix where \(A\) is on the left and the Identity matrix \(I\) is on the right: \((A|I)\).
Here is the key result:
If \(A\) is an invertible \(n \times n\) matrix, and we transform the matrix \((A|I)\) into the form \((I|B)\) using elementary row operations, then the resulting matrix \(B\) is exactly the inverse of \(A\) (i.e., \(B = A^{-1}\)).
A Simple Example: Calculating the Inverse
Let’s calculate the inverse of the matrix
$$
A = \begin{pmatrix} 1 & 1 \\ 2 & 3 \end{pmatrix}
$$
Step 1: Set up the Augmented Matrix \((A|I)\)
We place \(A\) on the left and the \(2 \times 2\) Identity matrix on the right.
$$
\left(\begin{array}{cc|cc} 1 & 1 & 1 & 0 \\ 2 & 3 & 0 & 1 \end{array}\right)
$$
Step 2: Eliminate the \(2\) in Row 2 (Targeting the Identity Form)
We want a \(0\) in the bottom-left corner. We use a Type 3 Operation: Multiply Row 1 by \(-2\) and add it to Row 2 (\(R_2 \leftarrow R_2 – 2R_1\)).
- Left side: \(2 + (-2)(1) = 0\) and \(3 + (-2)(1) = 1\).
- Right side: \(0 + (-2)(1) = -2\) and \(1 + (-2)(0) = 1\).
$$
\left(\begin{array}{cc|cc} 1 & 1 & 1 & 0 \\ 0 & 1 & -2 & 1 \end{array}\right)
$$
Step 3: Eliminate the \(1\) in Row 1
We want a \(0\) in the top-right corner. We use another Type 3 Operation: Subtract Row 2 from Row 1 (\(R_1 \leftarrow R_1 – R_2\)).
- Left side: \(1 – 0 = 1\) and \(1 – 1 = 0\). (The left side is now \(I\)!)
- Right side: \(1 – (-2) = 3\) and \(0 – 1 = -1\).
$$
\left(\begin{array}{cc|cc} 1 & 0 & 3 & -1 \\ 0 & 1 & -2 & 1 \end{array}\right)
$$
Conclusion
We have successfully transformed the left side into \(I\). Therefore, the matrix on the right is our inverse:
$$
A^{-1} = \begin{pmatrix} 3 & -1 \\ -2 & 1 \end{pmatrix}
$$