What Does It Mean to Undo a Matrix?
For a real number \(a\ne0\), multiplication by \(a\) can be undone by multiplication by \(1/a\). A square matrix may or may not have a matrix that undoes its action in the same way. The key requirement is that multiplication in either order returns the identity matrix. Checking both orders matters: matrix multiplication is generally not commutative, so the order of the factors cannot be changed without justification.
Throughout this tutorial, \(\mathbf{A}\) and \(\mathbf{B}\) are \(n\times n\) real matrices, where \(n\ge1\), and \(\mathbf{I}_n\) is the \(n\times n\) identity matrix. The identity satisfies \(\mathbf{I}_n\mathbf{A}=\mathbf{A}\mathbf{I}_n=\mathbf{A}\) for every such \(\mathbf{A}\).
The equations in the definition are separate conditions: \(\mathbf{A}\mathbf{B}=\mathbf{I}_n\) checks one multiplication order, and \(\mathbf{B}\mathbf{A}=\mathbf{I}_n\) checks the other. In the examples below, each proposed inverse will be tested using both products. For a diagonal matrix with nonzero diagonal entries, the inverse is obtained by taking the reciprocal of each diagonal entry; this special pattern does not mean that general matrix inverses are computed entry by entry.
Checking a Two-Sided Inverse
Worked Example: A Two-by-Two Inverse
Consider \(\mathbf{A}=\begin{bmatrix}2&1\\5&3\end{bmatrix}\) and the proposed inverse \(\mathbf{B}=\begin{bmatrix}3&-1\\-5&2\end{bmatrix}\). Compute both products.
First multiply \(\mathbf{A}\mathbf{B}\). Each entry is a row-column product:
Now reverse the order:
Thus \(\mathbf{B}\) satisfies both defining equations, so it is a two-sided inverse of \(\mathbf{A}\).
This example illustrates the practical standard for checking a proposed inverse: compute the products, do not infer that the candidate works from its appearance. A product equal to \(\mathbf{I}_n\) in just one order is not, by itself, the definition given here.
Worked Example: A Diagonal Matrix
Let \(\mathbf{D}=\begin{bmatrix}2&0&0\\0&-3&0\\0&0&4\end{bmatrix}\). A natural candidate is \(\mathbf{E}=\begin{bmatrix}\tfrac12&0&0\\0&-\tfrac13&0\\0&0&\tfrac14\end{bmatrix}\), since each nonzero diagonal entry has been replaced by its reciprocal. Verify both orders.
For \(\mathbf{D}\mathbf{E}\), the diagonal entries are \(2(\tfrac12)=1\), \((-3)(-\tfrac13)=1\), and \(4(\tfrac14)=1\). All off-diagonal entries are zero because both matrices are diagonal. Therefore
For \(\mathbf{E}\mathbf{D}\), the diagonal entries are \((\tfrac12)2=1\), \((-\tfrac13)(-3)=1\), and \((\tfrac14)4=1\), with all off-diagonal entries again zero. Hence
Both equations hold, so \(\mathbf{D}\) is invertible and \(\mathbf{E}\) is a two-sided inverse.
Recognizing Singular Matrices
To establish that a matrix is singular, it is enough to show that no candidate can satisfy the defining equations. A useful situation is a matrix whose rows repeat information: multiplying it on the right combines its rows in the same way, which may prevent the product from being the identity.
Worked Example: A Matrix with Dependent Rows
Show that \(\mathbf{A}=\begin{bmatrix}1&2\\2&4\end{bmatrix}\) is singular. Suppose, for contradiction, that some \(2\times2\) matrix \(\mathbf{B}\) satisfies \(\mathbf{A}\mathbf{B}=\mathbf{I}_2\). The second row of \(\mathbf{A}\) is twice the first row. In a right product, each row of \(\mathbf{A}\) is multiplied by the same \(\mathbf{B}\), so the second row of \(\mathbf{A}\mathbf{B}\) must be twice its first row.
But the rows of \(\mathbf{I}_2=\begin{bmatrix}1&0\\0&1\end{bmatrix}\) do not satisfy that relation: its second row \((0,1)\) is not twice its first row \((1,0)\), since \(2(1,0)=(2,0)\ne(0,1)\). This contradicts \(\mathbf{A}\mathbf{B}=\mathbf{I}_2\). There can therefore be no two-sided inverse, and \(\mathbf{A}\) is singular.
Check: the obstruction holds for every possible \(\mathbf{B}\), not merely for one proposed candidate. The row relation forces every product \(\mathbf{A}\mathbf{B}\) to have its second row twice its first, whereas the identity does not.
A zero row gives another immediate obstruction. If a square matrix has a row consisting entirely of zeros, the corresponding row in its product with any matrix on the right is also zero. Since the identity has no zero row, that matrix cannot have a right product equal to the identity and therefore cannot have a two-sided inverse. This is a direct consequence of matrix multiplication and the definition, not a separate test that applies to all singular matrices.
Basic Rules for Inverses
Some inverse facts follow directly from the defining equations. The proofs below use only matrix multiplication, the identity laws, and the transpose product law \((\mathbf{A}\mathbf{B})^{\top}=\mathbf{B}^{\top}\mathbf{A}^{\top}\).
Proof. By the identity laws, \(\mathbf{I}_n\mathbf{I}_n=\mathbf{I}_n\) and \(\mathbf{I}_n\mathbf{I}_n=\mathbf{I}_n\) in the reverse order as well. Thus \(\mathbf{I}_n\) satisfies both equations required for a two-sided inverse of itself. \(\square\)
Proof. Assume \(\mathbf{A}\mathbf{B}=\mathbf{B}\mathbf{A}=\mathbf{I}_n\). Taking transposes and using the transpose product law gives \((\mathbf{A}\mathbf{B})^{\top}=\mathbf{B}^{\top}\mathbf{A}^{\top}=\mathbf{I}_n^{\top}=\mathbf{I}_n\) and \((\mathbf{B}\mathbf{A})^{\top}=\mathbf{A}^{\top}\mathbf{B}^{\top}=\mathbf{I}_n^{\top}=\mathbf{I}_n\). These are precisely the two equations showing that \(\mathbf{B}^{\top}\) is a two-sided inverse of \(\mathbf{A}^{\top}\). \(\square\)
Proof. The assumptions give \(\mathbf{A}\mathbf{B}=\mathbf{B}\mathbf{A}=\mathbf{I}_n\) and \(\mathbf{C}\mathbf{D}=\mathbf{D}\mathbf{C}=\mathbf{I}_n\). For the product in one order, associativity gives \((\mathbf{A}\mathbf{C})(\mathbf{D}\mathbf{B})=\mathbf{A}(\mathbf{C}\mathbf{D})\mathbf{B}=\mathbf{A}\mathbf{I}_n\mathbf{B}=\mathbf{A}\mathbf{B}=\mathbf{I}_n\). For the reverse order, \((\mathbf{D}\mathbf{B})(\mathbf{A}\mathbf{C})=\mathbf{D}(\mathbf{B}\mathbf{A})\mathbf{C}=\mathbf{D}\mathbf{I}_n\mathbf{C}=\mathbf{D}\mathbf{C}=\mathbf{I}_n\). Thus \(\mathbf{D}\mathbf{B}\) is a two-sided inverse of \(\mathbf{A}\mathbf{C}\). \(\square\)
The product rule reverses the order: the inverse of \(\mathbf{A}\mathbf{C}\) is formed by first using the inverse of \(\mathbf{C}\), then the inverse of \(\mathbf{A}\). This reversal is necessary because multiplying the two inverse factors in the original order would not produce the cancellations shown in the proof.
Worked Example: Applying the Product Rule
Let \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\) and \(\mathbf{C}=\begin{bmatrix}2&0\\0&1\end{bmatrix}\). Their respective two-sided inverses are \(\mathbf{B}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\) and \(\mathbf{D}=\begin{bmatrix}\tfrac12&0\\0&1\end{bmatrix}\). For \(\mathbf{A}\mathbf{B}\) and \(\mathbf{B}\mathbf{A}\), direct multiplication gives \(\begin{bmatrix}1&0\\0&1\end{bmatrix}\) in each order; for \(\mathbf{C}\mathbf{D}\) and \(\mathbf{D}\mathbf{C}\), multiplying the diagonal entries gives \(\mathbf{I}_2\) in each order.
First calculate the matrix product:
The product rule proposes \(\mathbf{D}\mathbf{B}\), not \(\mathbf{B}\mathbf{D}\). Compute it:
Check the first order:
Check the reverse order:
Both products are the identity, confirming the proposed inverse and the reversed order in the product rule.
Common Pitfall: Inverting Entries Separately
A matrix inverse is not formed by taking the reciprocal of each entry. For example, take \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\). A tempting but incorrect guess is that the inverse has the same entries. Multiplying that guess by \(\mathbf{A}\) gives
The correction is \(\mathbf{B}=\begin{bmatrix}1&-1\\0&1\end{bmatrix}\). Indeed, multiplying in either order gives
The diagonal example worked because diagonal multiplication acts separately on corresponding diagonal entries. Outside that special pattern, matrix multiplication mixes entries by row-column sums, so inverse candidates must be checked with the full products.
Why Invertibility Matters
If \(\mathbf{A}\) has a two-sided inverse and a vector \(\mathbf{x}\) satisfies \(\mathbf{A}\mathbf{x}=\mathbf{b}\), multiplying the equation on the left by \(\mathbf{A}^{-1}\) yields \(\mathbf{x}=\mathbf{A}^{-1}\mathbf{b}\). This explains why inverses are useful for matrix equations: they provide an explicit way to undo multiplication by \(\mathbf{A}\). The definition also makes the limitation precise. A singular matrix has no two-sided inverse, so this method of undoing its multiplication is unavailable.
Keep the central checks distinct. A matrix is invertible when a square matrix \(\mathbf{B}\) satisfies both \(\mathbf{A}\mathbf{B}=\mathbf{I}_n\) and \(\mathbf{B}\mathbf{A}=\mathbf{I}_n\). A matrix is singular when no such \(\mathbf{B}\) exists. Proposed inverses are verified by multiplication, while noninvertibility can be proved by showing that a necessary identity product is impossible.
Check Your Understanding
For each question, use the two-sided definition and show the relevant matrix products or obstruction.
- Verify whether \(\begin{bmatrix}1&2\\3&7\end{bmatrix}\) and \(\begin{bmatrix}7&-2\\-3&1\end{bmatrix}\) are two-sided inverses.
- Find a two-sided inverse of \(\begin{bmatrix}-2&0\\0&5\end{bmatrix}\), then check both multiplication orders.
- Explain why \(\begin{bmatrix}1&0\\0&0\end{bmatrix}\) is singular.
- If \(\mathbf{A}\) and \(\mathbf{C}\) are invertible with inverses \(\mathbf{B}\) and \(\mathbf{D}\), respectively, state a two-sided inverse of \(\mathbf{A}\mathbf{C}\).
- For \(\mathbf{A}=\begin{bmatrix}1&1\\0&1\end{bmatrix}\), show why using \(\mathbf{A}\) itself as its inverse fails, and verify the corrected inverse \(\begin{bmatrix}1&-1\\0&1\end{bmatrix}\).