Title: Default for 7.4 The Inverse of a Matrix
Course: HELM Workbooks 2023-2024

The inverse of a square matrix

We know that any non-zero number \(k\) has an inverse; for example \(2\) has an inverse \(\frac{1}{2}\) or \(2^{-1}\). The inverse of the number \(k\) is usually written \(\frac{1}{k}\) or, more formally, by \(k^{-1}\). This numerical inverse has the property that

\( k\times k^{-1}=k^{-1}\times k=1\)

We now show that an inverse of a matrix can, in certain circumstances, also be defined.

Given an \(n\times n\) square matrix \(A,\) then an \(n\times n\) square matrix \(B\) is said to be the inverse matrix of \(A\) if

\(AB=BA=I\)

where \(I\) is, as usual, the identity matrix (or unit matrix) of the appropriate size.

Example

Show that the inverse matrix of \(A=\left[\begin{array}{cc}-1&1\\ -2&0\end{array}\right]\) is \(B=\left[\begin{array}{cc}0&-\frac{1}{2}\\ 1&-\frac{1}{2}\end{array}\right]\)

Solution

All we need to do is check that \(AB=BA=I\).

\(AB=\left[\begin{array}{cc}-1&1\\ -2&0\end{array}\right]\times\frac{1}{2}\left[\begin{array}{cc}0&-1\\ 2&-1\end{array}\right] = \frac{1}{2}\left[\begin{array}{cc}-1&1\\ -2&0\end{array}\right]\times\left[\begin{array}{cc}0&-1\\ 2&-1\end{array}\right] = \frac{1}{2}\left[\begin{array}{cc}2&0\\ 0&2\end{array}\right]=\left[\begin{array}{cc}1&0\\ 0&1\end{array}\right] \)

We make three important remarks:

- Non-square matrices do not have inverses.
- The inverse of \(A\) is usually written \(A^{-1}\).
- Not all square matrices have inverses.

Exercise

Consider \(A=[value]\), and let \(B=[value]\) be a possible inverse of \(A\).

1. Find \(AB\) and \(BA\)
\(AB= \)

\(BA= \)
2. Equate the elements of \(AB\) to those of \(I=[value]\) and try to solve the resulting four equations.
What does your solution tell you about finding an inverse of \(A\)?
Feedback: 1. For \(A=[value]\), \(B=[value]\) the products are \[AB=[value], BA=[value].\] 2. Equating \(AB=I\) yields \[a=1, b=0, a=0, b=1/2.\] This is a contradiction, and hence the matrix \(A\) has no inverse and is said to be a singular matrix. A matrix with an inverse is said to be non-singular.

Exercise

Form the matrix products \(AB\) and \(BA\) where

\(A=[value]\) and \(B=[value]\).

\(AB=\)

\(BA=\)
Feedback: For \(A=[value]\), \(B=[value]\) the products are: \[AB=[value], \quad BA=[value]\]

You will see that, had we chosen

\[C = \frac{1}{ad - bc} \begin{bmatrix}d & -b \\ -c & a\end{bmatrix}\]

instead of \(B\), then both products \(AC\) and \(CA\) will be equal to \(I\). This requires \(ad - bc \neq 0\). Hence this matrix \(C\) is the inverse of \(A\). However, if \(ad - bc = 0\) then \(A\) has no inverse.

Note that for the matrix

\[A = \begin{bmatrix}1 & 0 \\ 2 & 0\end{bmatrix},\]

which occurred in the last question, \(ad - bc = 1 \times 0 - 0 \times 2 = 0\), confirming as we found that \(A\) has no inverse.

Key Point

If \(ad-bc\neq 0\) then the \(2\times 2\) matrix \(A=\left[\begin{array}{cc}a&b\\ c&d\end{array}\right]\) has a (unique) inverse given by

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

Note that \(ad-bc=|A|\), the determinant of the matrix \(A\).

In words: To find the inverse of a \(2\times 2\) matrix \(A\) we interchange the diagonal elements, change the sign of the other two elements, and then divide by the determinant of \(A\).

