Tutorials › Linear Algebra › The Augmented-Matrix Algorithm for A Inverse

Elementary Matrices and Inverses · Tutorial 91 of 1000

The Augmented-Matrix Algorithm for A Inverse

Use one sequence of row operations on an augmented matrix to find an inverse, and understand why the method works.

Beginner 10 min read

What You'll Learn

  • Set up the augmented matrix for a square matrix and the identity
  • Explain why each row operation must be applied to both blocks
  • Prove that reaching the left identity produces the inverse
  • Understand why an invertible matrix can be reduced to the left identity
  • Check a computed inverse by multiplying it by the original matrix

Why Augment a Matrix with the Identity?

Finding an inverse by solving for its entries would require several simultaneous equations. Row reduction gives a more direct method: begin with a square matrix beside the identity matrix, then apply the same row operations to both. If the left block becomes the identity, the right block is the inverse. The reason this works is that the row operations transform the left block by multiplication, and the same multiplication transforms the identity into exactly the matrix needed to undo the original one.

Throughout, matrices and scalars are over \(\mathbb{R}\). Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\). The identity matrix \(\mathbf{I}_n\) has ones on its diagonal and zeros elsewhere. An inverse of \(\mathbf{A}\) is a matrix \(\mathbf{B}\) satisfying both \(\mathbf{A}\mathbf{B}=\mathbf{I}_n\) and \(\mathbf{B}\mathbf{A}=\mathbf{I}_n\); if it exists, it is written \(\mathbf{A}^{-1}\).

Definition: The augmented matrix for \(\mathbf{A}\) is \([\mathbf{A}\mid\mathbf{I}_n]\), the matrix formed by placing \(\mathbf{A}\) and \(\mathbf{I}_n\) side by side. Each row operation is performed across the entire augmented matrix, including both blocks.

Row operations on a matrix are left multiplication by elementary matrices. An elementary matrix is obtained by applying one row operation to an identity matrix. Each elementary matrix is invertible: its inverse performs the reverse row operation. Thus, if a sequence of row operations has corresponding elementary matrices \(\mathbf{E}_1,\dots,\mathbf{E}_k\), the result of applying that sequence to a matrix \(\mathbf{M}\) is \(\mathbf{E}_k\cdots\mathbf{E}_1\mathbf{M}\). The order matters: the first operation is represented by the rightmost factor.

The Algorithm and Why It Works

1
Set up the augmented matrix.
Write \([\mathbf{A}\mid\mathbf{I}_n]\). The matrix must be square to place an identity matrix of the same size beside it.
2
Row-reduce both blocks together.
Use elementary row operations to reduce the left block. Never apply an operation to only one block.
3
Read the result if the left block is the identity.
If the result is \([\mathbf{I}_n\mid\mathbf{B}]\), then \(\mathbf{B}\) is the inverse of \(\mathbf{A}\).
Theorem (Augmented-matrix inverse algorithm): Let \(\mathbf{A}\in\mathbb{R}^{n\times n}\). The matrix \(\mathbf{A}\) is invertible if and only if row operations reduce \([\mathbf{A}\mid\mathbf{I}_n]\) to \([\mathbf{I}_n\mid\mathbf{B}]\) for some matrix \(\mathbf{B}\). Whenever this occurs, \(\mathbf{B}=\mathbf{A}^{-1}\).

Proof. Suppose first that row operations reduce the augmented matrix to \([\mathbf{I}_n\mid\mathbf{B}]\). Let \(\mathbf{E}_1,\dots,\mathbf{E}_k\) be the elementary matrices for these operations, in order, and put \(\mathbf{E}=\mathbf{E}_k\cdots\mathbf{E}_1\). Applying the operations to both blocks gives \(\mathbf{E}\mathbf{A}=\mathbf{I}_n\) and \(\mathbf{E}\mathbf{I}_n=\mathbf{B}\), so \(\mathbf{E}=\mathbf{B}\). Each elementary matrix is invertible, and their product is invertible: reversing the order and inverting each factor gives an inverse for \(\mathbf{E}\). From \(\mathbf{E}\mathbf{A}=\mathbf{I}_n\), multiplication on the left by \(\mathbf{E}^{-1}\) gives \(\mathbf{A}=\mathbf{E}^{-1}\). Therefore \(\mathbf{A}\mathbf{E}=\mathbf{I}_n\) as well as \(\mathbf{E}\mathbf{A}=\mathbf{I}_n\). Hence \(\mathbf{E}=\mathbf{A}^{-1}\), and \(\mathbf{B}=\mathbf{A}^{-1}\).

