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

Lesson Explainer: Inverse of a Function Mathematics

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 𝑓(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𝑥


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.


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=212𝑥+36=𝑥+66=𝑥.

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.


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)=𝑥+33=𝑥=𝑥.

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 𝑓(𝑥)=𝑥+30+33.

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.


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

Download the Nagwa Classes App

Attend sessions, chat with your teacher and class, and access class-specific questions. Download the Nagwa Classes app today!

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