The inverse of a \(3\times 3\) matrix – Gauss elimination method

It is true, in general, that if the determinant of a matrix is zero then that matrix has no inverse. If the determinant is non-zero then the matrix has a (unique) inverse. In this Section and the next we look at two ways of finding the inverse of a \(3\times 3\) matrix; larger matrices can be inverted by the same methods - the process is more tedious and takes longer. The \(2\times 2\) case could be handled similarly but as we have seen we have a simple formula to use.

The method we now describe for finding the inverse of a matrix has many similarities to a technique used to obtain solutions of simultaneous equations. This method involves operating on the rows of a matrix in order to reduce it to a unit matrix.

The row operations we shall use are

1. interchanging two rows
2. multiplying a row by a constant factor
3. adding a multiple of one row to another.

Note that in (ii) and (iii) the multiple could be negative or fractional, or both.

The Gauss elimination method is outlined in the following Key Point:

Key Point

Matrix Inverse – Gauss Elimination Method

We use the result, quoted without proof, that:

if a sequence of row operations applied to a square matrix \(A\) reduces

it to the identity matrix \(I\) of the same size then the same sequence of

operations applied to \(I\) reduces it to \(A^{-1}\).

Three points to note:

- If it is impossible to reduce \(A\) to \(I\) then \(A^{-1}\) does not exist. This will become evident by the appearance of a row of zeros.
- There is no unique procedure for reducing \(A\) to \(I\) and it is experience which leads to selection of the optimum route.
- It is more efficient to do the two reductions, \(A\) to \(I\) and \(I\) to \(A^{-1}\), simultaneously.

Suppose we wish to find the inverse of the matrix

\[A = \begin{bmatrix} 1 & 3 & 3 \\ 1 & 4 & 3 \\ 2 & 7 & 7 \end{bmatrix}\]

We first place \(A\) and \(I\) adjacent to each other.

\[ \begin{bmatrix} 1 & 3 & 3 \\ 1 & 4 & 3 \\ 2 & 7 & 7 \end{bmatrix} \quad \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \]

Phase 1

We now proceed by changing the columns of \(A\) left to right to reduce \(A\) to the form

\[\begin{bmatrix} 1 & * & * \\ 0 & 1 & * \\ 0 & 0 & 1 \end{bmatrix},\]

where \(*\) can be any number. This form is called upper triangular.

First we subtract row 1 from row 2 and twice row 1 from row 3. ‘Row’ refers to both matrices.

\[ \begin{bmatrix} 1 & 3 & 3 \\ 1 & 4 & 3 \\ 2 & 7 & 7 \end{bmatrix} \quad \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \quad \xrightarrow[R3 - 2R1]{R2 - R1} \quad \begin{bmatrix} 1 & 3 & 3 \\ 0 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix} \quad \begin{bmatrix} 1 & 0 & 0 \\ -1 & 1 & 0 \\ -2 & 0 & 1 \end{bmatrix} \]

Now we subtract row 2 from row 3.

\[ \begin{bmatrix} 1 & 3 & 3 \\ 0 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix} \quad \begin{bmatrix} 1 & 0 & 0 \\ -1 & 1 & 0 \\ -2 & 0 & 1 \end{bmatrix} \quad \xrightarrow{R3 - R2} \quad \begin{bmatrix} 1 & 3 & 3 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \quad \begin{bmatrix} 1 & 0 & 0 \\ -1 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix} \]

Phase 2

This consists of continuing the row operations to reduce the elements above the leading diagonal to zero.

We proceed right to left. We subtract 3 times row 3 from row 1 (the elements in row 2 column 3 is already zero).

\[ \begin{bmatrix} 1 & 3 & 3 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \quad \begin{bmatrix} 1 & 0 & 0 \\ -1 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix} \quad \xrightarrow{R1 - 3R3} \quad \begin{bmatrix} 1 & 3 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \quad \begin{bmatrix} 4 & 3 & -3 \\ -1 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix} \]

