Back to homeMathematics · 6th Year HL · Change subject
Start for free
6th Year HL · Mathematics
Proof by Induction, Functions and Coordinate Geometry of the Circle · Functions and Circles

Types of functions, inverses and composites

Met Éireann gives tomorrow's forecast in °C, but your cousin in Boston wants it in °F. The rule $F = 1.8C + 32$ is a function: each temperature in °C gives exactly one temperature in °F. To go the other way, you need to undo the rule. That "undoing" function is called the inverse, and it exists only for certain kinds of functions. This page shows you which ones, how to build the inverse, and how to combine functions one after another.

Domain, codomain, range and types of function

A function $f: A \to B$ is a rule that sends each element of the domain $A$ to exactly one element of the codomain $B$.

For $f(x) = x^2$ with $f:\mathbb{R}\to\mathbb{R}$, the domain and codomain are both $\mathbb{R}$, but the range is only $[0, \infty)$, because a square is never negative.

Three words describe how a function behaves:

The horizontal line test makes this visual. Draw horizontal lines across the graph:

  • if no horizontal line cuts the graph more than once, $f$ is injective;

  • if every horizontal line through the codomain cuts the graph at least once, $f$ is surjective.

Graph of y equals x squared with the horizontal line y equals 2 cutting it at two points, showing the function is not injective. y = 2 f(x) = x²

The line $y = 2$ cuts the parabola at $x = \pm\sqrt{2}$. Two different inputs give the same output, so $f(x) = x^2$ on $\mathbb{R}$ is not injective. The line $y = -1$ never cuts it, so $f$ is not surjective onto $\mathbb{R}$.

By contrast, $f(x) = x^3$ on $\mathbb{R}\to\mathbb{R}$ is bijective: every horizontal line cuts the graph exactly once.

Completing the square

To find the range of a quadratic, or to make it injective by restricting its domain, you need to know where its turning point is. Completing the square gives it straight away.

The reason it works: $(x + \tfrac b2)^2$ expands to $x^2 + bx + \tfrac{b^2}{4}$, which has an extra $\tfrac{b^2}{4}$ that you must take away again.

Move the sliders to see how $(x-a)^2 + b$ has its turning point at $(a, b)$.

Practice★☆☆Not started
Write $f(x) = x^2 - 6x + 11$ in the form $(x-a)^2 + b$ by completing the square. Hence state the minimum value of $f$ and the value of $x$ at which it occurs.

Write $f(x) = x^2 - 6x + 11$ in the form $(x-a)^2 + b$ by completing the square. Hence state the minimum value of $f$ and the value of $x$ at which it occurs.

Solve

Composite functions

Hiring a boat, then applying a discount; converting °C to °F, then rounding: often one function is applied straight after another. This is a composite function.

The order matters. Work from the inside out.

For $f(g(x))$ to exist, every output of $g$ must be an allowed input of $f$. For example, with $f(x) = \sqrt{x}$ and $g(x) = x - 4$, $f(g(x)) = \sqrt{x-4}$ only makes sense for $x \ge 4$.

Practice★☆☆Not started
Let $f:\mathbb{R}\to\mathbb{R}$ be given by $f(x) = 3x - 5$ and $g:\mathbb{R}\to\mathbb{R}$ by $g(x) = x^2 + 1$. a) Find $f(g(2))$. b) Find $g(f(2))$. c) Find…

Let $f:\mathbb{R}\to\mathbb{R}$ be given by $f(x) = 3x - 5$ and $g:\mathbb{R}\to\mathbb{R}$ by $g(x) = x^2 + 1$.

  1. a) Find $f(g(2))$.
  1. b) Find $g(f(2))$.
  1. c) Find expressions for $f(g(x))$ and $g(f(x))$.
Solve
Practice★★☆Not started
The cost in euro of hiring a boat on Lough Derg for $h$ hours is $C(h) = 15h + 20$. A discount function $D(c) = 0.9c$ applies to any cost $c$. a) Find $D(C(h))$ and…

The cost in euro of hiring a boat on Lough Derg for $h$ hours is $C(h) = 15h + 20$. A discount function $D(c) = 0.9c$ applies to any cost $c$.

  1. a) Find $D(C(h))$ and interpret it.
  1. b) Find the inverse of $D\circ C$ and use it to find how many hours can be hired for €72.
Solve

Inverse functions

The inverse $f^{-1}$ undoes $f$: if $f$ sends $a$ to $b$, then $f^{-1}$ sends $b$ back to $a$.

Why does it need to be bijective? If two inputs gave the same output, the inverse would not know which one to go back to. If some codomain value is never hit, the inverse would have nothing to send it to.

Because the graph of $f^{-1}$ is the reflection of the graph of $f$ in $y = x$, any point where the graph of $f$ meets the line $y = x$ is also on the graph of $f^{-1}$. So the graphs of $f$ and $f^{-1}$ meet the line $y = x$ at the same points, namely where $f(x) = x$.

The graphs below show $f(x) = 2x - 3$ (its inverse is $\frac{x+3}{2}$) and the mirror line $y = x$.

