Lesson 1 · Inverse Function

Inverse Function

Optional MathematicsSubject
8 minEstimated read

What Happens When the Arrows Are Reversed

A function sends every element of its domain to exactly one element of its codomain. In an arrow diagram, this means every element on the left has exactly one arrow leaving it. A natural question follows. If we turn every arrow round, so that it points back from the codomain to the domain, is the result still a function? The answer depends on the function, and the two functions below show both possible outcomes.

The first function is \( f: A \to B \), where \( A = \{1, 3, 5, 7\} \) and \( B = \{0, 1, -2, 4\} \). As ordered pairs it is:

\[ f = \{(1, 0), (3, 1), (5, 0), (7, 4)\} \]

The second function is \( g: X \to Y \), where \( X = \{1, 2, 3, 4\} \) and \( Y = \{3, 4, 5, 6\} \). As ordered pairs it is:

\[ g = \{(1, 3), (2, 4), (3, 5), (4, 6)\} \]

Both of these are functions, because each element of the domain has exactly one arrow leaving it. The domain of f is {1, 3, 5, 7} and its codomain is {0, 1, -2, 4}. The domain of g is {1, 2, 3, 4} and its codomain is {3, 4, 5, 6}. Look carefully at the two diagrams before reading on. In the first, two arrows land on 0 and no arrow lands on -2. In the second, every element of Y receives exactly one arrow.

The function f from A to B. Both 1 and 5 are sent to 0, and nothing is sent to -2.
The function f from A to B. Both 1 and 5 are sent to 0, and nothing is sent to -2.
The function g from X to Y. Every element of Y is reached by exactly one arrow.
The function g from X to Y. Every element of Y is reached by exactly one arrow.

Reversing a Function That Fails

Turning every arrow of f round means interchanging its domain and codomain. Each ordered pair is reversed, so (1, 0) becomes (0, 1), (3, 1) becomes (1, 3), and so on. The result is a relation from B to A. Call it \( R_1 \):

\[ R_1: B \to A = \{(0, 1), (1, 3), (0, 5), (4, 7)\} \]

This relation is not a function, and there are two separate reasons for it:

  • The element 0 of B is related to two elements, 1 and 5. A function may give each element of its domain only one image.
  • The element -2 of B is related to nothing at all. A function must give every element of its domain an image.

Notice where each fault came from. The first exists because f sent two different elements, 1 and 5, to the same image 0. The second exists because no element of A was sent to -2, so -2 had no partner in f. So when the domain and codomain of f are interchanged, no function is defined. These two faults are exactly what the condition for an inverse will rule out.

Reversing a Function That Works

Now reverse g in the same way, interchanging X and Y. Call the result \( R_2 \):

\[ R_2: Y \to X = \{(3, 1), (4, 2), (5, 3), (6, 4)\} \]

This time every element of Y, which is now the domain, is related to exactly one element of X. So \( R_2 \) is a function. Reversing g kept it a function, because g never sent two elements to the same place and it left no element of Y unused. The two reversals are drawn side by side below so you can compare them.

The arrows of f and g turned round. R1, from B to A, sends 0 to two places and -2 nowhere, so it is not a function. R2, from Y to X, gives every element one partner, so it is a function.
The arrows of f and g turned round. R1, from B to A, sends 0 to two places and -2 nowhere, so it is not a function. R2, from Y to X, gives every element one partner, so it is a function.

The Inverse Function

When the domain and codomain of a function are interchanged and the result is still a function, that new function is called the inverse function of the original. \( R_2 \) above is the inverse of g. \( R_1 \) is not the inverse of f, because it is not a function at all.

Definition

Inverse function: if interchanging the domain and codomain of a function f(x) still gives a function, that function is called the inverse function of f(x). It is written \( f^{-1}(x) \) or \( f^{-1} \), and it is read as 'inverse function of f'.

In the same way, the inverse of g is written \( g^{-1}(x) \) or \( g^{-1} \) and read as 'inverse function of g'. So in the example above, \( g^{-1} = \{(3, 1), (4, 2), (5, 3), (6, 4)\} \).

Interchanging the domain and the codomain means that the roles of x and y are interchanged. The inputs of the inverse are the outputs of the function, and the outputs of the inverse are the inputs of the function. This gives the rule used for every formula in this lesson:

Key idea

If \( y = f(x) \), then for the inverse the roles of x and y are swapped. This gives \( x = f(y) \), and solving it for y is written as \( y = f^{-1}(x) \).

Put simply, an inverse function undoes what the function did. g takes 2 to 4, and \( g^{-1} \) takes 4 back to 2. g takes 4 to 6, and \( g^{-1} \) takes 6 back to 4.

Common mistake

\( f^{-1}(x) \) does not mean \( \frac{1}{f(x)} \). The -1 is part of the name of a new function. It is not a power. For \( f(x) = 3x - 5 \), the reciprocal is \( \frac{1}{3x - 5} \), but the inverse function is \( f^{-1}(x) = \frac{x + 5}{3} \), as worked out later in this lesson.

When Does an Inverse Function Exist?

Two questions are worth thinking about here. Must a function be one-to-one and onto for its inverse to be defined? And can every function have an inverse function? The two reversals above already answer both.

A function is one-to-one when different elements of the domain always have different images. It is onto when every element of the codomain is the image of some element of the domain. A function that is both is called a one-to-one onto function.

The function f failed on both counts. It was not one-to-one, since 1 and 5 shared the image 0. It was not onto, since -2 was the image of nothing. Each failure became a fault in the reverse: a double arrow leaving 0 and no arrow leaving -2. The function g was one-to-one and onto, and its reverse had no faults.

Key idea

The inverse of a function f: A → B is a function from B to A only when f is a one-to-one onto function. So not every function has an inverse function. Before finding \( f^{-1}(x) \), f must be one-to-one onto.

Here is one more function with no inverse. Let \( h(x) = x^2 \) with domain {-2, -1, 1, 2} and codomain {1, 4}. Then \( h = \{(-2, 4), (-1, 1), (1, 1), (2, 4)\} \). This function is onto, but it is not one-to-one, because -2 and 2 both give 4. Reversing it gives \( \{(4, -2), (1, -1), (1, 1), (4, 2)\} \), in which 4 is related to two elements. So h has no inverse function.

For a function given by a formula on the real numbers, one-to-one is checked by showing that equal images come only from equal preimages. For \( f(x) = 3x - 5 \): if \( 3a - 5 = 3b - 5 \), then \( 3a = 3b \), so \( a = b \). Two different inputs can never share an output, so every image has its own preimage.

Inverse of a Function Given as Ordered Pairs

When a one-to-one onto function is given as a set of ordered pairs, its inverse is found by reversing every pair. The first member becomes the second and the second becomes the first. Nothing else changes.

Worked example: f is a one-to-one onto function and \( f = \{(1, 1), (2, 4), (3, 9), (4, 16)\} \). Find \( f^{-1} \) as ordered pairs and show both f and \( f^{-1} \) in arrow diagrams.

Step 1: Writing down the function as given:

\[ f = \{(1, 1), (2, 4), (3, 9), (4, 16)\} \]

Step 2: Reversing every ordered pair, so that each image is paired back with the element it came from:

\[ f^{-1} = \{(1, 1), (4, 2), (9, 3), (16, 4)\} \]

In the arrow diagrams, f runs from A = {1, 2, 3, 4} to B = {1, 4, 9, 16}. The inverse runs from B back to A along the same arrows turned round. So f takes 3 to 9, and \( f^{-1} \) takes 9 back to 3. f takes 4 to 16, and \( f^{-1} \) takes 16 back to 4.

The function f from A to B, sending 1, 2, 3, 4 to 1, 4, 9, 16.
The function f from A to B, sending 1, 2, 3, 4 to 1, 4, 9, 16.
The inverse function from B back to A, sending 1, 4, 9, 16 back to 1, 2, 3, 4.
The inverse function from B back to A, sending 1, 4, 9, 16 back to 1, 2, 3, 4.

Finding the Inverse from a Formula

Most functions in this lesson are given by a formula rather than a list of pairs. The same idea of swapping x and y gives the inverse. The method has four steps, and you use it in every question:

Step 1: The function is written with y standing for the output:

\[ y = f(x) \]

Step 2: Every x and every y in the equation are interchanged.

Step 3: The new equation is rearranged to make y the subject.

Step 4: The y that now stands alone is replaced by the inverse notation:

\[ f^{-1}(x) \]

Worked example: \( f(x) = 3x - 5 \) is a function, where \( x \in R \) and R is the set of real numbers. Is f a one-to-one onto function? If it is, find \( f^{-1}(x) \).

First, check the condition. Every image has a different preimage: if two images are equal, their preimages are equal, as shown in the section above. Also, every real number y is an image, because the real number \( \frac{y + 5}{3} \) is sent to it. So f is one-to-one onto, and its inverse function is defined. Now find it.

Step 1: Writing the function with y in place of f(x):

\[ y = 3x - 5 \]

Step 2: Interchanging x and y:

\[ x = 3y - 5 \]

Step 3: Adding 5 to both sides to get the y term alone:

\[ x + 5 = 3y \]

Step 4: Dividing both sides by 3 to make y the subject:

\[ y = \frac{x + 5}{3} \]

Step 5: Replacing y by the name of the inverse:

\[ f^{-1}(x) = \frac{x + 5}{3} \]

Checking an Inverse

An inverse undoes the function, so putting \( f^{-1}(x) \) into f must give back x. This makes every answer easy to check. For the example above, substitute \( \frac{x + 5}{3} \) in place of x in f:

\[ f\left(\frac{x + 5}{3}\right) = 3 \times \frac{x + 5}{3} - 5 \]

\[ = x + 5 - 5 = x \]

It returns x, so the inverse is correct. A check with one number works just as well. Since \( f(2) = 3 \times 2 - 5 = 1 \), the inverse must take 1 back to 2, and indeed \( f^{-1}(1) = \frac{1 + 5}{3} = 2 \).

