MathAlgebraLinear algebraMatrices

Matrix inverse

7 minutes read

As you already know, multiplying matrices is a much more difficult task than multiplying numbers. But in this topic, you will learn about the concept of inverse matrix, which can help you drastically simplify these calculations in some cases.

Since now, you'll know its most important application: find the unique solution of a square system of linear equations. Actually, when the solution is unique, the inverse is the perfect tool to calculate it explicitly.

Developing the definition

When you multiply any number by 11, you get the same number. And nearly every number xx (except zero) has a partner yy such that xy=1xy=1 which is known as the multiplicative inverse of xx. Thanks to this fact, you can solve a lot of equations. But how can you do this with matrices? To have the same flexibility, you should be able to "cancel" matrices in equations. In other words, you need to multiply inverses for them.

As a first step, the identity matrix II will play the role of the number 11 because you already know that AI=IA=AAI=IA = A. The next step is clear, because to "neutralize" a square matrix AA you need another matrix BB such that AB=IAB=I. But as you know, the product is not commutative, so BB should also satisfy that BA=IBA=I. With this, how to define the inverse of a matrix is clear:

Let AA be a square matrix of size nn. An inverse for AA is a square matrix BB of size nn such that:

AB=I and BA=IAB =I \quad \text{ and } \quad BA=I

When a matrix has an inverse, it's called invertible or non-singular.

Just like in numbers, matrix 00 doesn't have an inverse since 0A=00A=0 for any matrix AA. But is it the only matrix that doesn't have an inverse? No! A lot of matrices don't have an inverse, and it's quite easy to see why. Just think of a matrix CC that has a row full of zeros, say the ii-th row. No matter which matrix BB you take, the ii-th row of CBCB will always be 00. Therefore CBCB can never be II!

Another natural question would be if only one matrix can be the inverse of AA. That is, if AB=BA=IAB=BA=I, can there exist another matrix CC such that AC=CA=IAC=CA=I? Fortunately, the answer is no. The inverse, when it exists, is unique. And you can easily check it:

B=IB=(CA)B=C(AB)=C(I)=CB=IB=(CA)B=C(AB)=C(I)=CAs a final note, even if there exists a matrix such that AB=IAB=I you should also verify that BA=IBA=I. However, later you will discover that it is not necessary to do the second revision. It is enough that any of the two is fulfilled for both to do so.
Let's get our hands dirty with some matrices.

Checking out the inverse

The definition doesn't tell you much about how to find the inverse of a matrix AA. If you had a candidate AA, you'd have to check both that AB=IAB=I and BA=IBA=I. Let's look at an example with some matrices A=(1603)A = \begin{pmatrix} 1 & 6 \\ 0 & 3 \end{pmatrix} and B=(3041)B = \begin{pmatrix} -3 & 0 \\ 4 & -1 \end{pmatrix}. In this case:

AB=(1603)(3041)=(216123)AB = \begin{pmatrix} 1 & 6 \\ 0 & 3 \end{pmatrix} \begin{pmatrix} -3 & 0 \\ 4 & -1 \end{pmatrix} = \begin{pmatrix} 21 & -6 \\ 12 & -3 \end{pmatrix}

Since ABIAB \neq I, you can be sure that BA1B \neq A^{-1}. Now consider a new candidate C=(1201/3)C = \begin{pmatrix} 1 & -2 \\ 0 & 1/3 \end{pmatrix}:

AC=(1603)(1201/3)=(1001)AC = \begin{pmatrix} 1 & 6 \\ 0 & 3 \end{pmatrix} \begin{pmatrix} 1 & -2 \\ 0 & 1/3 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}Although AC=IAC=I, you also must check that CA=ICA=I, so let's get straight:

CA=(1201/3)(1603)=(1001)CA = \begin{pmatrix} 1 & -2 \\ 0 & 1/3 \end{pmatrix} \begin{pmatrix} 1 & 6 \\ 0 & 3 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}With this, you can be completely sure that C=A1C=A^{-1}.

A quick trick to rule out that two matrices are inverses of each other is the following. Calculate any entry on the diagonal of its product. If it is not 11, then they are not inverses of each other. Alternatively, it is also true when any of the entries off the diagonal of the product is different from 00.

After all, what is the benefit of knowing the inverse of a matrix? Time to have a look into a useful application.

Systems of linear equations

Systems of equations are very common. Sometimes they are very large and it is difficult to deal with so many equations. But thanks to the inverse, we can solve them in the blink of an eye! So the initial problem is reduced to calculating the inverse, which, as you will see in the future, is not that simple.

Take a system of linear equations Ax=bAx=b where AA is a square matrix of size nn and both xx and bb are vectors in Rn\mathbb{R}^n. If AA were invertible, then you could premultiply both sides by A1A^{-1} to get:

A1Ax=A1bA^{-1}Ax=A^{-1}bTherefore, the unique solution of the system is really simple, it's just x=A1bx=A^{-1}b

If in the square system Ax=bAx=b the matrix AA is invertible, then there is a unique solution given by:

x=A1bx=A^{-1}b

The most surprising thing about this is that the value of bb doesn't matter. Notice also that this technique works for any square system. regardless of its size!

Proof - uniqueness of the solution You know that x=A1bx=A^{-1}b is a solution.

Suppose that there is another possible solution yy. That is, Ay=bAy=b.Now, notice that 0=bb=AxAy=A(xy)0=b−b=Ax−Ay=A(x−y), so A(xy)=0A(x-y)=0. From this fact, it follows that:

xy=I(xy)=(A1A)(xy)=A1(A)(xy)=A10=0x-y=I(x-y) =(A^{-1} A)(x-y) = A^{-1}( A)(x-y) = A^{-1} 0 = 0So, x=yx=y.

Getting more and more bulky

Time to see an example! A 1×11 \times 1 linear system is just an equation involving numbers, like 5x=45x=4. You can easily solve it getting x=4/5x=4/5. But the really interesting systems are those with greater dimensions.

Let's use the matrix from the example in the previous section A=(1603)A = \begin{pmatrix} 1 & 6 \\ 0 & 3 \end{pmatrix}. Take, for example b=(43)b = \begin{pmatrix} -4 \\ 3 \end{pmatrix}.

Since you already know that A1=(1201/3)A^{-1} = \begin{pmatrix} 1 & -2 \\ 0 & 1/3 \end{pmatrix}, the unique solution of the system is:x=A1b=(1201/3)(43)=(101)x=A^{-1}b = \begin{pmatrix}1 & -2 \\ 0 & 1/3 \end{pmatrix} \begin{pmatrix} -4 \\ 3 \end{pmatrix} = \begin{pmatrix} -10 \\ 1 \end{pmatrix}But what if b=(52)b = \begin{pmatrix} 5 \\ -2 \end{pmatrix}? You guessed it! The method works exactly the same:

x=A1b=(1201/3)(52)=(92/3)x=A^{-1}b = \begin{pmatrix}1 & -2 \\ 0 & 1/3 \end{pmatrix} \begin{pmatrix} 5 \\ -2 \end{pmatrix} = \begin{pmatrix} 9 \\ -2/3 \end{pmatrix}

Now, you can see a more bulky example. The inverse of the 3×33 \times3 matrix A=(213011120)A = \begin{pmatrix} 2 & 1 & -3 \\ 0 & 1 & -1 \\ 1 & -2 & 0 \end{pmatrix} is A1=12(262132152)A^{-1} = \frac{1}{2} \begin{pmatrix} 2 & -6 & -2 \\ 1 & -3 & -2 \\ 1 & -5 & -2 \end{pmatrix}. If you take b=(284)b = \begin{pmatrix} 2 \\ 8 \\-4 \end{pmatrix}, then the solution of the system Ax=bAx=b is just:

x=A1b=12(262132152)(284)=(18715)x=A^{-1}b = \frac{1}{2} \begin{pmatrix} 2 & -6 & -2 \\ 1 & -3 & -2 \\ 1 & -5 & -2 \end{pmatrix} \begin{pmatrix} 2 \\ 8 \\-4 \end{pmatrix} = \begin{pmatrix} -18 \\ -7 \\ -15 \end{pmatrix}

But how to calculate the inverse of some matrix AA? This can be really difficult and require some new tools. You'll learn more about it in the next topic!

Conclusion

It is better that you summarize what you just learned. Take a square matrix AA of size nn.

  • AA is invertible if there is a square matrix BB of size nn such that AB=BA=IAB=BA=I.
  • When AA is invertible, its inverse is unique, and it's denoted by A1A^{-1}.
  • The system Ax=bAx=b has a unique solution when AA is invertible, and, in this case, the unique solution is x=A1bx=A^{-1}b.
13 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo