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 .
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
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
Hence, let us look in the table for for a value of equal to 2. We find that for , , giving us
That is, the -variable is mapped back to 2. Thus,we can say that . 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 , , , , and .
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 to . This function is given by
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 is the subject, as follows:
This new function acts as an inverse of the original. We could equally write these functions in terms of , , and to get
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 , then there is not a single distinct value that can be; it can be either 2 or . We can see this in the graph below.
Therefore, 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 definition of invertibility.
A function is called invertible 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?
For a function to be invertible, it has to be both injective and surjective. As the codomains are not given to us for any of the above functions, ensuring that they are surjective is easy for us to do; we can simply choose the codomain to be equal to the range for each of them. 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,
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,
Here, is a strictly increasing function. This is because if , then . 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,
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, . Applying to these values, we have
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
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 or , 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
- Starting from , we substitute with and with in the expression.
- Next, we rearrange the equation into the form .
- 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 .
To invert a function, we begin by swapping the values of and in . This gives us
Now, we rearrange this into the form .
- We take away 3 from each side of the equation: .
- We multiply each side by 2: .
- We distribute over the parentheses: .
This gives us . We can check that this is the correct inverse function by composing it with the original function as follows:
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, (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 and state the domain.
We begin by swapping and in . This gives us
Now we rearrange the equation in terms of .
- We subtract 3 from both sides: .
- We square both sides: .
Thus, . We can check that this expression is correct by calculating as follows:
So, the expression indeed looks correct. Now, even though it looks as if 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 . First of all, the domain of is , the set of real nonnegative numbers, since cannot take negative values of . Since and equals 0 when , we have
Hence, the range of is . Thus, the domain of is , and its range is .
In conclusion, , for .
The diagram below shows the graph of from the previous example and its inverse . If we extend 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 , 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 , where , and state the domain.
To find the expression for the inverse of , we begin by swapping and in to get
We then proceed to rearrange this in terms of .
- We add 3 to both sides: .
- We take the square root of both sides: .
- We add 2 to each side: .
Thus, we have . Let us verify this by calculating :
As , this is indeed an inverse. Note that the above calculation uses the fact that ; hence, .
Let us now find the domain and range of , and hence . To start with, by definition, the domain of has been restricted to , or . To find the range, we note that 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 has a minimum point when , which gives us . Therefore, its range is . We illustrate this in the diagram below.
Consequently, this means that the domain of is , and its range is . In summary, we have for .
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.
- 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