Using the Inverse to Find an Unknown

Once \( f^{-1}(x) \) is known as a formula, it can be set equal to something and solved like any equation.

Worked example: \( f(x) = \frac{x + 3}{2} \) is a one-to-one onto function and \( f^{-1}(x) = x \). Find the value of x.

Step 1: Writing the function with y:

\[ y = \frac{x + 3}{2} \]

Step 2: Interchanging x and y:

\[ x = \frac{y + 3}{2} \]

Step 3: Multiplying both sides by 2 to clear the fraction:

\[ 2x = y + 3 \]

Step 4: Subtracting 3 from both sides and naming y as the inverse:

\[ f^{-1}(x) = 2x - 3 \]

Step 5: Using the given condition \( f^{-1}(x) = x \):

\[ 2x - 3 = x \]

Step 6: Taking x to the left and -3 to the right:

\[ 2x - x = 3 \]

Step 7: Simplifying the left side:

\[ x = 3 \]

This answer makes sense. \( f(3) = \frac{3 + 3}{2} = 3 \), so the function sends 3 to itself. The inverse, which reverses every arrow, must then also send 3 to itself, and that is exactly what \( f^{-1}(x) = x \) asked for.

Inverse and Composite Functions Together

An inverse function can be combined with another function to make a composite function. The expression \( f^{-1}g(x) \) means \( f^{-1}(g(x)) \): first find g(x), then apply the inverse of f to the result. To do this you need the formula for \( f^{-1}(x) \) first.

Order of working

In \( f^{-1}g(x) \), the function written next to x acts first. Apply g first, then \( f^{-1} \). Working in the other order, \( g(f^{-1}(x)) \), gives a different answer.

Worked example: \( f(x) = \frac{3x + 4}{5} \) and \( g(x) = 8x - 3 \) are two one-to-one onto functions. Find the value of \( f^{-1}g(1) \).

Step 1: Writing f with y:

\[ y = \frac{3x + 4}{5} \]

Step 2: Interchanging x and y:

\[ x = \frac{3y + 4}{5} \]

Step 3: Multiplying both sides by 5:

\[ 5x = 3y + 4 \]

Step 4: Subtracting 4 from both sides:

\[ 5x - 4 = 3y \]

Step 5: Dividing by 3 and naming y as the inverse:

\[ f^{-1}(x) = \frac{5x - 4}{3} \]

Step 6: Forming the composite by putting \( g(x) = 8x - 3 \) in place of x in the inverse:

\[ f^{-1}g(x) = \frac{5(8x - 3) - 4}{3} \]

Step 7: Expanding the bracket and collecting the numbers:

\[ f^{-1}g(x) = \frac{40x - 15 - 4}{3} = \frac{40x - 19}{3} \]

Step 8: Putting x = 1:

\[ f^{-1}g(1) = \frac{40 \times 1 - 19}{3} = \frac{21}{3} = 7 \]

A shorter route gives the same answer and is a good check. First \( g(1) = 8 \times 1 - 3 = 5 \). Then \( f^{-1}(5) = \frac{5 \times 5 - 4}{3} = \frac{21}{3} = 7 \). Both routes agree, so \( f^{-1}g(1) = 7 \).

Equations Mixing Composite and Inverse Functions

Some questions put a composite function on one side and an inverse on the other, and ask for x. Work out each side as an expression in x, then set them equal and solve.

Worked example: \( f(x) = 3x - 2 \) and \( g(x) = \frac{x - 4}{5} \) are two one-to-one onto functions. If \( ff(x) = g^{-1}(x) \), find the value of x.

Step 1: Finding ff(x), which means applying f twice:

\[ ff(x) = f(f(x)) = f(3x - 2) \]

Step 2: Putting 3x - 2 in place of x in the formula for f:

\[ ff(x) = 3(3x - 2) - 2 = 9x - 8 \]

Step 3: Writing g with y, ready to find its inverse:

\[ y = \frac{x - 4}{5} \]

Step 4: Interchanging x and y:

\[ x = \frac{y - 4}{5} \]

Step 5: Multiplying by 5 gives 5x = y - 4, and adding 4 makes y the subject:

\[ g^{-1}(x) = 5x + 4 \]

Step 6: Setting the two expressions equal, as the question states:

\[ 9x - 8 = 5x + 4 \]

Step 7: Collecting the x terms on the left and the numbers on the right:

\[ 9x - 5x = 4 + 8 \]

Step 8: Simplifying both sides:

\[ 4x = 12 \]

Step 9: Dividing both sides by 4:

\[ x = 3 \]

Check: \( f(3) = 7 \), so \( ff(3) = f(7) = 19 \). Also \( g^{-1}(3) = 5 \times 3 + 4 = 19 \). Both sides give 19, so x = 3 is correct.

🔐

The full lesson is waiting for you

The notes are free to read in full. A free account opens the rest of the practice, and tracks your progress and confidence score for every subject. Presentations and videos need approval from Learn Yeti.