Lesson Explainer: Inverse of a Function | Nagwa Lesson Explainer: Inverse of a Function | Nagwa

Lesson Explainer: Inverse of a Function Mathematics • Second Year of Secondary School

In this explainer, we will learn how to find the inverse of a function by changing the subject of the formula.

As the concept of the inverse of a function builds on the concept of a function, let us first recall some key definitions and notation related to functions.

Definition: Functions and Related Concepts

A functionΒ π‘“βˆΆπ‘‹βŸΆπ‘Œ maps an input π‘₯ belonging to the domain 𝑋 to an output 𝑓(π‘₯) belonging to the codomainΒ π‘Œ. The range of 𝑓(π‘₯) is the set of all values 𝑓(π‘₯) can possibly take, varying π‘₯ over the domain. We denote it by 𝑓(𝑋).

A function is called injective (or one-to-one) if every input has one unique output. If it is not injective, then it is many-to-one, and many inputs can map to the same output.

A function is called surjective (or onto) if the codomain π‘Œ is equal to the range 𝑓(𝑋). That is, every element of π‘Œ can be written in the form 𝑓(π‘₯) for some π‘₯βˆˆπ‘‹.

A function is bijective if it is both injective and surjective.

We note that since the codomain is something that we choose when we define a function, in most cases it will be useful to set it to be equal to the range, so that the function is surjective by default.

Having revisited these terms relating to functions, let us now discuss what the inverse of a function is.

The inverse of a function is a function that β€œreverses” that function. If 𝑓(π‘₯)=𝑦, then the inverse of 𝑓, which we denote by π‘“οŠ±οŠ§, returns the original π‘₯ when applied to 𝑦. This is demonstrated below.

This applies to every element π‘₯ in the domain 𝑋, and every element 𝑦 in the range π‘Œ. So if we know that 𝑓(π‘₯)=𝑦, we have 𝑓(𝑦)=π‘₯. We demonstrate this idea in the following example.

Example 1: Evaluating a Function and Its Inverse from Tables of Values

The following tables are partially filled for functions 𝑓 and 𝑔 that are inverses of each other. Determine the values of π‘Ž, 𝑏, 𝑐, 𝑑, and 𝑒.

π‘₯1234𝑑6
𝑓(π‘₯)βˆ’31π‘Žβˆ’19βˆ’10114
π‘₯βˆ’31βˆ’26βˆ’19βˆ’101𝑒
𝑔(π‘₯)12𝑏𝑐56

Answer

Recall that if a function maps an input π‘₯ to an output 𝑦, then π‘“οŠ±οŠ§ maps the variable 𝑦 to π‘₯.

Since 𝑓(π‘₯) and 𝑔(π‘₯) are inverses of each other, to find the values of each of the unknown variables, we simply have to look in the other table for the corresponding values.

For example, in the first table, we have 𝑓(2)=π‘Ž.

Here, 2 is the π‘₯-variable and π‘Ž is the 𝑦-variable. We know that the inverse function maps the 𝑦-variable back to the π‘₯-variable. In other words, we want to find a value of 𝑔 such that 𝑔(π‘Ž)=2.

Hence, let us look in the table for 𝑔 for a value of 𝑔(π‘₯) equal to 2. We find that for 𝑔(π‘₯)=2, π‘₯=βˆ’26, giving us 𝑔(βˆ’26)=2.

That is, the 𝑦-variable βˆ’26 is mapped back to 2. Thus,we can say that π‘Ž=βˆ’26. We can repeat this process for every variable, each time matching π‘₯ in one table to 𝑓(π‘₯) or 𝑔(π‘₯) in the other, and find their counterparts as follows.

This gives us π‘Ž=βˆ’26, 𝑏=3, 𝑐=4, 𝑑=5, and 𝑒=14.

We have now seen the basics of how inverse functions work, but why might they be useful in the first place? One reason, for instance, might be that we want to reverse the action of a function. As an example, suppose we have a function for temperature (𝑇) that converts degreesCelsiusC()∘ to degreesFahrenheitF()∘. This function is given by 𝑇=95𝑇+32.∘∘FC

Naturally, we might want to perform the reverse operation. That is, convert degrees Fahrenheit to degrees Celsius. This can be done by rearranging the above so that 𝑇()∘C is the subject, as follows: π‘‡βˆ’32=95𝑇59(π‘‡βˆ’32)=𝑇.∘∘∘∘FCFC