Conversely, suppose \(\mathbf{A}\) is invertible. Row-reduce \(\mathbf{A}\) to reduced row echelon form using elementary row operations, and let \(\mathbf{E}\) be the product of their elementary matrices. The resulting matrix is \(\mathbf{R}=\mathbf{E}\mathbf{A}\). The matrix \(\mathbf{R}\) is invertible: an inverse is \(\mathbf{A}^{-1}\mathbf{E}^{-1}\), since multiplication on either side gives the identity. Thus \(\mathbf{R}\) cannot have a zero row. If it did, multiplying \(\mathbf{R}\) by any matrix would leave the corresponding row zero, so \(\mathbf{R}\) could not have an inverse. In reduced row echelon form, each nonzero row has a pivot, and distinct rows have pivots in distinct columns. Since \(\mathbf{R}\) has \(n\) nonzero rows and \(n\) columns, every column is a pivot column. The reduced row echelon form is therefore \(\mathbf{I}_n\). Applying the same operations to \([\mathbf{A}\mid\mathbf{I}_n]\) now gives \([\mathbf{I}_n\mid\mathbf{E}]\), and the first part of the proof shows that \(\mathbf{E}=\mathbf{A}^{-1}\). \(\square\)

This proof identifies the key reason for augmenting: after the row operations, the left block is \(\mathbf{E}\mathbf{A}\), while the right block is \(\mathbf{E}\mathbf{I}_n=\mathbf{E}\). When the left block becomes the identity, \(\mathbf{E}\mathbf{A}=\mathbf{I}_n\), so \(\mathbf{E}\) undoes \(\mathbf{A}\). The right block records that undoing matrix.

Applying the Algorithm

Worked Example: A Triangular Matrix

Find the inverse of \(\mathbf{A}=\begin{bmatrix}1&1&0\\0&1&1\\0&0&1\end{bmatrix}\) using the augmented-matrix algorithm.

Start with \([\mathbf{A}\mid\mathbf{I}_3]\). First replace row 2 by row 2 minus row 3. Then replace row 1 by row 1 minus the new row 2:

$$ \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&1&1&0&1&0\\ 0&0&1&0&0&1 \end{array} \right] \mathop{\sim}^{R_2\to R_2-R_3} \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&1&0&0&1&-1\\ 0&0&1&0&0&1 \end{array} \right] \mathop{\sim}^{R_1\to R_1-R_2} \left[ \begin{array}{ccc|ccc} 1&0&0&1&-1&1\\ 0&1&0&0&1&-1\\ 0&0&1&0&0&1 \end{array} \right]. $$

The left block is \(\mathbf{I}_3\), so the right block is \(\mathbf{A}^{-1}=\begin{bmatrix}1&-1&1\\0&1&-1\\0&0&1\end{bmatrix}\). Check by multiplying:

$$ \mathbf{A}\mathbf{A}^{-1} = \begin{bmatrix} 1&-1+1&1-1\\ 0&1&-1+1\\ 0&0&1 \end{bmatrix} = \mathbf{I}_3. $$

For the other order, the rows of \(\mathbf{A}^{-1}\) are \((1,-1,1)\), \((0,1,-1)\), and \((0,0,1)\). Multiplying by \(\mathbf{A}\) gives rows \((1,0,0)\), \((0,1,0)\), and \((0,0,1)\), so \(\mathbf{A}^{-1}\mathbf{A}=\mathbf{I}_3\) as required.

Worked Example: A Lower-Triangular Matrix

