Skip to main content
Mathematics LibreTexts

2.6: The Matrix Inverse

  • Page ID
    63388
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    Learning Objectives
    • T/F: If \(A\) and \(B\) are square matrices where \(AB = I\), then \(BA = I\).
    • T/F: A matrix \(A\) has exactly one inverse, infinite inverses, or no inverse.
    • T/F: Everyone is special.
    • T/F: If \(A\) is invertible, then \(A\vec{x} =\vec{0}\) has exactly \(1\) solution.
    • What is a corollary?
    • Fill in the blanks: \(\underline{\qquad}\) a matrix is invertible is useful; computing the inverse is \(\underline{\qquad}\).

    Once again we visit the old algebra equation, \(ax=b\). How do we solve for \(x\)? We know that, as long as \(a\neq 0\), \[x = \frac{b}{a}, \ \text{or, stated in another way,} \ x = a^{-1}b. \nonumber \]

    What is \(a^{-1}\)? It is the number that, when multiplied by \(a\), returns 1. That is, \[a^{-1}a = 1. \nonumber \]

    Let us now think in terms of matrices. We have learned of the identity matrix \(I\) that “acts like the number 1.” That is, if \(A\) is a square matrix, then

    \[IA=AI=A. \nonumber \]

    If we had a matrix, which we’ll call \(A^{-1}\), where \(A^{-1}A=I\), then by analogy to our algebra example above it seems like we might be able to solve the linear system \(A\vec{x}=\vec{b}\) for \(\vec{x}\) by multiplying both sides of the equation by \(A^{-1}\). That is, perhaps

    \[\vec{x}=A^{-1}\vec{b}. \nonumber \]

    Of course, there is a lot of speculation here. We don’t know that such a matrix like \(A^{-1}\) exists. However, we do know how to solve the matrix equation \(AX=B\), so we can use that technique to solve the equation \(AX=I\) for \(X\). This seems like it will get us close to what we want. Let’s practice this once and then study our results.

    Example \(\PageIndex{1}\)

    Let

    \[A=\left[\begin{array}{cc}{2}&{1}\\{1}&{1}\end{array}\right]. \nonumber \]

    Find a matrix \(X\) such that \(AX=I\).

    Solution

    We know how to solve this from the previous section: we form the proper augmented matrix, put it into reduced row echelon form and interpret the results.

    \[\left[\begin{array}{cccc}{2}&{1}&{1}&{0}\\{1}&{1}&{0}&{1}\end{array}\right]\quad\vec{\text{rref}}\quad\left[\begin{array}{cccc}{1}&{0}&{1}&{-1}\\{0}&{1}&{-1}&{2}\end{array}\right] \nonumber \]

    We read from our matrix that

    \[X=\left[\begin{array}{cc}{1}&{-1}\\{-1}&{2}\end{array}\right]. \nonumber \]

    Let’s check our work:

    \[\begin{align}\begin{aligned}AX&=\left[\begin{array}{cc}{2}&{1}\\{1}&{1}\end{array}\right]\:\left[\begin{array}{cc}{1}&{-1}\\{-1}&{2}\end{array}\right] \\ &=\left[\begin{array}{cc}{1}&{0}\\{0}&{1}\end{array}\right] \\ &=I\end{aligned}\end{align} \nonumber \]

    Sure enough, it works.

    Looking at our previous example, we are tempted to jump in and call the matrix \(X\) that we found “\(A^{-1}\).” However, there are two obstacles in the way of us doing this.

    First, we know that in general \(AB\neq BA\). So while we found that \(AX=I\), we can’t automatically assume that \(XA=I\).

    Secondly, we have seen examples of matrices where \(AB=AC\), but \(B\neq C\). So just because \(AX=I\), it is possible that another matrix \(Y\) exists where \(AY=I\). If this is the case, using the notation \(A^{-1}\) would be misleading, since it could refer to more than one matrix.

    These obstacles that we face are not insurmountable. The first obstacle was that we know that \(AX=I\) but didn’t know that \(XA=I\). That’s easy enough to check, though. Let’s look at \(A\) and \(X\) from our previous example.

    \[\begin{align}\begin{aligned}AX&=\left[\begin{array}{cc}{1}&{-1}\\{-1}&{2}\end{array}\right]\:\left[\begin{array}{cc}{2}&{1}\\{1}&{1}\end{array}\right] \\ &=\left[\begin{array}{cc}{1}&{0}\\{0}&{1}\end{array}\right] \\ &=I\end{aligned}\end{align} \nonumber \]

    Perhaps this first obstacle isn’t much of an obstacle after all. Of course, we only have one example where it worked, so this doesn’t mean that it always works. We have good news, though: it always does work. The only “bad” news to come with this is that this is a bit harder to prove. We won’t worry about proving it always works, but state formally that it does in the following theorem.

    Theorem \(\PageIndex{1}\)

    Special Commuting Matrix Products

    Let \(A\) be an \(n\times n\) matrix.

    1. If there is a matrix \(X\) such that \(AX=I_{n}\), then \(XA=I_{n}\).
    2. If there is a matrix \(X\) such that \(XA=I_{n}\), then \(AX=I_{n}\).

    The second obstacle is easier to address. We want to know if another matrix \(Y\) exists where \(AY=I=YA\). Let’s suppose that it does. Consider the expression \(XAY\). Since matrix multiplication is associative, we can group this any way we choose. We could group this as \((XA)Y\); this results in

    \[\begin{align}\begin{aligned}(XA)Y&=IY \\ &=Y. \end{aligned}\end{align} \nonumber \]

    We could also group \(XAY\) as \(X(AY)\). This tells us

    \[\begin{align}\begin{aligned}X(AY)&=XI \\ &=X\end{aligned}\end{align} \nonumber \]

    Combining the two ideas above, we see that \(X=XAY=Y\); that is, \(X=Y\). We conclude that there is only one matrix \(X\) where \(XA=I=AX\). (Even if we think we have two, we can do the above exercise and see that we really just have one.)

    We have just proved the following theorem.

    Theorem \(\PageIndex{2}\)

    Uniqueness of Solutions to \(AX=I_{n}\)

    Let \(A\) be an \(n\times n\) matrix and let \(X\) be a matrix where \(AX=I_{n}\). Then \(X\) is unique; it is the only matrix that satisfies this equation.

    So given a square matrix \(A\), if we can find a matrix \(X\) where \(AX=I\), then we know that \(XA=I\) and that \(X\) is the only matrix that does this. This makes \(X\) special, so we give it a special name.

    Definition: Invertible Matrices and the Inverse of \(A\)

    Let \(A\) and \(X\) be \(n\times n\) matrices where \(AX=I=XA\). Then:

    1. \(A\) is invertible.
    2. \(X\) is the inverse of \(A\), denoted by \(A^{-1}\).

    Let’s do an example.

    Example \(\PageIndex{2}\)

    Find the inverse of \(A=\left[\begin{array}{cc}{1}&{2}\\{2}&{4}\end{array}\right]\).

    Solution

    By solving the equation \(AX=I\) for \(X\) will give us the inverse of \(A\). Forming the appropriate augmented matrix and finding its reduced row echelon form gives us

    \[\left[\begin{array}{cccc}{1}&{2}&{1}&{0}\\{2}&{4}&{0}&{1}\end{array}\right]\quad\vec{\text{rref}}\quad\left[\begin{array}{cccc}{1}&{2}&{0}&{1/2}\\{0}&{0}&{1}&{-1/2}\end{array}\right] \nonumber \]

    Yikes! We were expecting to find that the reduced row echelon form of this matrix would look like

    \[\left[\begin{array}{cc}{I}&{A^{-1}}\end{array}\right]. \nonumber \]

    However, we don’t have the identity on the left hand side. Our conclusion: \(A\) is not invertible.

    We have just seen that not all matrices are invertible.\(^{1}\) With this thought in mind, let’s complete the array of boxes we started before the example. We’ve discovered that if a matrix has an inverse, it has only one. Therefore, we gave that special matrix a name, “the inverse.” Finally, we describe the most general way to find the inverse of a matrix, and a way to tell if it does not have one.

    Key Idea \(\PageIndex{1}\): Finding \(A^{-1}\)

    Let \(A\) be an \(n\times n\) matrix. To find \(A^{-1}\), put the augmented matrix

    \[\left[\begin{array}{cc}{A}&{I_{n}}\end{array}\right] \nonumber \]

    into reduced row echelon form. If the result is of the form

    \[\left[\begin{array}{cc}{I_{n}}&{X}\end{array}\right], \nonumber \]

    then \(A^{-1}=X\). If not, (that is, if the first \(n\) columns of the reduced row echelon form are not \(I_{n}\)), then \(A\) is not invertible.

    Let’s try again.

    Example \(\PageIndex{3}\)

    Find the inverse, if it exists, of \(A=\left[\begin{array}{ccc}{1}&{1}&{-1}\\{1}&{-1}&{1}\\{1}&{2}&{3}\end{array}\right]\).

    Solution

    We'll try to solve \(AX=I\) for \(X\) and see what happens.

    \[\left[\begin{array}{cccccc}{1}&{1}&{-1}&{1}&{0}&{0}\\{1}&{-1}&{1}&{0}&{1}&{0}\\{1}&{2}&{3}&{0}&{0}&{1}\end{array}\right]\quad\vec{\text{rref}}\quad\left[\begin{array}{cccccc}{1}&{0}&{0}&{0.5}&{0.5}&{0}\\{0}&{1}&{0}&{0.2}&{-0.4}&{0.2}\\{0}&{0}&{1}&{-0.3}&{0.1}&{0.2}\end{array}\right] \nonumber \]

    We have a solution, so

    \[A=\left[\begin{array}{ccc}{0.5}&{0.5}&{0}\\{0.2}&{-0.4}&{0.2}\\{-0.3}&{0.1}&{0.2}\end{array}\right]. \nonumber \]

    Multiply \(AA^{-1}\) to verify that it is indeed the inverse of \(A\).

    In general, given a matrix \(A\), to find \(A^{-1}\) we need to form the augmented matrix \(\left[\begin{array}{cc}{A}&{I}\end{array}\right]\) and put it into reduced row echelon form and interpret the result. In the case of a \(2\times 2\) matrix, though, there is a shortcut. We give the shortcut in terms of a theorem.\(^{2}\)

    Theorem \(\PageIndex{3}\)

    The Inverse of a \(2\times 2\) Matrix

    Let

    \[A=\left[\begin{array}{cc}{a}&{b}\\{c}&{d}\end{array}\right]. \nonumber \]

    \(A\) is invertible if and only if \(ad-bc\neq 0\).

    If \(ad-bc\neq 0\), then

    \[A^{-1}=\frac{1}{ad-bc}\left[\begin{array}{cc}{d}&{-b}\\{-c}&{a}\end{array}\right]. \nonumber \]

    We can’t divide by 0, so if \(ad-bc=0\), we don’t have an inverse. Recall Example \(\PageIndex{2}\), where

    \[A=\left[\begin{array}{cc}{1}&{2}\\{2}&{4}\end{array}\right]. \nonumber \]

    Here, \(ad-bc = 1(4) - 2(2) = 0\), which is why \(A\) didn’t have an inverse.

    Although this idea is simple, we should practice it.

    Example \(\PageIndex{4}\)

    Use Theorem \(\PageIndex{3}\) to find the inverse of

    \[A=\left[\begin{array}{cc}{3}&{2}\\{-1}&{9}\end{array}\right] \nonumber \]

    if it exists.

    Solution

    Since \(ad-bc = 29 \neq 0\), \(A^{-1}\) exists. By the Theorem,

    \[\begin{align}\begin{aligned}A^{-1}&=\frac{1}{3(9)-2(-1)}\left[\begin{array}{cc}{9}&{-2}\\{1}&{3}\end{array}\right] \\ &=\frac{1}{29}\left[\begin{array}{cc}{9}&{-2}\\{1}&{3}\end{array}\right]\end{aligned}\end{align} \nonumber \]

    We can leave our answer in this form, or we could “simplify” it as

    \[A^{-1}=\frac{1}{29}\left[\begin{array}{cc}{9}&{-2}\\{1}&{3}\end{array}\right]=\left[\begin{array}{cc}{9/29}&{-2/29} \\ {1/29}&{3/29}\end{array}\right]. \nonumber \]

    We started this section out by speculating that just as we solved algebraic equations of the form \(ax=b\) by computing \(x = a^{-1}b\), we might be able to solve matrix equations of the form \(A\vec{x}=\vec{b}\) by computing \(\vec{x}=A^{-1}\vec{b}\). If \(A^{-1}\) does exist, then we can solve the equation \(A\vec{x}=\vec{b}\) this way. Consider:

    \[\begin{align}\begin{aligned}A\vec{x}&=\vec{b} &\text{(original equation)} \\ A^{-1}A\vec{x}&=A^{-1}\vec{b} &\text{(multiply both sides on the left by }A^{-1}) \\ I\vec{x}&=A^{-1}\vec{b} &\text{(since }A^{-1}A=I) \\ \vec{x}&=A^{-1}\vec{b} &\text{(since }I\vec{x}=\vec{x})\end{aligned}\end{align} \nonumber \]

    Let’s step back and think about this for a moment. The only thing we know about the equation \(A\vec{x}=\vec{b}\) is that \(A\) is invertible. We also know that solutions to \(A\vec{x}=\vec{b}\) come in three forms: exactly one solution, infinite solutions, and no solution. We just showed that if \(A\) is invertible, then \(A\vec{x}=\vec{b}\) has at least one solution. We showed that by setting \(\vec{x}\) equal to \(A^{-1}\vec{b}\), we have a solution. Is it possible that more solutions exist?

    No. Suppose we are told that a known vector \(\vec{v}\) is a solution to the equation \(A\vec{x}=\vec{b}\); that is, we know that \(A\vec{v}=\vec{b}\). We can repeat the above steps:

    \[\begin{align}\begin{aligned}A\vec{v}&=\vec{b} \\ A^{-1}A\vec{v}&=A^{-1}\vec{b} \\ I\vec{v}&=A^{-1}\vec{b} \\ \vec{v}&=A^{-1}\vec{b}.\end{aligned}\end{align} \nonumber \]

    This shows that all solutions to \(A\vec{x}=\vec{b}\) are exactly \(\vec{x}=A^{-1}\vec{b}\) when \(A\) is invertible. We have just proved the following theorem.

    Theorem \(\PageIndex{4}\)

    Invertible Matrices and Solutions to \(A\vec{x}=\vec{b}\)

    Let \(A\) be an invertible \(n\times n\) matrix, and let \(\vec{b}\) be any \(n\times 1\) column vector. Then the equation \(A\vec{x}=\vec{b}\) has exactly one solution, namely

    \[\vec{x}=A^{-1}\vec{b} . \nonumber \]

    A corollary\(^{3}\) to this theorem is: If \(A\) is not invertible, then \(A\vec{x}=\vec{b}\) does not have exactly one solution. It may have infinite solutions and it may have no solution, and we would need to examine the reduced row echelon form of the augmented matrix \(\left[\begin{array}{cc}{A}&{\vec{b}}\end{array}\right]\) to see which case applies.

    We demonstrate our theorem with an example.

    Example \(\PageIndex{5}\)

    Solve \(A\vec{x}=\vec{b}\) by computing \(\vec{x}=A^{-1}\vec{b}\), where

    \[A=\left[\begin{array}{ccc}{1}&{0}&{-3}\\{-3}&{-4}&{10}\\{4}&{-5}&{-11}\end{array}\right]\quad\text{and}\quad\vec{b}=\left[\begin{array}{c}{-15}\\{57}\\{-46}\end{array}\right]. \nonumber \]

    Solution

    Without showing our steps, we compute

    \[A^{-1}=\left[\begin{array}{ccc}{94}&{15}&{-12}\\{7}&{1}&{-1}\\{31}&{5}&{-4}\end{array}\right]. \nonumber \]

    We then find the solution to \(A\vec{x}=\vec{b}\) by computing \(A^{-1}\vec{b}\):

    \[\begin{align}\begin{aligned}\vec{x}&=A^{-1}\vec{b} \\ &=\left[\begin{array}{ccc}{94}&{15}&{-12}\\{7}&{1}&{-1}\\{31}&{5}&{-4}\end{array}\right]\:\left[\begin{array}{c}{-15}\\{57}\\{-46}\end{array}\right] \\ &=\left[\begin{array}{c}{-3}\\{-2}\\{4}\end{array}\right].\end{aligned}\end{align} \nonumber \]

    We can easily check our answer:

    \[\left[\begin{array}{ccc}{1}&{0}&{-3}\\{-3}&{-4}&{10}\\{4}&{-5}&{-11}\end{array}\right]\:\left[\begin{array}{c}{-3}\\{-2}\\{4}\end{array}\right]=\left[\begin{array}{c}{-15}\\{57}\\{-46}\end{array}\right]. \nonumber \]

    Knowing a matrix is invertible is incredibly useful.\(^{4}\) Among many other reasons, if you know \(A\) is invertible, then you know for sure that \(A\vec{x}=\vec{b}\) has a solution (as we just stated in Theorem \(\PageIndex{4}\)). In the next section we’ll demonstrate many different properties of invertible matrices, including stating several different ways in which we know that a matrix is invertible.

    Footnotes

    [1] Hence our previous definition; why bother calling \(A\) “invertible” if every square matrix is? If everyone is special, then no one is. Then again, everyone is special.

    [2] We don’t prove this theorem here, but it really isn’t hard to do. Put the matrix \[\left[\begin{array}{cccc}{a}&{b}&{1}&{0}\\{c}&{d}&{0}&{1}\end{array}\right] \nonumber \] into reduced row echelon form and you’ll discover the result of the theorem. Alternatively, multiply \(A\) by what we propose is the inverse and see that we indeed get \(I\).

    [3] a corollary is an idea that follows directly from a theorem

    [4] As odd as it may sound, knowing a matrix is invertible is useful; actually computing the inverse isn’t. This is discussed at the end of the next section.


    This page titled 2.6: The Matrix Inverse is shared under a CC BY-NC 3.0 license and was authored, remixed, and/or curated by Gregory Hartman et al. via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.