Some inverses need more algebra. Here the unknown appears twice.

Practice★☆☆Not started
Find the inverse function $f^{-1}(x)$ of $f(x) = \frac{2x+1}{3}$, $x \in \mathbb{R}$. Verify that $f(f^{-1}(x)) = x$.

Find the inverse function $f^{-1}(x)$ of $f(x) = \frac{2x+1}{3}$, $x \in \mathbb{R}$. Verify that $f(f^{-1}(x)) = x$.

Solve
Practice★★★Not started
Let $f(x) = \frac{x+2}{x-1}$ for $x\in\mathbb{R}$, $x\neq 1$. a) Show that $f$ is injective. b) Find $f^{-1}(x)$ and show that $f^{-1} = f$. c) Hence find $f(f(x))$ and…

Let $f(x) = \frac{x+2}{x-1}$ for $x\in\mathbb{R}$, $x\neq 1$.

  1. a) Show that $f$ is injective.
  1. b) Find $f^{-1}(x)$ and show that $f^{-1} = f$.
  1. c) Hence find $f(f(x))$ and explain the result.
Solve

Restricting the domain to get an inverse

A quadratic is not injective on $\mathbb{R}$, so it has no inverse there. But if you keep only one side of the turning point, it becomes bijective, and then an inverse exists. This is called restricting the domain (and the codomain, to the range).

To show a function is injective without a graph, assume $f(a) = f(b)$ and prove $a = b$. For the rational function above this works by cross-multiplying. For a quadratic on a restricted domain, completing the square shows which side of the turning point you are on.

Practice★★☆Not started
The function $f:\mathbb{R}\to\mathbb{R}$ is defined by $f(x) = x^2 - 4x + 7$. a) Is $f$ injective? Justify your answer. b) Is $f$ surjective? Justify your answer. c)…

The function $f:\mathbb{R}\to\mathbb{R}$ is defined by $f(x) = x^2 - 4x + 7$.

  1. a) Is $f$ injective? Justify your answer.
  1. b) Is $f$ surjective? Justify your answer.
  1. c) Restrict the domain to $[2, \infty)$ and the codomain to $[3,\infty)$. Show that $f$ is then bijective and find $f^{-1}(x)$.
Solve
Practice★★★Not started
Let $f(x) = 2x^2 + 8x + 3$ for $x \geq -2$. a) Express $f(x)$ in the form $a(x+p)^2 + q$. b) Find the range of $f$ and show that $f$ is bijective onto its range. c) Find…

Let $f(x) = 2x^2 + 8x + 3$ for $x \geq -2$.

  1. a) Express $f(x)$ in the form $a(x+p)^2 + q$.
  1. b) Find the range of $f$ and show that $f$ is bijective onto its range.
  1. c) Find $f^{-1}(x)$ and sketch, in words, the relationship between the graphs of $f$ and $f^{-1}$. Find the point where the graph of $f^{-1}$ meets the line $y = x$, if such a point exists.
Solve

Exponential and logarithmic functions as inverses

The functions $e^x$ and $\ln x$ are the standard example of an inverse pair.

The domain and range swap, as the inverse rule says. Their graphs are mirror images in $y = x$.

To find the inverse of a function involving $e^x$, isolate $e^{\ldots}$ and then take $\ln$ of both sides.

When a question involves sums of logarithms, use the rules from Formulae and Tables: $\ln a + \ln b = \ln(ab)$, and $\ln a - \ln b = \ln\frac{a}{b}$. Then, if $\ln A = \ln B$, it follows that $A = B$.

Practice★★☆Not started
Let $f(x) = e^{2x}$ for $x\in\mathbb{R}$. a) State the range of $f$. b) Find $f^{-1}(x)$ and state its domain. c) Solve $f(x) = 5$, giving your answer correct to three…

Let $f(x) = e^{2x}$ for $x\in\mathbb{R}$.

  1. a) State the range of $f$.
  1. b) Find $f^{-1}(x)$ and state its domain.
  1. c) Solve $f(x) = 5$, giving your answer correct to three decimal places.
Solve
Practice★★★Not started
Let $f(x) = \ln(x-1)$ for $x>1$ and $g(x) = e^x + 1$ for $x \in\mathbb{R}$. a) Show that $f$ and $g$ are inverses of each other. b) Find $f(g(x))$ and $g(f(x))$, stating…

Let $f(x) = \ln(x-1)$ for $x>1$ and $g(x) = e^x + 1$ for $x \in\mathbb{R}$.

  1. a) Show that $f$ and $g$ are inverses of each other.
  1. b) Find $f(g(x))$ and $g(f(x))$, stating the domain in each case.
  1. c) Solve $f(x) + f(x+1) = \ln 6$ for $x$.
Solve

Back to the temperatures: $F = 1.8C + 32$ is bijective, and its inverse is $C = \dfrac{F - 32}{1.8}$. Check: a forecast of $68^\circ$F gives $\dfrac{68-32}{1.8} = \dfrac{36}{1.8} = 20^\circ$C. ✓

Summary

See all the exercises in this section