Use the algorithm to find the inverse of \(\mathbf{A}=\begin{bmatrix}1&0&0\\2&1&0\\1&3&1\end{bmatrix}\).

Subtract twice row 1 from row 2, subtract row 1 from row 3, and then subtract three times the new row 2 from row 3:

$$ \left[ \begin{array}{ccc|ccc} 1&0&0&1&0&0\\ 2&1&0&0&1&0\\ 1&3&1&0&0&1 \end{array} \right] \mathop{\sim}^{R_2\to R_2-2R_1} \left[ \begin{array}{ccc|ccc} 1&0&0&1&0&0\\ 0&1&0&-2&1&0\\ 1&3&1&0&0&1 \end{array} \right] $$
$$ \mathop{\sim}^{R_3\to R_3-R_1} \left[ \begin{array}{ccc|ccc} 1&0&0&1&0&0\\ 0&1&0&-2&1&0\\ 0&3&1&-1&0&1 \end{array} \right] \mathop{\sim}^{R_3\to R_3-3R_2} \left[ \begin{array}{ccc|ccc} 1&0&0&1&0&0\\ 0&1&0&-2&1&0\\ 0&0&1&5&-3&1 \end{array} \right]. $$

Thus \(\mathbf{A}^{-1}=\begin{bmatrix}1&0&0\\-2&1&0\\5&-3&1\end{bmatrix}\). To check the product, multiply each row of \(\mathbf{A}\) by \(\mathbf{A}^{-1}\). The first row gives \((1,0,0)\); the second gives \(2(1,0,0)+(-2,1,0)=(0,1,0)\); the third gives \((1,0,0)+3(-2,1,0)+(5,-3,1)=(0,0,1)\). Hence \(\mathbf{A}\mathbf{A}^{-1}=\mathbf{I}_3\). In the reverse order, the rows of \(\mathbf{A}^{-1}\mathbf{A}\) are row 1 of \(\mathbf{A}\), row 2 minus twice row 1 of \(\mathbf{A}\), and five times row 1 minus three times row 2 plus row 3 of \(\mathbf{A}\); these are \((1,0,0)\), \((0,1,0)\), and \((0,0,1)\). So \(\mathbf{A}^{-1}\mathbf{A}=\mathbf{I}_3\) too.

Worked Example: A Matrix with Nonzero Entries Above and Below the Diagonal

Find the inverse of \(\mathbf{A}=\begin{bmatrix}1&1&0\\1&0&1\\0&1&1\end{bmatrix}\). Apply \(R_2\to R_2-R_1\), then \(R_2\to -R_2\), and \(R_3\to R_3-R_2\), using the updated row 2 in the last operation:

$$ \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 1&0&1&0&1&0\\ 0&1&1&0&0&1 \end{array} \right] \mathop{\sim}^{R_2\to R_2-R_1} \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&-1&1&-1&1&0\\ 0&1&1&0&0&1 \end{array} \right] $$
$$ \mathop{\sim}^{R_2\to -R_2} \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&1&-1&1&-1&0\\ 0&1&1&0&0&1 \end{array} \right] \mathop{\sim}^{R_3\to R_3-R_2} \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&1&-1&1&-1&0\\ 0&0&2&-1&1&1 \end{array} \right]. $$

Scale row 3 by \(\tfrac12\), add row 3 to row 2 to clear its third entry, and subtract the updated row 2 from row 1:

$$ \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&1&-1&1&-1&0\\ 0&0&2&-1&1&1 \end{array} \right] \mathop{\sim}^{R_3\to \frac12R_3} \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&1&-1&1&-1&0\\ 0&0&1&-\frac12&\frac12&\frac12 \end{array} \right] $$
$$ \mathop{\sim}^{R_2\to R_2+R_3} \left[ \begin{array}{ccc|ccc} 1&1&0&1&0&0\\ 0&1&0&\frac12&-\frac12&\frac12\\ 0&0&1&-\frac12&\frac12&\frac12 \end{array} \right] \mathop{\sim}^{R_1\to R_1-R_2} \left[ \begin{array}{ccc|ccc} 1&0&0&\frac12&\frac12&-\frac12\\ 0&1&0&\frac12&-\frac12&\frac12\\ 0&0&1&-\frac12&\frac12&\frac12 \end{array} \right]. $$