This new function acts as an inverse of the original. We could equally write these functions in terms of 𝑓, π‘₯, and 𝑦 to get 𝑓(π‘₯)=95π‘₯+32=𝑦,𝑓(𝑦)=59(π‘¦βˆ’32)=π‘₯.

Let us now formalize this idea, with the following definition.

Definition: Inverse Function

Let π‘“βˆΆπ‘‹βŸΆπ‘Œ be a function. Then, provided 𝑓 is invertible, the inverse of 𝑓 is the function π‘“βˆΆπ‘ŒβŸΆπ‘‹οŠ±οŠ§ with the property 𝑓(π‘₯)=π‘¦βŸΊπ‘“(𝑦)=π‘₯.

Note that we specify that 𝑓 has to be invertible in order to have an inverse function. This is because it is not always possible to find the inverse of a function. Suppose, for example, that we have 𝑓(π‘₯)=π‘₯,π‘“βˆΆβ„βŸΆβ„.

Here, if we have π‘₯=4, then there is not a single distinct value that π‘₯ can be; it can be either 2 or βˆ’2. We can see this in the graph below.

Therefore, 𝑓(4) does not have a distinct value and cannot be defined. Specifically, the problem stems from the fact that 𝑓(π‘₯)=π‘₯ is a many-to-one function. Thus, one requirement for a function to be invertible is that it must be injective (or one-to-one).

One additional problem can come from the definition of the codomain. In the above definition, we require that π‘“βˆΆπ‘‹βŸΆπ‘Œ and π‘“βˆΆπ‘ŒβŸΆπ‘‹οŠ±οŠ§. That is, the domain of 𝑓 is the codomain of π‘“οŠ±οŠ§ and vice versa. This could create problems if, for example, we had a function like 𝑓(π‘₯)=𝑒,π‘“βˆΆβ„βŸΆβ„.

An exponential function can only give positive numbers as outputs. Hence, the range of 𝑓 is β„οŠ°, which we demonstrate below, by projecting the graph on to the 𝑦-axis.

On the other hand, the codomain is (by definition) the whole of ℝ. If we tried to define an inverse function π‘“βˆΆβ„βŸΆβ„οŠ±οŠ§, then π‘“οŠ±οŠ§ is not defined for any negative number in the domain, which means the inverse function cannot exist. In general, if the range is not equal to the codomain, then the inverse function cannot be defined everywhere. Thus, we require that an invertible function must also be surjective; That is, 𝑓(𝑋)=π‘Œ. Note that we could easily solve the problem in this case by choosing π‘Œ=β„οŠ° when we define the function, which would allow us to properly define an inverse.

The above conditions (injective and surjective) are necessary prerequisites for a function to be invertible. As it turns out, if a function fulfils these conditions, then it must also be invertible. This is because, to invert a function, we just need to be able to relate every point π‘₯ in the domain to a unique point 𝑦 in the codomain. If we can do this for every point, then we can simply reverse the process to invert the function. Thus, we have the following theorem which tells us when a function is invertible.

Theorem: Invertibility

A function 𝑓 is invertible if and only if it is bijective (i.e., it is both injective and surjective), that is, if every input has one unique output and everything in the codomain can be related back to something in the domain.

Let us test our understanding of the above requirements with the following example.

Example 2: Determining Whether Functions Are Invertible

Which of the following functions does not have an inverse over its whole domain? Assume that the codomain of each function is equal to its range.

  1. 𝑓(π‘₯)=2
  2. 𝑓(π‘₯)=π‘₯
  3. 𝑓(π‘₯)=2π‘₯
  4. 𝑓(π‘₯)=1π‘₯

Answer

For a function to be invertible, it has to be both injective and surjective. As it was given that the codomain of each of the given functions is equal to its range, this means that the functions are surjective. Hence, let us focus on testing whether each of these functions is injective, which in turn will show us whether they are invertible.

In option A, 𝑓(π‘₯)=2.

First of all, we note that as this is an exponential function, with base 2 that is greater than 1, it is a strictly increasing function. This means that π‘₯>π‘₯βŸΉπ‘“(π‘₯)>𝑓(π‘₯).

Now suppose we have two unique inputs π‘₯ and π‘₯; will the outputs 𝑓(π‘₯) and 𝑓(π‘₯) be unique? If π‘₯ and π‘₯ are unique, then one must be greater than the other. That means either π‘₯>π‘₯ or π‘₯>π‘₯. But, in either case, the above rule shows us that 𝑓(π‘₯) and 𝑓(π‘₯) are different. Hence, unique inputs result in unique outputs, so the function is injective. Therefore, by extension, it is invertible, and so the answer cannot be A.

In option B, 𝑓(π‘₯)=π‘₯.

For a function to be injective, each value of π‘₯ must give us a unique value for 𝑓(π‘₯). However, in the case of the above function, for all π‘₯βˆˆβ„, we have π‘₯=(βˆ’π‘₯).

Since unique values for the input of π‘₯ and βˆ’π‘₯ give us the same output of |π‘₯|, 𝑓(π‘₯)=π‘₯ is not an injective function. Hence, it is not invertible, and so B is the correct answer. However, let us proceed to check the other options for completeness.

In option C, 𝑓(π‘₯)=2π‘₯.

Here, 𝑓 is a strictly increasing function. This is because if π‘₯>π‘₯, then 2π‘₯>2π‘₯. Thus, by the logic used for option A, it must be injective as well, and hence invertible. So we have confirmed that C is not correct.

In option D, 𝑓(π‘₯)=1π‘₯.

Unlike for options A and C, this is not a strictly increasing function, so we cannot use this argument to show that it is injective. However, we can use a similar argument. Let us suppose we have two unique inputs, π‘₯β‰ π‘₯β‰ 0. Applying 𝑓 to these values, we have 𝑓(π‘₯)=1π‘₯,𝑓(π‘₯)=1π‘₯.

If these two values were the same for any unique π‘₯ and π‘₯, the function would not be injective. However, if they were the same, we would have 1π‘₯=1π‘₯.

Taking the reciprocal of both sides gives us π‘₯=π‘₯.

So, the only situation in which 𝑓(π‘₯)=𝑓(π‘₯) is when π‘₯=π‘₯ (i.e., they are not unique). Hence, 𝑓 is injective, and, by extension, it is invertible. So we have confirmed that D is not correct.

Note that in the previous example, although the function 𝑓(π‘₯)=π‘₯ in option B does not have an inverse over its whole domain, if we restricted the domain to [0,∞[ or ]βˆ’βˆž,0], the function would be bijective and would have an inverse of √π‘₯ or βˆ’βˆšπ‘₯.

We have now seen under what conditions a function is invertible and how to invert a function value by value. However, we have not properly examined the method for finding the full expression of an inverse function.

We recall from our earlier example of a function that converts between degrees Fahrenheit and degrees Celsius that we were able to invert it by rearranging the equation in terms of the other variable. Let us generalize this approach now.

Recall that for a function 𝑓, the inverse function π‘“οŠ±οŠ§ satisfies 𝑓(π‘₯)=π‘¦βŸΊπ‘“(𝑦)=π‘₯.

So, to find an expression for π‘“οŠ±οŠ§, we want to find an expression where 𝑦 is the input and π‘₯ is the output. With respect to 𝑓(π‘₯)=𝑦, this means we are swapping π‘₯ and 𝑦. Thus, to invert the function, we can follow the steps below.

How To: Finding the Inverse of a Function Algebraically

  1. Starting from 𝑓(π‘₯)=𝑦, we substitute π‘₯ with 𝑦 and 𝑦 with π‘₯ in the expression.
  2. Next, we rearrange the equation into the form 𝑦=𝑓(π‘₯).
  3. Finally, we find the domain and range of 𝑓 (if necessary) and set the domain of π‘“οŠ±οŠ§ equal to the range of 𝑓 and the range of π‘“οŠ±οŠ§ equal to the domain of 𝑓.

After having calculated an expression for the inverse, we can additionally test whether it does indeed behave like an inverse. Recall that an inverse function obeys the following relation.

Note that if we apply 𝑓 to any π‘₯, followed by π‘“οŠ±οŠ§, we get back π‘₯. Equally, we can apply π‘“οŠ±οŠ§ to 𝑦, followed by 𝑓, to get back 𝑦. This leads to the following useful rule.

Rule: The Composition of a Function and its Inverse

Let 𝑓 be a function and π‘“οŠ±οŠ§ be its inverse. Then the expressions for the compositions π‘“βˆ˜π‘“οŠ±οŠ§ and π‘“βˆ˜π‘“οŠ±οŠ§ are both equal to the identity function. That is, 𝑓(𝑓(π‘₯))=π‘₯,𝑓𝑓(𝑦)=𝑦.