Finally we subtract 3 times row 2 from row 1.

\[ \begin{bmatrix} 1 & 3 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \quad \begin{bmatrix} 4 & 3 & -3 \\ -1 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix} \quad \xrightarrow{R1 - 3R2} \quad \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix} \quad \begin{bmatrix} 7 & 0 & -3 \\ -1 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix} \]

Then we have

\[A^{-1} = \begin{bmatrix} 7 & 0 & -3 \\ -1 & 1 & 0 \\ -1 & -1 & 1 \end{bmatrix}\]

(This can be verified by showing that \(AA^{-1} - I\) or \(A^{-1}A = I\).)

The inverse of a \(3\times 3\) matrix – determinant method

This method which employs determinants, is of importance from a theoretical perspective. The numerical computations involved are too heavy for matrices of higher order than \(3\times 3\) and in such cases the Gauss elimination approach is preferred.

To obtain \(A^{-1}\) using the determinant approach the steps in the following keypoint are followed:

Key Point

Matrix Inverse – the Determinant Method

Given a square matrix \(A\), we first calculate \(|A|\). If \(|A|=0\) then \(A^{-1}\) does not exist.

If \(|A|\neq 0\) we can proceed to find the inverse matrix, as follows:

- Replace each element of \(A\) by its cofactor
- Transpose the result to form the adjoint matrix, denoted by \(\mathrm{adj}(A)\)
- Then calculate \(A^{-1}=\frac{1}{|A|}\mathrm{adj}(A)\).

Q: Which of the following matrices has an inverse?
- \(A=\left[{ \begin{array}{cc}1&0\\2&3\end{array}} \right]\) (\(|A|=1\times 3 - 0\times 2 = 3\).)
- \(B=\left[{ \begin{array}{cc}1&1\\-1&1\end{array}} \right]\) (\(|B|=1+1 =2\).)
- \(C=\left[{ \begin{array}{cc}1&-1\\-2&2\end{array}} \right]\) (\(|C|=2-2 =0\). Therefore \(C\) has no inverse because its determinant is zero.)
- \(D=\left[{ \begin{array}{cc}2&0\\0&2\end{array}} \right]\) (\(|D|=4-0 =4\).)
A: \(A=\left[{ \begin{array}{cc}1&0\\2&3\end{array}} \right]\); \(B=\left[{ \begin{array}{cc}1&1\\-1&1\end{array}} \right]\); \(D=\left[{ \begin{array}{cc}2&0\\0&2\end{array}} \right]\)

Exercise

Find the inverses of the following matrices

\(A=[value]\), \(B=[value]\), \(C=[value]\).

1. \(A^{-1}=\)
2. \(B^{-1}=\)
3. \(C^{-1}=\)
Feedback: Recall that the inverse of a \(2 \times 2\) matrix \(A = [value]\) is given by the formula \[A^{-1} = \frac{1}{ad - bc} [value].\] We apply this to each of the given matrices. 1. For \(A = [value]\), we have \[A^{-1} = \frac{1}{[value]} [value] = [value].\] 2. For \(B = [value]\), we have \[B^{-1} = \frac{1}{[value]} [value] = [value].\] 3. For \(C = [value]\), we have \[C^{-1} = \frac{1}{[value]} [value] = [value].\]

Exercise

It can be shown that the matrix \({A}=[value]\) represents a clockwise rotation through an angle \(\theta\) in an \(xy\)-plane about the origin. The matrix \(B\) represents a rotation anti-clockwise through an angle \(\theta\). It is therefore given by

\(B=[value]=[value]\)

Form the products \(AB\) and \(BA\) for these 'rotation matrices'.

\(AB=\)

\(BA=\)
Feedback: \[{AB} =[value]=[value]\] \[{BA} =[value]=[value]\] Effectively: a rotation through an angle \(\theta\) followed by a rotation through angle \(-\theta\) is equivalent to zero rotation.

