Injective, surjective and bijective functions and inverses
A thermometer in a classroom in Cork reads 20°C. The formula $F = 1.8C + 32$ turns it into Fahrenheit. Can you always go back again, from any Fahrenheit reading to the one Celsius temperature it came from? For this formula you can. For other functions, such as $f(x) = x^2$, you cannot. This page explains when a function can be reversed and how to find its inverse.
Domain, codomain and range
A function $f: A \to B$ has three sets attached to it.
The range is always inside the codomain, but it may be smaller. For $f:\mathbb{R}\to\mathbb{R}$, $f(x) = x^2$, the codomain is all of $\mathbb{R}$, but squares are never negative, so the range is $[0, \infty)$.
Let $f:\mathbb{R}\to\mathbb{R}$, $f(x) = x^2 + 1$. a) Find the range of $f$. b) Is $f$ surjective? Give a reason. c) Is $f$ bijective? Give a reason.
Let $f:\mathbb{R}\to\mathbb{R}$, $f(x) = x^2 + 1$.
- a) Find the range of $f$.
- b) Is $f$ surjective? Give a reason.
- c) Is $f$ bijective? Give a reason.
Injective, surjective, bijective
Compare two functions using a mapping diagram.
In the left diagram, $-2$ and $2$ share the output 4, so it is not injective. In the right diagram, the function $x + 1$ has domain $\{-1, 0, 1\}$ and codomain $\{0, 1, 2, 3\}$. Nobody maps to 3, so with this codomain it is not surjective. Surjectivity depends on the codomain chosen: $x + 1$ is bijective as a function $\mathbb{R}\to\mathbb{R}$.
Two tests
Horizontal line test. Draw horizontal lines across the graph. If some line cuts the graph more than once, two inputs share an output and $f$ is not injective.
Algebraic test. Assume $f(x_1) = f(x_2)$ and try to prove $x_1 = x_2$. If you can, $f$ is injective. To show a function is not injective, you only need one counter-example: two different inputs with the same output.
Drag the slider $a$: the horizontal line $y = a$ cuts $y = x^2$ twice for every $a > 0$, so $x^2$ fails the test on $\mathbb{R}$.
State whether each function $f:\mathbb{R}\to\mathbb{R}$ is injective (one-to-one), giving a reason. a) $f(x) = 3x + 1$ b) $f(x) = x^2$ c) $f(x) = x^3$
State whether each function $f:\mathbb{R}\to\mathbb{R}$ is injective (one-to-one), giving a reason.
- a) $f(x) = 3x + 1$
- b) $f(x) = x^2$
- c) $f(x) = x^3$
The inverse function
An inverse "undoes" a function. If $f$ sends $x$ to $y$, then $f^{-1}$ sends $y$ back to $x$.
Why bijective? Injective means each output came from only one input, so going back is unambiguous. Surjective means every element of $B$ has something to go back to, so $f^{-1}$ is defined on all of $B$.
The domain of $f^{-1}$ is the range of $f$, and the range of $f^{-1}$ is the domain of $f$.
Method
-
Write $y = f(x)$.
-
Swap roles: solve the equation for $x$ in terms of $y$.
-
Replace $y$ by $x$ in the result to get $f^{-1}(x)$.
-
State the domain of $f^{-1}$ (the range of $f$).
The graph of the inverse
Swapping $x$ and $y$ reflects the graph in the line $y = x$. In the picture below, the lines $y = ax + b$ and its inverse are mirror images across $y = x$.
Rational functions
The same two solutions come from $f(x) = x$: here $x = \dfrac{2x+1}{x-3}$ gives $x^2 - 5x - 1 = 0$ directly, so both meeting points lie on the mirror line $y = x$.
Find the inverse function $f^{-1}(x)$ of $f(x) = 4x - 7$, where $f:\mathbb{R}\to\mathbb{R}$. Verify that $f(f^{-1}(x)) = x$.
Find the inverse function $f^{-1}(x)$ of $f(x) = 4x - 7$, where $f:\mathbb{R}\to\mathbb{R}$. Verify that $f(f^{-1}(x)) = x$.
The temperature in degrees Celsius in a classroom in Cork is converted to Fahrenheit by $F(C) = 1.8C + 32$. a) Find the inverse function $C(F)$. b) Find the Celsius…
The temperature in degrees Celsius in a classroom in Cork is converted to Fahrenheit by $F(C) = 1.8C + 32$.
- a) Find the inverse function $C(F)$.
- b) Find the Celsius temperature when it is 68°F.
- c) Show that the graphs of $F$ and its inverse, when drawn on the same axes with the same variable $x$, meet at exactly one point, and find that point.
Let $f(x) = \dfrac{2x+1}{x-3}$ for $x \in \mathbb{R}\setminus\{3\}$. a) Find $f^{-1}(x)$. b) State the domain of $f^{-1}$. c) Find the values of $x$ for which…
Let $f(x) = \dfrac{2x+1}{x-3}$ for $x \in \mathbb{R}\setminus\{3\}$.
- a) Find $f^{-1}(x)$.
- b) State the domain of $f^{-1}$.
- c) Find the values of $x$ for which $f(x) = f^{-1}(x)$, i.e. solve $f(x)=f^{-1}(x)$ and describe the result.
Restricting the domain
$f(x) = x^2$ is not injective on $\mathbb{R}$, so it has no inverse there. But we can choose a smaller domain on which it is injective. Taking only $x \ge 0$ gives a one-to-one function with the inverse $\sqrt{x}$.
For a quadratic, the turning point splits the parabola into two one-to-one halves. Completing the square tells you where the split is.
Using the derivative
For cubics and other curves, use $f'(x)$. Take $f(x) = x^3 - 3x$. It is not injective on $\mathbb{R}$, since $f(0) = 0 = f(\sqrt3)$. Its derivative is $f'(x) = 3x^2 - 3 = 3(x-1)(x+1)$. This is positive for $x > 1$ and $x < -1$, and negative between $-1$ and $1$. So $f$ is strictly increasing on $[1, \infty)$, hence injective there. Its range on that interval is $[f(1), \infty) = [-2, \infty)$.
Let $f(x) = x^2 - 6x + 5$ with domain $x \geq 3$. a) Write $f(x)$ in the form $(x-p)^2 + q$. b) Explain why $f$ is injective on this domain. c) Find $f^{-1}(x)$ and…
Let $f(x) = x^2 - 6x + 5$ with domain $x \geq 3$.
- a) Write $f(x)$ in the form $(x-p)^2 + q$.
- b) Explain why $f$ is injective on this domain.
- c) Find $f^{-1}(x)$ and state its domain.
Let $f:\mathbb{R}\to\mathbb{R}$, $f(x) = x^3 - 3x$. a) Show that $f$ is not injective by finding two different values of $x$ with the same image. b) Find the largest…
Let $f:\mathbb{R}\to\mathbb{R}$, $f(x) = x^3 - 3x$.
- a) Show that $f$ is not injective by finding two different values of $x$ with the same image.
- b) Find the largest interval of the form $[1, \infty)$ or a subset on which $f$ is injective, justifying using the derivative.
- c) State a codomain for $f$ restricted to $[1,\infty)$ so that it is bijective.
Exponentials and general rational functions
Exponentials and logs
$f(x) = e^{2x} + 1$ is injective because $f'(x) = 2e^{2x} > 0$ for all $x$, so it is strictly increasing. Since $e^{2x}$ takes every positive value, the range is $(1, \infty)$. Taking this as the codomain makes $f$ bijective.
Equations such as $f(x) = f^{-1}(x+2)$ mix $e^{2x}$ with $\ln$, so they cannot usually be solved exactly. Checking that $f^{-1}(f(x)) = x$ is the useful skill.
The general rational function
Let $f(x) = e^{2x} + 1$ for $x \in \mathbb{R}$. a) Prove that $f$ is injective. b) Find the range of $f$ and hence a codomain making $f$ bijective. c) Find $f^{-1}(x)$,…
Let $f(x) = e^{2x} + 1$ for $x \in \mathbb{R}$.
- a) Prove that $f$ is injective.
- b) Find the range of $f$ and hence a codomain making $f$ bijective.
- c) Find $f^{-1}(x)$, state its domain, and solve $f(x) = f^{-1}(x+2)$ or explain why this cannot easily be solved algebraically; instead show that $f^{-1}(f(x)) = x$.
Let $f(x) = \dfrac{ax+b}{cx+d}$ with $ad - bc \neq 0$ and $c\neq 0$. a) Show that $f$ is injective on its domain. b) Find $f^{-1}(x)$. c) Show that $f = f^{-1}$ if and…
Let $f(x) = \dfrac{ax+b}{cx+d}$ with $ad - bc \neq 0$ and $c\neq 0$.
- a) Show that $f$ is injective on its domain.
- b) Find $f^{-1}(x)$.
- c) Show that $f = f^{-1}$ if and only if $a = -d$.