Concept of a Function

A function is a rule that turns one input into exactly one output. Get that idea straight and everything else this unit, notation, domain, range and graphs, follows naturally.

MYP 5Extended MathsFunctionsCriteria A · C · D~10 min read

Functions as mappings

Think of a function as a little machine. You drop a number in, the machine does something to it, and a single number comes out. The set of things you are allowed to put in is the input, and what comes back is the output. Mathematicians call this a mapping: each input is mapped to an output.

The one rule that makes a mapping a function is strict: every input must give exactly one output. One in, one out. An input is never allowed to produce two different answers at once.

Function
A rule that assigns to each input value exactly one output value. If a single input could give two outputs, the rule is a relation but not a function.

A mapping diagram makes this visible: draw the inputs on the left, the outputs on the right, and an arrow from each input to its output. For a function, exactly one arrow leaves each input. Two arrows leaving the same input would break the rule. It is fine, though, for two different inputs to land on the same output: that still counts as a function.

Where this is assessed

Defining and identifying functions sits in Criterion A (knowing and understanding). Writing your working with correct \(f(x)\) notation is Criterion C (communicating), and using a function to model a situation reaches into Criterion D (applying maths in context).

Function notation \(f(x)\)

Instead of writing "the machine" every time, we give it a name, usually the letter \(f\), and write the rule as \(f(x)\), read aloud as "\(f\) of \(x\)". Here \(x\) is the input and \(f(x)\) is the output. So if

\[ f(x) = 2x + 3 \]

then to find the output for an input of \(4\) you replace every \(x\) with \(4\): \(f(4) = 2(4) + 3 = 11\). The notation \(f(4)\) does not mean \(f\) multiplied by \(4\); it means "the output of \(f\) when the input is \(4\)".

Read the bracket as "put in"

Every time you see \(f(\;\text{something}\;)\), read it as "put that something in for \(x\)". This works even when the something is another expression: \(f(a+1)\) just means replace \(x\) with \(a+1\) everywhere.

Domain and range

Two words describe the inputs and outputs of a function, and examiners love them because they sound harder than they are.

Domain
The complete set of inputs the function is allowed to take (all the values you may put in for \(x\)).
Range
The complete set of outputs the function actually produces (all the values \(f(x)\) can come out as).

Sometimes the domain is handed to you as a short list. Sometimes it is "all real numbers" apart from any input that would break the maths, such as a value that makes you divide by zero. For example, \(f(x) = \dfrac{1}{x-4}\) works for every real number except \(x = 4\), because \(x = 4\) would mean dividing by zero. So its domain is "all real \(x\) with \(x \neq 4\)".

Worked example

The function \(f(x) = 3x - 1\) has the domain \(\{-1,\ 0,\ 1,\ 2\}\). List the range.

1
Put each input into the rule in turn. Start with \(x = -1\): \(f(-1) = 3(-1) - 1 = -4\).
2
\(x = 0\): \(f(0) = 3(0) - 1 = -1\).
3
\(x = 1\): \(f(1) = 3(1) - 1 = 2\).
4
\(x = 2\): \(f(2) = 3(2) - 1 = 5\). Collect the four outputs into a set.
Range \(= \{-4,\ -1,\ 2,\ 5\}\)

The vertical line test

When a rule is drawn as a graph, there is a one-glance way to check whether it is a function: the vertical line test. Imagine sliding a vertical line across the graph from left to right. If the line ever touches the graph in two or more places at once, the graph is not a function, because that single \(x\)-value would have more than one output.

Why does it work? A vertical line is a set of points that all share the same \(x\). If the graph meets that line twice, one input \(x\) has produced two outputs, and that is exactly what a function is not allowed to do.

A circle is not a function

The graph of a circle, or the sideways parabola \(x = y^2\), both fail the test: a vertical line through the middle cuts them twice. They are perfectly good curves, just not functions of \(x\).

A straight line like \(y = 2x + 1\), a parabola like \(y = x^2\), and an exponential curve all pass the test: no vertical line ever meets them more than once, so each is a function.

Check yourself

Try these before opening the answers. Show the working, not just the final value.

1. If \(f(x) = 5 - 2x\), find \(f(3)\). +

Replace every \(x\) with \(3\): \(f(3) = 5 - 2(3) = 5 - 6\). So \(f(3) = -1\).

2. State the domain of \(f(x) = \dfrac{1}{x-4}\). +

The only forbidden input is the one that makes the bottom zero. Set \(x - 4 = 0\), which gives \(x = 4\). Every other real number is allowed, so the domain is all real \(x\) with \(x \neq 4\).

3. Does the equation \(x = y^2\) give \(y\) as a function of \(x\)? Use the vertical line test. +

Take an input such as \(x = 4\). Then \(y^2 = 4\), so \(y = 2\) or \(y = -2\): one input, two outputs. A vertical line at \(x = 4\) cuts the curve twice, so it fails the test. No, \(y\) is not a function of \(x\) here.


Part of the Extended Maths library. Spotted an error or want a topic added? That feedback makes the notes better.