Calculus

Set Theory

Set Theory Logo

Inverse Functions

Suppose \(f : A \to B\) is a function whose domain is the set \(A\) and whose codomain is the set \(B.\) The function \(f\) is called invertible if there exists a function \(f^{-1} : B \to A\) with the domain \(B\) and the codomain \(A\) such that

\[{{f^{ – 1}}\left( y \right) = x\; \text{ if and only if }\;}\kern0pt{ f\left( x \right) = y,}\]

where \(x \in A,\) \(y \in B.\)

The function \(f^{-1}\) is then called the inverse of \(f.\)

Not all functions have an inverse. If a function \(f\) is not injective, different elements in its domain may have the same image:

\[f\left( {{x_1}} \right) = f\left( {{x_2}} \right) = y_1.\]

Not injective function does not have an inverse.
Figure 1.

In this case, the converse relation \({f^{-1}}\) is not a function because there are two preimages \({x_1}\) and \({x_2}\) for the element \({y_1}\) in the codomain \(B.\) So, to have an inverse, the function must be injective.

If a function \(f\) is not surjective, not all elements in the codomain have a preimage in the domain. In this case, the converse relation \({f^{-1}}\) is also not a function.

Not injective function does not have an inverse.
Figure 2.

Thus, to have an inverse, the function must be surjective.

Recall that a function which is both injective and surjective is called bijective. Hence, to have an inverse, a function \(f\) must be bijective. The converse is also true. If \(f : A \to B\) is bijective, then it has an inverse function \({f^{-1}}.\)

Any bijective function has an inverse function.
Figure 3.

Solved Problems

Click or tap a problem to see the solution.

Example 1

Show that the function \(f:\mathbb{Z} \to \mathbb{Z}\) defined by \(f\left( x \right) = x + 5\) is bijective and find its inverse.

Example 2

Show that the function \(g:\mathbb{R^{+}} \to \mathbb{R^{+}},\) \(f\left( x \right) = x^2\) is bijective and find its inverse.

Example 3

The function \(f: \mathbb{R}\backslash\left\{ 3 \right\} \to \mathbb{R}\backslash\left\{ 1 \right\}\) is defined as \(f\left( x \right) = \large{\frac{{x – 2}}{{x – 3}}}\normalsize.\) Find the inverse function \(f^{-1}.\)

Example 4

The function \(g: \mathbb{R} \to \mathbb{R}^{+}\) is defined as \(g\left( x \right) = {e^{2x + 1}}.\) Find the inverse function \(g^{-1}.\)

Example 5

Consider the function \(f:\mathbb{Z}^2 \to \mathbb{Z}^2\) defined as \(f\left( {x,y} \right) = \left( {2x – y,x + 2y} \right).\) Find the inverse function \({f^{-1}}.\)

Example 1.

Show that the function \(f:\mathbb{Z} \to \mathbb{Z}\) defined by \(f\left( x \right) = x + 5\) is bijective and find its inverse.

Solution.

It is easy to show that the function \(f\) is injective. Using the contrapositive approach, suppose that \({x_1} \ne {x_2}\) but \(f\left( {{x_1}} \right) = f\left( {{x_2}} \right).\) Then we have:

\[{{x_1} + 5 = {x_2} + 5,}\;\; \Rightarrow {{x_1} = {x_2}.}\]

This is a contradiction. Hence, the function \(f\) is injective.

For any \(y \in \mathbb{Z}\) in the codomain of \(f,\) there exists a preimage \(x:\)

\[{y = f\left( x \right) = x + 5,}\;\; \Rightarrow {x = y – 5.}\]

We see that the function \(f\) is surjective, and consequently, it is bijective. The inverse function is given by

\[x = {f^{ – 1}}\left( y \right) = y – 5.\]

Example 2.

Show that the function \(g:\mathbb{R^{+}} \to \mathbb{R^{+}},\) \(f\left( x \right) = x^2\) is bijective and find its inverse.

Solution.

By contradiction, let \({x_1} \ne {x_2}\) but \(g\left( {{x_1}} \right) = g\left( {{x_2}} \right).\) Then

\[{x_1^2 = x_2^2,}\;\; \Rightarrow {\left| {{x_1}} \right| = \left| {{x_2}} \right|.}\]

Since the domain is restricted to the set of positive real numbers, we get \({x_1} = {x_2}.\) This proves that the function \(g\) is injective.

Take an arbitrary positive number \(y \in \mathbb{R^{+}}\) in the codomain of \(g.\) Find the preimage of the number:

\[{y = g\left( x \right) = {x^2},}\;\; \Rightarrow {x = \sqrt y .}\]

It is clear that the preimage \(x\) exists for any positive \(y,\) so the function \(g\) is surjective.

Since the function \(g\) is injective and surjective, it is bijective and has an inverse \(g^{-1}\) that is given by

\[x = {g^{ – 1}}\left( y \right) = \sqrt y .\]

Example 3.

The function \(f: \mathbb{R}\backslash\left\{ 3 \right\} \to \mathbb{R}\backslash\left\{ 1 \right\}\) is defined as \(f\left( x \right) = \large{\frac{{x – 2}}{{x – 3}}}\normalsize.\) Find the inverse function \(f^{-1}.\)

Solution.

First we check that the function \(f\) is bijective.

Let \({x_1} \ne {x_2},\) where \({x_1},{x_2} \ne 1,\) and suppose \(f\left( {{x_1}} \right) = f\left( {{x_2}} \right).\) Then

\[\require{cancel}{\frac{{{x_1} – 2}}{{{x_1} – 3}} = \frac{{{x_2} – 2}}{{{x_2} – 3}},}\;\; \Rightarrow {\left( {{x_1} – 2} \right)\left( {{x_2} – 3} \right) }={ \left( {{x_1} – 3} \right)\left( {{x_2} – 2} \right),}\;\; \Rightarrow {\cancel{{x_1}{x_2}} – 2{x_2} – 3{x_1} + \cancel{6} }={ \cancel{{x_1}{x_2}} – 3{x_2} – 2{x_1} + \cancel{6},}\;\; \Rightarrow {- 2{x_2} – 3{x_1} = – 3{x_2} – 2{x_1},}\;\; \Rightarrow {3{x_2} – 2{x_2} = 3{x_1} – 2{x_1},}\;\; \Rightarrow {{x_2} = {x_1}.}\]

This is a contradiction. Hence, the function \(f\) is injective.

Consider an arbitrary real number \(y\) in the codomain of \(f.\) Determine the preimage of the number \(y\) by solving the equation for \(x:\)

\[{y = f\left( x \right) = \frac{{x – 2}}{{x – 3}},}\;\; \Rightarrow {x – 2 = y\left( {x – 3} \right),}\;\; \Rightarrow {x – 2 = xy – 3y,}\;\; \Rightarrow {xy – x = 3y – 2,}\;\; \Rightarrow {x\left( {y – 1} \right) = 3y – 2,}\;\; \Rightarrow {x = \frac{{3y – 2}}{{y – 1}}.}\]

As you can see, the preimage \(x\) exists for any \(y \ne 1.\) Consequently, the function \(f\) is surjective and, hence, it is bijective. The inverse function \(f^{-1}\) is expressed as

\[x = {f^{ – 1}}\left( y \right) = \frac{{3y – 2}}{{y – 1}}.\]

Example 4.

The function \(g: \mathbb{R} \to \mathbb{R}^{+}\) is defined as \(g\left( x \right) = {e^{2x + 1}}.\) Find the inverse function \(g^{-1}.\)

Solution.

We need to make sure that the function \(g\) is bijective.

By contradiction, suppose \({x_1} \ne {x_2}\) but \(g\left( {{x_1}} \right) = g\left( {{x_2}} \right).\) It then follows that

\[{{e^{2{x_1} + 1}} = {e^{2{x_2} + 1}},}\;\; \Rightarrow {\ln {e^{2{x_1} + 1}} = \ln {e^{2{x_2} + 1}},}\Rightarrow {\left( {2{x_1} + 1} \right)\ln e = \left( {2{x_2} + 1} \right)\ln e,}\;\; \Rightarrow {2{x_1} + 1 = 2{x_2} + 1,}\;\; \Rightarrow {2{x_1} = 2{x_2},}\;\; \Rightarrow {{x_1} = {x_2}.}\]

This proves that \(g\) is injective.

Choose a positive real number \(y.\) Solve the equation \(y = g\left( x \right)\) for \(x:\)

\[{g\left( x \right) = y,}\;\; \Rightarrow {{e^{2x + 1}} = y,}\;\; \Rightarrow {2x + 1 = \ln y,}\;\; \Rightarrow {2x = \ln y – 1,}\;\; \Rightarrow {x = \frac{1}{2}\left( {\ln y – 1} \right).}\]

The preimage \(x\) exists for any \(y\) in the codomain of \(g.\) So, the function is surjective.

Since the function \(g\) is injective and surjective, it is bijective and has an inverse \({g^{-1}},\) which is given by

\[x = {g^{ – 1}}\left( y \right) = \frac{1}{2}\left( {\ln y – 1} \right).\]

Example 5.

Consider the function \(f:\mathbb{Z}^2 \to \mathbb{Z}^2\) defined as \(f\left( {x,y} \right) = \left( {2x – y,x + 2y} \right).\) Find the inverse function \({f^{-1}}.\)

Solution.

Check the function \(f\) for injectivity. Suppose that \(\left( {{x_1},{y_1}} \right) \ne \left( {{x_2},{y_2}} \right)\) but \(f\left( {{x_1},{y_1}} \right) = f\left( {{x_2},{y_2}} \right).\) Then

\[{\left( {2{x_1} – {y_1},{x_1} + 2{y_1}} \right) }={ \left( {2{x_2} – {y_2},{x_2} + 2{y_2}} \right),}\;\;\Rightarrow {\left\{ {\begin{array}{*{20}{l}} {2{x_1} – {y_1} = 2{x_2} – {y_2}}\\ {{x_1} + 2{y_1} = {x_2} + 2{y_2}} \end{array}} \right..}\]

Solve the system of equation for \(\left( {{x_2},{y_2}} \right).\) To eliminate \({y_2},\) we multiply the first equation by \(2\) and add both equations:

\[{\left\{ {\begin{array}{*{20}{l}} {2{x_1} – {y_1} = 2{x_2} – {y_2}}\\ {{x_1} + 2{y_1} = {x_2} + 2{y_2}} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{l}} {4{x_1} – 2{y_1} = 4{x_2} – 2{y_2}}\\ {{x_1} + 2{y_1} = {x_2} + 2{y_2}} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{l}} {5{x_1} = 5{x_2}}\\ {{x_1} + 2{y_1} = {x_2} + 2{y_2}} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{l}} {{x_1} = {x_2}}\\ {{x_1} + 2{y_1} = {x_2} + 2{y_2}} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{l}} {{x_1} = {x_2}}\\ {2{y_1} = 2{y_2}} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{l}} {{x_1} = {x_2}}\\ {{y_1} = {y_2}} \end{array}} \right..}\]

Since \(\left( {{x_1},{y_1}} \right) = \left( {{x_2},{y_2}} \right),\) we get a contradiction. So, the function \(f\) is injective.

Check the surjectivity of the function \(f.\) Let \(\left( {a,b} \right)\) be an arbitrary pair of real numbers in the codomain of \(f.\) Solve the equation \(f\left( {x,y} \right) = \left( {a,b} \right)\) to express \(x,y\) in terms of \(a,b.\)

\[{\left( {2x – y,x + 2y} \right) = \left( {a,b} \right),}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{c}} {2x – y = a}\\ {x + 2y = b} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{c}} {y = 2x – a}\\ {x + 2\left( {2x – a} \right) = b} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{c}} {y = 2x – a}\\ {x + 4x – 2a = b} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{c}} {y = 2x – a}\\ {5x = 2a + b} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{c}} {y = 2x – a}\\ {x = \frac{{2a + b}}{5}} \end{array}} \right.,}\;\; \Rightarrow {\left\{ {\begin{array}{*{20}{c}} {x = \frac{{2a + b}}{5}}\\ {y = \frac{{2b – a}}{5}} \end{array}} \right..}\]

Thus, we can always determine the preimage \(\left( {x,y} \right)\) for any image \(\left( {a,b} \right).\) Hence, the function is surjective and bijective.

The inverse of the function \({f^{-1}}\) has already been found above. It is given by

\[{\left( {x,y} \right) = {f^{ – 1}}\left( {a,b} \right) }={ \left( {\frac{{2a + b}}{5},\frac{{2b – a}}{5}} \right).}\]

We can check the result given that \(f\left( {x,y} \right) = \left( {a,b} \right):\)

\[{f\left( {x,y} \right) = \left( {2x – y,x + 2y} \right) }={ \left( {2 \cdot \frac{{2a + b}}{5} – \frac{{2b – a}}{5},}\right.}\kern0pt{\left.{\frac{{2a + b}}{5} + 2 \cdot \frac{{2b – a}}{5}} \right) }={ \left( {\frac{{4a + \cancel{2b} – \cancel{2b} + a}}{5},}\right.}\kern0pt{\left.{\frac{{\cancel{2a} + b + 4b – \cancel{2a}}}{5}} \right) }={ \left( {\frac{{5a}}{5},\frac{{5b}}{5}} \right) }={ \left( {a,b} \right).}\]