In the case where the domains and the ranges of 𝑓 and π‘“οŠ±οŠ§ are equal, then for any π‘₯ in the domain, we have 𝑓(𝑓(π‘₯))=𝑓𝑓(π‘₯)=π‘₯.

Let us see an application of these ideas in the following example.

Example 3: Finding the Inverse of a Linear Function Algebraically

Find 𝑓(π‘₯) for 𝑓(π‘₯)=12π‘₯+3.

Answer

To invert a function, we begin by swapping the values of π‘₯ and 𝑦 in 12π‘₯+3=𝑦. This gives us 12𝑦+3=π‘₯.

Now, we rearrange this into the form 𝑦=𝑓(π‘₯).

  1. We take away 3 from each side of the equation: 12𝑦=π‘₯βˆ’3.
  2. We multiply each side by 2: 𝑦=2(π‘₯βˆ’3).
  3. We distribute over the parentheses: 𝑦=2π‘₯βˆ’6.

This gives us 𝑓(π‘₯)=2π‘₯βˆ’6. We can check that this is the correct inverse function by composing it with the original function as follows: 𝑓(𝑓(π‘₯))=2(𝑓(π‘₯))βˆ’6=2ο€Ό12π‘₯+3οˆβˆ’6=π‘₯+6βˆ’6=π‘₯.

As this is the identity function, this is indeed correct. Note that we could also check that 𝑓𝑓(π‘₯)=π‘₯.

Finally, although not required here, we can find the domain and range of π‘“οŠ±οŠ§. Since 𝑓 can take any real number, and it outputs any real number, its domain and range are both ℝ. Hence, π‘“οŠ±οŠ§ also has a domain and range of ℝ.

In conclusion, 𝑓(π‘₯)=2π‘₯βˆ’6 (and π‘“βˆΆβ„βŸΆβ„οŠ±οŠ§).

In the previous example, we demonstrated the method for inverting a function by swapping the values of π‘₯ and 𝑦. However, little work was required in terms of determining the domain and range. In the next example, we will see why finding the correct domain is sometimes an important step in the process.

Example 4: Finding the Inverse of a Square Root Function Algebraically

Find 𝑓(π‘₯) for 𝑓(π‘₯)=√π‘₯+3 and state the domain.

Answer

We begin by swapping π‘₯ and 𝑦 in √π‘₯+3=𝑦. This gives us βˆšπ‘¦+3=π‘₯.

Now we rearrange the equation in terms of 𝑦.

  1. We subtract 3 from both sides: βˆšπ‘¦=π‘₯βˆ’3.
  2. We square both sides: 𝑦=(π‘₯βˆ’3).

Thus, 𝑓(π‘₯)=(π‘₯βˆ’3). We can check that this expression is correct by calculating 𝑓(𝑓(π‘₯)) as follows: 𝑓(𝑓(π‘₯))=(𝑓(π‘₯)βˆ’3)=ο€Ίβˆšπ‘₯+3βˆ’3=ο€Ίβˆšπ‘₯=π‘₯.

So, the expression indeed looks correct. Now, even though it looks as if 𝑓(π‘₯)=(π‘₯βˆ’3) can take any values of π‘₯, its domain and range are dependent on the domain and range of 𝑓. That is, to find the domain of π‘“οŠ±οŠ§, we need to find the range of 𝑓(π‘₯)=√π‘₯+3. First of all, the domain of 𝑓 is β„οŠ¦οŠ°, the set of real nonnegative numbers, since √π‘₯ cannot take negative values of π‘₯. Since √π‘₯β‰₯0 and equals 0 when π‘₯=0, we have 𝑓(π‘₯)=√π‘₯+3β‰₯0+3β‰₯3.