Exercise

Use the Gauss elimination method to find the inverse of the following matrices

\[A = [value],\] \[B = [value].\]

1. \(A^{-1}=\)
2. \(B^{-1}=\)
Feedback: We can find the inverse of matrix \(A\) using the Gaussian elimination method. We do this by reducing the matrix \(A\) to the identity matrix \(I\). There is no unique procedure for this but here is one example. We first place \(A\) and \(I\) adjacent to each other. [value] [value]. We now proceed by changing the columns of \(A\) left to right to reduce \(A\) to the form [value], where \(n\) can be any number. This form is called upper triangular. First we swap row 1 and row 2. \[[value] [value] R1 \leftrightarrow R2 \longrightarrow [value] [value] \]. Now we subtract [value] times row 1 from row 2 and [value] times row 1 from row 3. \[[value] [value] R2 - [value] R1, R3 - [value] R1 \longrightarrow [value] [value]\] Then we divide row 2 by [value] and subtract [value] times row 2 from row 3. \[[value] [value] R2/[value], R3 - [value] R2 \longrightarrow [value] [value]\]. Finally we divide row 3 by [value]. \[[value] [value] R3/[value] \longrightarrow [value] [value]\] We would usually proceed by changing the columns of \(A\) right to left to reduce \(A\) to the form [value]. However, for this question we already obtained zeros above the main diagonal after we swapped row 1 and row 2. So we have, \[A^{-1} = [value].\] The method can be used to determine \(B^{-1}\) similarly.

Exercise

Use the determinant method to find the inverse of the following matrices

\[A = [value],\] \[B = [value].\]

1. \(A^{-1} = \)
2. \(B^{-1} = \)
Feedback: To find the inverse of \(A = [value]\) using the determinant method will require four steps. First we find the determinant of \(A\). \[ \det(A) = [value]. \] Since \(\det(A) \neq 0\) the inverse of \(A\) exists. Now, we replace each element of \(A\) by its cofactor. The cofactor of \({A}_{ij}\) is the determinant of the matrix that remains when row \(i\) and column \(j\) are removed, multiplied by \((-1)^{i+j}\). So we have, [value]. Then we transpose the result to obtain the adjoint matrix: \(\mathrm{adj}(A) = [value]^{T} = [value]\). Finally we obtain \(A^{-1}\) using the following formula: \(A^{-1} = \frac{1}{\det(A)} \mathrm{adj}(A) = \frac{1}[value] [value] = [value]\). The method can be used to determine \(B^{-1}\) similarly, which gives \( B^{-1} = [value].\)

- A matrix that has no inverse is said to be a singular matrix. A matrix which has an inverse is said to be non-singular.
- If a matrix has an inverse then that inverse is unique.
Suppose \(B\) and \(C\) are both inverses of \(A\). Then, by definition of the inverse,
\(AB = BA = I\)   and   \(AC = CA = I\).
Consider the two ways of forming the product \(CAB\).
  1. \(CAB = C(AB) = CI = C\).
  2. \(CAB = (CA)B = IB = B\).
Hence, \(B = C\) and the inverse is unique.
- There is no such operation as division in matrix algebra.
We do not write \(\dfrac{B}{A}\) but rather \(A^{-1}B\) or \(BA^{-1}\), depending on the order required.
- Assuming that the square matrix \(A\) has an inverse \(A^{-1}\) then the solution of the systems of equations \(AX = B\) is found by pre-multiplying both sides by \(A^{-1}\).

 | \(AX\) |  \(=\)  | \(B\), |
pre-multiplying by \(A^{-1}\):   | \(A^{-1}(AX)\) | \(=\) | \(A^{-1}B\), |
using associativity: | \((A^{-1}A)X\) | \(=\) | \(B\), |
using \(A^{-1}A = \): | \(IX\) | \(=\) | \(A^{-1}B\), |
using property of \(I\): | \(X\) | \(=\) | \(A^{-1}B\) |   which is the solution we seek.

