18. Inverses#

18.1. Inverse Functions#

The inverse of a function f is a function which ‘undoes’ the action of f. In other words if g is an inverse of f then g(f(x))=x for all values of x in the domain of f and f(g(y))=y for all values of y in the domain of g.

If g is the inverse of f then we write g=f1.

../../_images/inverse.png

Fig. 18.1 The inverse of a function f is the function f1 for which f1(f(x))=x and f(f1(y))=y.#

Exercise 18.1

For each of the functions below, state whether it has an inverse and if so write it down.

  1. f:RR, f(x)=x2.

  2. g:R+R+, g(x)=x2, where R+ is the set of positive real numbers.

  3. h:R2R, h(x,y)=x+y.

18.2. Matrix Inverses#

Since a matrix represents a linear transformation, which is a function, we can consider if a matrix has an inverse. For example, consider the (2×2) matrix Rπ/2 which represents a π/2 anticlockwise rotation about the origin:

Rπ/2=(0110).

Its inverse is a π/2 clockwise rotation about the origin, represented by the following matrix:

R3π/2=(0110).

In general, if A is an n×n matrix and B is its inverse, then B is also an (n×n) matrix which satisfies

ABx=x

for all xRn.

In other words, AB is a matrix which leaves x unchanged. The only matrix which leaves x unchanged is the identity matrix I, and so we have the following definition of the inverse matrix.

Definition

Let A be an (n×n) square matrix. If there is an (n×n) matrix B such that

AB=BA=In

then A is invertible and B is the inverse of A.

We write B=A1.

../../_images/linear_transformations_8_0.png

Fig. 18.2 If the matrix A=Rπ/2 is a π/2 anticlockwise rotation about the origin then its inverse A1=R3π/2 is a π/2 clockwise rotation about the origin. The matrix A1A=I represents the identity transformation.#

Exercise 18.2

  1. Show that R3π/2 is the inverse of Rπ/2.

  2. What is the inverse of the matrix Rθ representing an anticlockwise rotation about the origin by θ? Calculate RθRθ1 and show that it equals the identity matrix.

  3. Given that CXD=E, write down the solution for X explicitly in terms of inverse matrices C1 and D1.

18.3. Solving Matrix Equations#

Suppose that we are given the definitions below and asked to compute the result for B :

(18.1)#A=(1221),AB=(5343)

If this was ordinary scalar algebra, then B would be given by ABA, but we have not defined the concept of division for matrices. Indeed, we should recognise a difficulty in doing so, since matrix multiplication is not commutative. The problems QX=P and XQ=P do not generally have the same solution, and so the expression X=PQ would be ambiguous.

The difficulty could be addressed by introducing separate concepts of “left-division” and “right-division”, and some authors have done exactly this. However, a more fundamental approach is to abandon the idea of division for matrices altogether, and consider what it means for matrix multiplication to be invertible.

To illustrate the use of the inverse matrix, we multiply each side of the equation for AB in (18.1) by A1 as follows:

(18.2)#A1(AB)=A1(5343)

It is very important to recognise that we must do exactly the same thing to both sides of the equation. Since we pre-multiply (left multiply) the left-hand side by A1, we must also pre-multiply the right-hand side by A1.

Due to the non-commutative nature of matrix multiplication, the result A1(AB) is not the same as the result (AB)A1.

Now, since matrix multiplication is associative, the left hand side of (18.2) can be rewritten as (A1A)B, and by the definitions of the inverse and identity matrix, we can write (A1A)B=IB=B in order to obtain

B=A1(5343)

Thus, the result for B can be determined by performing a matrix multiplication, provided that we can find A1.

Solving AX=B and XA=B

Let A be an invertible (n×n) square matrix and B an (n×m) matrix. Then

AX=B has solution X=A1B

XA=B has solution X=BA1.

18.4. Calculating the (2x2) inverse#

The (2x2) matrix that satisfies the definition AA1=A1A=I is outlined in the box below. In section 3.6 we will examine how the result may be derived from first principles, but for now you may simply verify the claim by checking the result of the products AA1 and A1A.

The inverse of a (2x2) matrix

The inverse of a (2x2) matrix A=(a11a12a21a22) is given by

A1=1det(A)adj(A)

where

det(A)=|a11a12a21a22|=a11a22a12a21

and

adj(A)=(a22a12a21a11)

Note that det(A) is a scalar quantity.

det(A) s referred to as the determinant of A. For a (2x2) matrix, the determinant is given by subtracting the product of the anti-diagonal elements from the product of the leading diagonal elements.

adj(A) is known as the adjugate matrix. For a (2x2) matrix, the adjugate is given by swapping the diagonal elements and multiplying the anti-diagonal elements by -1.

Notice the special notation |A| that is used to denote the determinant of A.

Exercise 18.3

1. Calculate the determinant of the matrix M=(2134).

2. Write the equations below in the form Ax=b:

2x3y=13x2y=2

Calculate the coefficient matrix A and hence obtain the solution for x

3. Solve the problem given in (18.1) to find B.

18.5. What it means if det(A)=0#

The value of the determinant can be used to infer whether a given linear system has a unique solution. If the determinant is zero then the matrix A is not invertible and the problem will not have a unique solution.

To illustrate, we will consider two examples of a system of two equations in two unknowns:

(18.3)#2x3y=19y6x=3
(18.4)#2x3y=19y6x=3

Both sets of equations can be written in the form Ax=b, where A=(2369). In that case, det(A)=1818=0, which means that the inverse matrix cannot be calculated and the problems do not have a unique solution for x.

The two equations in (18.3) are inconsistent, and so there is no solution, whilst the two equations in (18.4) have an infinite number of solutions satisfying y=23x13.

You can also think about this problem graphically. In general, the determinant of a (2x2) matrix A is zero if and only if the second row is a constant multiple of the first row. For a problem of the form Ax=b, this means that the two lines have the same gradient. Either the equations represent distinct parallel lines, with no common points, or they represent the same line, with all points in common. In this example, both lines have gradient 2/3.

This brings us to an important theorem which ties together a lot of the ideas we have studied so far.

Invertible Matrix Theorem

Let A be an (n×n) matrix. Then the following statements are equivalent:

  1. A is invertible.

  2. det(A)0.

  3. A has n pivots.

  4. The null space of A is {0}.

  5. The column space of A is Rn.

  6. Ax=b has a unique solution for every bRn.

  7. The columns of A are linearly independent.

Exercise 18.4

Let

A=(101010111).
  1. What is the null space of A ?

  2. Is A is Invertible?

  3. What is det(A)?

18.5.1. Derivation of the (2x2) inverse from first principles#

Consider the problem AX=I, which has solution X=A1. We can solve this problem applying row reduction operations (Gaussian elimination) to the augmented matrix [AI].

The algorithm proceeds as follows:

(18.5)#[AI][UL][IA1]

in which U is an upper-diagonal matrix and L is a lower-diagonal matrix.

For the (2x2) problem we start with the augmented matrix:

A=(a11a1210a21a2201)

the following row operations can be used:

  1. r^2=r2r1a21/a11

  2. r^1=r1/a11, r^2=r2a11/(a11a22a12a21)

  3. r^1=r1r2a12/a11

We obtain

(18.6)#[a11a1210a21a2201][10a22a11a22a12a21a12a11a22a12a2101a21a11a22a12a21a11a11a22a12a21]

from which the following result for the inverse matrix A1 is inferred:

A1=1a11a22a12a21(a22a12a22a11)

The steps that were carried out here were purely algebraic manipulations, and so we can see that the result for A1 can always be computed, providing that a11a22a12a210.

18.6. The (3x3) inverse#

We can extend the method used in the previous section to calculate the inverse of higher order matrices. For example, you could have a go at calculating the inverse of a general (3x3) matrix by Gaussian elimination. The algebra would get very tedious.

However, given the systematic nature of Gaussian elimination, you may not be surprised that there is a pattern that can be spotted, which allows the inverse to be calculated by a recursive method. The result is given in the box below.

The (3x3) inverse formula

The inverse of a (3x3) matrix A is given by

A1=1det(A)adj(A)=1det(A)CAT

where adj(A) is called the adjugate matrix and CA is the (3x3) matrix of cofactors given by

(CA)i,j=(1)i+jMi,j.

The minors Mi,j are the determinants of the (2x2) matrices formed by deleting the ith row and jth column of A.

The determinant satisfies both of the following results, so you can choose either:

det(A)=j=13ai,jCi,j for any choice of row i (expansion by the ith row)

det(A)=i=13ai,jCi,j for any choice of row j (expansion by the jth column)

Let’s unpack this complicated definition by considering an example for

A=(324223517)

Then, we have the following cofactors:

C1,1=(1)1+1|2317|=11,C1,2=(1)1+2|2357|=1,C1,3=(1)1+3|2251|=8,
C2,1=(1)2+1|2417|=10,C2,2=(1)2+2|3457|=1,C2,3=(1)2+3|3251|=7,
C3,1=(1)3+1|2423|=2,C3,2=(1)3+2|3423|=1,C3,3=(1)3+3|3222|=2.

We can find the determinant by expansion of any row or column.

For instance, if we choose to expand by the first row (i=1), we obtain

det(A)=a1,1C1,1+a1,2C1,2+a1,3C1,3=3(11)2(1)+4(8)=3

You may pick any other row or column to expand and you will obtain the same result. For instance, expanding by the third column gives

det(A)=a1,3C1,3+a2,3C2,3+a3,3C3,3=4(8)+3(7)+7(2)=3

The inverse matrix is given by

A1=13(11102111872)

Exercise 18.5

Calculate the inverse of the matrices A and B. Check your answer by checking that A1A=I and B1B=I.

1.

A=(302202011)

2.

B=(041021111)

18.7. Inverse of the Matrix Product#

By associativity of matrix multiplication,

(A1B1)(BA)=A1(B1B)A=A1IA=A1A=I

Therefore,

(BA)1=A1B1

This result satisfies the “common sense” idea (seen in function composition) that inversion comes in reverse order. If transform B follows transform A then we have to reverse transform B before reversing A. We remove the outer operation first.

We can liken the result to the operation of getting dressed/undressed: If you put your socks on before your shoes, you have to take your shoes off before you can remove your socks!

18.7.1. Linking matrix multiplication and Gaussian elimination#

The row-reduction operations that were introduced in the section on Gaussian elimination can be implemented by matrix multiplication. The illustration here matches the example that was given in A systematic technique for solving systems of equations for the augmented coefficient matrix:

(18.7)#A=(112223411113).

In the first step we used the row operations r22r1r2, r3+r1r3, and in the second step we used the row operation r32r2r3. These are equivalent to the following row operation matrices:

L1=(100210101),L2=(100010021)

The composition of these two matrices puts the coefficient matrix into the upper triangular form previously obtained:

(18.8)#L2L1A=(100010021)(112201830235)=(11220183001911).

The additional operations that were carried out to fully row-reduce the matrix can be captured in the following row-reduction matrices:

(18.9)#P=(10001000119),U1=(102018001),U2=(102018001)

You may verify the result:

U2U1PL2L1A=(100151901031190011119)

It is also possible to combine the row reduction operations into a single multiplication matrix:

(18.10)#U2U1PL2L1=119(7110238521)

Later, we will come to think of this as the inverse of the coefficient matrix.

18.8. Transpose Property#

The following result is true in general (provided that A and B can be multiplied). Have a go at proving it for the case where A and B are both (2x2) matrices. a general proof using element notation, is given below.

(AB)T=BTAT

Proof

(AB)Ti,j=(AB)j,i=kAj,kBk,i=kATk,jBTi,k=kBTi,kATk,j=(BTAT)i,j

18.9. Solutions#

Solution to Exercise 18.1

  1. f does not have an inverse because for any negative number y there is no x such that f(x)=y.

  2. g has an inverse and g1(x)=+x.

  3. h does not have an inverse. To prove this, suppose k is the inverse of h. Then h(0,0)=0 so we must have k(0)=(0,0). But also h(1,1)=0 so we must also have k(0)=(1,1). In general, any function which is not one-to-one (injective) does not have an inverse.

Solution to Exercise 18.2

1.

Rπ/2R3π/2=(0110)(0110)=(1001).
R3π/2Rπ/2=(0110)(0110)=(1001).

2.

Rθ1=Rθ=(cosθsinθsinθcosθ).
RθRθ1=(cosθsinθsinθcosθ)(cosθsinθsinθcosθ)=(cos2θ+sin2θcosθsinθ+sinθcosθsinθcosθcosθsinθsin2θ+cos2θ)=(1001).

Similarly,

Rθ1Rθ=(1001).

3.

We left multiply by C1 and right multiply by D1 to obtain X=C1ED1. If you wrote down any other answer then it is incorrect!

Solution to Exercise 18.3

1. detM=(24)(13)=11

2. We have A=(2332), x=(xy), b=(12)

A1=194(2332) so x=15(2332)(12)=15(6243)

That is, x=4/5, y=1/5. (Check it!)

3. B=A1(5343)=13(1221)(5343)=13(583641036)=(1121)

Solution to Exercise 18.4

Reduce A to echelon form:

(101010000).
  1. The null space A is t(101),tR.

  2. A is not invertible. By the invertible matrix theorem a matrix is invertible if and only if its null space is not zero.

  3. By the invertible matrix theorem, det(A)=0.