Hence, the range of 𝑓 is [3,∞[. Thus, the domain of π‘“οŠ±οŠ§ is [3,∞[, and its range is β„οŠ¦οŠ°.

In conclusion, 𝑓(π‘₯)=(π‘₯βˆ’3), for π‘₯β‰₯3.

The diagram below shows the graph of 𝑓(π‘₯)=√π‘₯+3 from the previous example and its inverse 𝑓(π‘₯)=(π‘₯βˆ’3). If we extend (π‘₯βˆ’3) to the whole real number line, we actually get a parabola that is many-to-one and hence not invertible. Hence, by restricting the domain to π‘₯β‰₯3, we have only half of the parabola, and it becomes a valid inverse for 𝑓(π‘₯).

Thus, finding an inverse function may only be possible by restricting the domain to a specific set of values. In the final example, we will demonstrate how this works for the case of a quadratic function.

Example 5: Finding the Inverse of a Quadratic Function Algebraically

Find 𝑓(π‘₯) for 𝑓(π‘₯)=(π‘₯βˆ’2)βˆ’3, where π‘₯β‰₯2, and state the domain.

Answer

To find the expression for the inverse of 𝑓, we begin by swapping π‘₯ and 𝑦 in (π‘₯βˆ’2)βˆ’3=π‘¦οŠ¨ to get (π‘¦βˆ’2)βˆ’3=π‘₯.

We then proceed to rearrange this in terms of 𝑦.

  1. We add 3 to both sides: (π‘¦βˆ’2)=π‘₯+3.
  2. We take the square root of both sides: π‘¦βˆ’2=√π‘₯+3.
  3. We add 2 to each side: 𝑦=√π‘₯+3+2.

Thus, we have 𝑓(π‘₯)=√π‘₯+3+2. Let us verify this by calculating 𝑓(𝑓(π‘₯)): βˆšπ‘“(π‘₯)+3+2=(π‘₯βˆ’2)βˆ’3+3+2=(π‘₯βˆ’2)+2=|π‘₯βˆ’2|+2=π‘₯.

As 𝑓𝑓(π‘₯)=π‘₯, this is indeed an inverse. Note that the above calculation uses the fact that π‘₯β‰₯2; hence, |π‘₯βˆ’2|=π‘₯βˆ’2.

Let us now find the domain and range of 𝑓, and hence π‘“οŠ±οŠ§. To start with, by definition, the domain of 𝑓 has been restricted to π‘₯β‰₯2, or [2,∞[. To find the range, we note that 𝑓(π‘₯)=(π‘₯βˆ’2)βˆ’3 is a quadratic function, so it must take the form of (part of) a parabola. Therefore, we try and find its minimum point.

Since 𝑓 is in vertex form, we know that (π‘₯βˆ’2)βˆ’3 has a minimum point when π‘₯=2, which gives us 𝑓(2)=βˆ’3. Therefore, its range is 𝑦β‰₯βˆ’3. We illustrate this in the diagram below.

Consequently, this means that the domain of π‘“οŠ±οŠ§ is π‘₯β‰₯βˆ’3, and its range is 𝑦β‰₯2. In summary, we have 𝑓(π‘₯)=√π‘₯+3+2 for π‘₯β‰₯βˆ’3.

Note that in the previous example, it is not possible to find the inverse of a quadratic function if its domain is not restricted to β€œhalf” or less than β€œhalf” of the parabola. (Here, with β€œhalf” of a parabola, we mean the part of a parabola on either side of its symmetry line π‘₯=β„Ž, where β„Ž is the π‘₯-coordinate of its vertex.) Indeed, if we were to try to invert the full parabola, we would get the orange graph below, which does not correspond to a proper function.

Let us finish by reviewing some of the key things we have covered in this explainer.

Key Points

  • Let π‘“βˆΆπ‘‹βŸΆπ‘Œ be a function. Then, provided 𝑓 is invertible, the inverse of 𝑓 is the function π‘“βˆΆπ‘ŒβŸΆπ‘‹οŠ±οŠ§ with the following property: 𝑓(π‘₯)=π‘¦βŸΊπ‘“(𝑦)=π‘₯.
  • We note that the domain and range of the inverse function are swapped around compared to the original function.
  • A function is invertible if it is bijective (i.e., both injective and surjective). Note that we can always make an injective function invertible by choosing the codomain to be equal to the range.
  • We can find the inverse of a function by swapping π‘₯ and 𝑦 in its 𝑦=𝑓(π‘₯) form and rearranging the equation in terms of 𝑦. We can find its domain and range by calculating the domain and range of the original function and swapping them around.
  • We can verify that an inverse function is correct by showing that 𝑓(𝑓(π‘₯))=π‘₯𝑓𝑓(𝑦)=𝑦.or

Join Nagwa Classes

Attend live sessions on Nagwa Classes to boost your learning with guidance and advice from an expert teacher!

  • Interactive Sessions
  • Chat & Messaging
  • Realistic Exam Questions

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy