Pure · Functions and Graphs · Year 2

Mapping Functions

Not every rule that connects inputs to outputs deserves to be called a function. Before chaining functions together or running them backwards, it pays to be precise about what a function actually is — and exactly which inputs and outputs it's allowed to touch.

8 min read 3 worked examples

What is a mapping?

A mapping is any rule that connects each element of one set (the inputs) to one or more elements of another set (the outputs). A function is a special, more restrictive kind of mapping: one where every input is sent to exactly one output — never zero, never two or more. We write $f:x \mapsto x^2$ or $f(x)=x^2$ to mean "$f$ sends $x$ to $x^2$".

The set of permitted inputs is the domain; the set of outputs the mapping actually produces is the range (sometimes called the image). Both must always be stated, or inferable from context, for a function to be fully defined — the same algebraic rule can behave completely differently depending on what domain it's paired with.

Four types of mapping

Every mapping falls into exactly one of four categories, depending on how many outputs each input produces and how many inputs share each output:

The four types

One-one (injective): every input has its own distinct output — no two different inputs ever share an output. Example: $f(x)=2x+1$.

Many-one: every input has exactly one output, but different inputs are allowed to share an output. Example: $f(x)=x^2$, since $f(2)=f(-2)=4$.

One-many: a single input produces more than one output. Example: "$y$ such that $y^2=x$" sends $x=4$ to both $y=2$ and $y=-2$.

Many-many: some inputs produce multiple outputs, and some outputs come from multiple inputs at once.

Only one-one and many-one mappings qualify as functions, since both send every input to a single output. One-many and many-many mappings fail the basic requirement of a function and are excluded entirely.

The vertical and horizontal line tests

On a graph, the vertical line test checks whether a mapping is a function at all: if any vertical line crosses the graph more than once, some input produces two different outputs, so it isn't a function. The horizontal line test then distinguishes one-one from many-one: if every horizontal line crosses the graph at most once, the function is one-one; if some horizontal line crosses it more than once, the function is many-one.

Why this distinction matters

Whether a function is one-one turns out to be the deciding factor in whether it can be run backwards at all — a question taken up in full once composite functions have been covered.

Domain and range

Finding the domain of a function defined by an algebraic expression means asking: for which real values of $x$ does this expression actually produce a real number? Two restrictions come up constantly in A-level work:

Two standard restrictions

Division by zero: if $f(x)$ contains a fraction $\frac{1}{g(x)}$, then $g(x)\neq0$ must be excluded from the domain.

Square roots: if $f(x)$ contains $\sqrt{g(x)}$, then $g(x)\ge0$ is required for a real output, so the domain is restricted accordingly.

Finding the range is a different exercise: it means tracking what values the output actually takes as $x$ varies across the whole domain — often done by completing the square (for a quadratic), considering the graph's turning points, or checking which values an expression can never reach (such as a horizontal asymptote for a reciprocal function).

Worked example 1

Finding the domain of a function with two restrictions
Find the domain of $f(x) = \dfrac{1}{x-3} + \sqrt{x+2}$.
MethodApply each restriction separately, then combine them
1
The fraction $\frac{1}{x-3}$ requires $x-3\neq0$, so $x\neq3$.
Division by zero is undefined.
2
The square root $\sqrt{x+2}$ requires $x+2\ge0$, so $x\ge-2$.
A real square root needs a non-negative argument.
3
Both conditions must hold at once: the domain is $x\ge-2$, $x\neq3$.
Combine the two restrictions — neither alone is sufficient.
▪ solved
The key insight

Every distinct source of restriction in an expression — every fraction, every square root — contributes its own condition. Missing one of them is the most common error when finding a domain.

Worked example 2

Finding the range of a quadratic function
Find the range of $f(x) = 2x^2-8x+11$ for $x\in\mathbb{R}$.
MethodComplete the square to locate the minimum value
1
$f(x) = 2x^2-8x+11 = 2(x^2-4x)+11 = 2\left[(x-2)^2-4\right]+11$.
Complete the square inside the bracket first.
2
$f(x) = 2(x-2)^2-8+11 = 2(x-2)^2+3$.
Multiply out and simplify.
3
Since $(x-2)^2\ge0$ for every real $x$, the minimum value of $f$ occurs when $(x-2)^2=0$, i.e. at $x=2$, giving $f(2)=3$.
A squared real term can never be negative.
4
As $x$ moves away from $2$ in either direction, $f(x)$ increases without bound, so the range is $f(x)\ge3$.
A positive coefficient on the squared term means the parabola opens upward from its minimum.
▪ solved

Worked example 3

Classifying a restricted mapping and finding its range
$f(x)=x^2-4x+7$ for $x\ge3$. Explain why $f$ is one-one on this domain, and find its range.
MethodLocate the vertex, then check the restricted domain lies entirely on one monotonic branch
1
Completing the square: $f(x) = (x-2)^2+3$, so the graph is a parabola with vertex at $(2,3)$.
The vertex is where the function switches from decreasing to increasing.
2
On $x\in\mathbb{R}$, $f$ is many-one: it decreases up to $x=2$, then increases, so pairs of inputs either side of $x=2$ share outputs.
This is exactly the behaviour the horizontal line test would flag.
3
The restricted domain $x\ge3$ lies entirely to the right of the vertex $x=2$, where $f$ is strictly increasing.
Once past the vertex, every larger input gives a strictly larger output.
4
A strictly increasing function can never repeat an output, so $f$ is one-one on $x\ge3$.
No horizontal line can cross a strictly increasing curve twice.
5
$f(3) = 9-12+7 = 4$, and $f$ increases for all $x>3$, so the range is $f(x)\ge4$.
The smallest output on the restricted domain occurs at its left-hand endpoint, x = 3.
▪ solved
Look ahead

Restricting a many-one function's domain until it becomes one-one — exactly as done here — is precisely the technique used later to make a function invertible.

Common mistake

Mixing up domain and range — writing a restriction on $x$ when the question asks for the set of possible $f(x)$ values, or vice versa. The domain lives on the input axis; the range lives on the output axis. It's also easy to find only one of two restrictions on a domain (e.g. checking a square root but forgetting a fraction in the same expression) — always scan the whole expression for every source of restriction.

Check yourself

$f(x) = \dfrac{3}{x+1} - 2$. State the domain of $f$, and find its range.
(Hint: for the range, ask whether the output can ever actually equal −2.)

Method
1
The fraction $\frac{3}{x+1}$ requires $x+1\neq0$, so the domain is $x\neq-1$.
Division by zero is undefined.
2
Setting $f(x)=-2$ gives $\frac{3}{x+1}=0$, which has no solution since a fraction with a non-zero numerator can never equal zero.
Check directly whether the suspected excluded value is ever actually attained.
3
So $f(x)=-2$ is impossible: the range is $f(x)\neq-2$.
−2 is a horizontal asymptote the graph approaches but never reaches.
▪ solved