Exercise

Which of the following matrices are invertible? Find the inverse where possible.

1. \(A = [value]\)
2. \(B = [value]\)
3. \(C = [value]\)
4. \(D = [value]\)
5. \(E = [value]\)
Feedback: Recall that a \(2 \times 2\) has an inverse if and only if its determinant is nonzero. 1. The determinant of \(A = [value]\) is \(\lvert A \rvert = [value] = [value] \neq 0\). Therefore, \(A\) is invertible. 2. The determinant of \(B = [value]\) is \(\lvert B \rvert = [value] = [value] \neq 0\). Therefore, \(B\) is invertible. 3. The determinant of \(C = [value]\) is \(\lvert C \rvert = [value] = [value]\). Therefore, \(C\) is not invertible. 4. The determinant of \(D = [value]\) is \(\lvert D \rvert = [value] = [value] \neq 0\). Therefore, \(D\) is invertible. 5. The determinant of \(E = [value]\) is \(\lvert E \rvert = [value] = [value]\). Therefore, \(E\) is not invertible.

The inverse of a square matrix

We know that any non-zero number \(k\) has an inverse; for example \(2\) has an inverse \(\frac{1}{2}\) or \(2^{-1}\). The inverse of the number \(k\) is usually written \(\frac{1}{k}\) or, more formally, by \(k^{-1}\). This numerical inverse has the property that

\( k\times k^{-1}=k^{-1}\times k=1\)

We now show that an inverse of a matrix can, in certain circumstances, also be defined.

Given an \(n\times n\) square matrix \(A,\) then an \(n\times n\) square matrix \(B\) is said to be the inverse matrix of \(A\) if

\(AB=BA=I\)

where \(I\) is, as usual, the identity matrix (or unit matrix) of the appropriate size.

Example 6

6 Show that the inverse matrix of \(A=\left[\begin{array}{cc}-1&1\\ -2&0\end{array}\right]\) is \(B=\left[\begin{array}{cc}0&-\frac{1}{2}\\ 1&-\frac{1}{2}\end{array}\right]\)

Solution

All we need to do is check that \(AB=BA=I\).

\(AB=\left[\begin{array}{cc}-1&1\\ -2&0\end{array}\right]\times\frac{1}{2}\left[\begin{array}{cc}0&-1\\ 2&-1\end{array}\right] = \frac{1}{2}\left[\begin{array}{cc}-1&1\\ -2&0\end{array}\right]\times\left[\begin{array}{cc}0&-1\\ 2&-1\end{array}\right] = \frac{1}{2}\left[\begin{array}{cc}2&0\\ 0&2\end{array}\right]=\left[\begin{array}{cc}1&0\\ 0&1\end{array}\right] \)

We make three important remarks:

\(\bullet\)Non-square matrices do not have inverses.

\(\bullet\)The inverse of \(A\) is usually written \(A^{-1}\).

\(\bullet\)Not all square matrices have inverses.

\(\bullet\)If a matrix has an inverse then that inverse is unique.

  Suppose \(B\) and \(C\) are both inverses of \(A\). Then, by definition of the inverse,

  \(\qquad AB=BA=I\) and \(AC=CA=I\)

  Consider the two ways of forming the product \(CAB\)

1. \(CAB=C(AB)=CI=C\)
2. \(CAB=(CA)B=IB=B.\)

  Hence \(B=C\) and the inverse is unique.

\(\bullet\)There is no such operation as division in matrix algebra.

  We do not write \(\dfrac{B}{A}\) but rather

  \(\qquad A^{-1}B\ \ \text{or}\ \ BA^{-1},\)

  depending on the order required.

\(\bullet\)Assuming that the square matrix \(A\) has an inverse \(A^{-1}\) then the solution of the system of equations \(A X=B\) is found by pre-multiplying both sides by \(A^{-1}\).

 | \(AX\) | = | \(B\) |
pre-multiplying by} \(A^{-1}\): | \(A^{-1}(AX)\) | = | \(A^{-1}B\), |
using associativity: | \((A^{-1}A)X\) | = | \(A^{-1}B\), |
using \(A^{-1}A = I\): | \(IX\) | = | \(A^{-1}B\), |
using property of \(I\): | \(X\) | = | \(A^{-1}B\) | which is the solution we seek.

Exercise

Find the inverses of the following matrices

\(\bf A=[value]\), \(\bf B=[value]\), \(\bf C=[value]\).

1. \(\bf A^{-1}=\)
2. \(\bf B^{-1}=\)
3. \(\bf C^{-1}=\)
Feedback: FEEDBACK The inverse of a 2 \(\times\) 2 matrix \[[value]\] is \[\frac{1}{ad-bc}[value].\] Therefore the inverse of matrix \[\bf A = [value]\] is \[\bf A^{-1} = \frac{1}{([value]).([value]) -([value]).([value])}[value] = \frac{1}{([value]) -([value])}[value] =[value].\] The inverse of matrices \( \bf B\) and \( \bf C\) can be found similarly and are \[ B^{-1} = [value] \quad C^{-1} = [value].\]

Use the Gauss elimination method to find the inverse of the following matrices

\[\bf A = [value],\] \[\bf B = [value].\]

(a) \(\bf A^{-1}=\)

(b) \(\bf B^{-1}=\)
Feedback: FEEDBACK We can find the inverse of matrix \(\bf A\) using the Gaussian elimination method. We do this by reducing the matrix \(\bf A\) to the identity matrix \(\bf I\). There is no unique procedure for this but here is one example. We first place \(\bf A\) and \(\bf I\) adjacent to each other. [value] [value]. We now proceed by changing the columns of \(\bf A\) left to right to reduce \(\bf A\) to the form [value], where \(n\) can be any number. This form is called upper triangular. First we swap row 1 and row 2. \[[value] [value] R1 \leftrightarrow R2 \longrightarrow [value] [value]. \] Now we subtract [value] times row 1 from row 2 and [value] times row 1 from row 3. \[[value] [value] R2 - [value] R1, R3 - [value] R1 \longrightarrow [value] [value].\] Then we divide row 2 by [value] and subtract [value] times row 2 from row 3. \[[value] [value] R2/[value], R3 - [value] R2 \longrightarrow [value] [value].\] Finally we divide row 3 by [value]. \[[value] [value] R3/[value] \longrightarrow [value] [value].\] We would usually proceed by changing the columns of \(\bf A\) right to left to reduce \(\bf A\) to the form [value]. However, for this question we already obtained zeros above the main diagonal after we swapped row 1 and row 2. So we have, \[\bf A^{-1} = [value].\] The method can be used to determine \(\bf B^{-1}\) similarly, which gives \( B^{-1} = [value].\)

Use the determinant method to find the inverse of the following matrices

\[\bf A = [value],\] \[\bf B = [value].\]

(a) \(\bf A^{-1}=\) .

(b) \(\bf B^{-1}=\) .
Feedback: FEEDBACK To find the inverse of \(\bf A = [value]\) using the determinant method will require four steps. First we find the determinant of \(\bf A.\) \[ \det(\bf A) = [value] .\] Since \(\det(\bf A) \neq 0\) the inverse of \(\bf A\) exists. Now, we replace each element of \(\bf A\) by its cofactor. The cofactor of \({\bf A}_{ij}\) is the determinant of the matrix that remains when row \(i\) and column \(j\) are removed, multiplied by \((-1)^{i+j}\). So we have, [value]. Then we transpose the result to obtain the adjoint matrix: \(\bf adj(A) = [value]^{T} = [value].\) Finally we obtain \(\bf A^{-1}\) using the following formula: \(\bf A^{-1} = \frac{1}{\det(A)} adj(A) = \frac{1}[value] [value] = [value].\) The method can be used to determine \(\bf B^{-1}\) similarly, which gives \(B^{-1} = [value].\)