The right block is the candidate inverse. To check it, denote its rows by \(\mathbf{r}_1,\mathbf{r}_2,\mathbf{r}_3\). The rows of \(\mathbf{A}\mathbf{A}^{-1}\) are \(\mathbf{r}_1+\mathbf{r}_2=(1,0,0)\), \(\mathbf{r}_1+\mathbf{r}_3=(0,1,0)\), and \(\mathbf{r}_2+\mathbf{r}_3=(0,0,1)\). Therefore \(\mathbf{A}\mathbf{A}^{-1}=\mathbf{I}_3\). The inverse is symmetric, and \(\mathbf{A}\) is symmetric, so transposing this equality gives \(\mathbf{A}^{-1}\mathbf{A}=\mathbf{I}_3\) as well.

Common Pitfall: Changing Only the Left Block

Row operations must be applied to both blocks of the augmented matrix. For example, begin with \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\). The operation \(R_1\to R_1-R_2\) changes \(\mathbf{A}\) to \(\mathbf{I}_2\). If the right block is left unchanged, it is tempting to claim that \(\mathbf{I}_2\) is the inverse. But \(\mathbf{A}\mathbf{I}_2=\mathbf{A}\ne\mathbf{I}_2\), so that answer fails the inverse check.

Applying the row operation to the full augmented matrix gives the correct calculation:

$$ \left[ \begin{array}{cc|cc} 1&1&1&0\\ 0&1&0&1 \end{array} \right] \mathop{\sim}^{R_1\to R_1-R_2} \left[ \begin{array}{cc|cc} 1&0&1&-1\\ 0&1&0&1 \end{array} \right]. $$

The right block \(\begin{bmatrix}1&-1\\0&1\end{bmatrix}\), not the identity, is the inverse. Indeed, multiplying \(\mathbf{A}\) by it gives \(\begin{bmatrix}1&-1+1\\0&1\end{bmatrix}=\mathbf{I}_2\). The error was not in the row operation on the left; it was failing to record that same operation on the right.

What the Algorithm Tells You

The augmented-matrix procedure is both a method and a test: it produces an inverse when the left block reduces to the identity, and the theorem explains why an invertible matrix can be reduced to that form. If row reduction does not produce the left identity, the theorem says the matrix is not invertible. The detailed row patterns that reveal this outcome can be studied separately; for using the algorithm, the essential rule is to continue applying valid row operations to both blocks and read the candidate inverse only when the left block is \(\mathbf{I}_n\).

Once a candidate is found, multiplication provides a direct check. In particular, a claimed inverse must satisfy both \(\mathbf{A}\mathbf{B}=\mathbf{I}_n\) and \(\mathbf{B}\mathbf{A}=\mathbf{I}_n\). The examples above checked both orders, either by calculation or by transposing a verified equality when both matrices are symmetric.

Check Your Understanding

For each question, identify the row operations or matrix facts that justify your conclusion.

  1. In the augmented-matrix algorithm, why must each row operation be applied to both \(\mathbf{A}\) and \(\mathbf{I}_n\)?
  2. If row operations transform \([\mathbf{A}\mid\mathbf{I}_n]\) into \([\mathbf{I}_n\mid\mathbf{B}]\), what equation relates the product of the elementary matrices to \(\mathbf{A}\)?
  3. Suppose \(\mathbf{E}\mathbf{A}=\mathbf{I}_n\) and \(\mathbf{E}\) is invertible. Show that \(\mathbf{E}\) is a two-sided inverse of \(\mathbf{A}\).
  4. Why can the reduced row echelon form of an invertible \(3\times3\) matrix not have a zero row?
  5. For \(\mathbf{A}=\begin{bmatrix}1&0\\2&1\end{bmatrix}\), set up \([\mathbf{A}\mid\mathbf{I}_2]\) and determine which row operation first clears the entry below the leading \(1\).

Test yourself: Linear Algebra final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon