This note introduces the language of functions: what a function is, how to use function notation, how to find the domain and range, and what an inverse function does. These ideas underpin everything else in the Functions topic and are needed again in calculus.
Key ideas
A function is a rule that takes each input from a set of allowed values and gives exactly one output. We write \(f(x)\) for the output when the input is \(x\). So if \(f(x) = 3x - 7\), then \(f(4) = 3(4) - 7 = 5\). You may also see the rule written as \(f: x \mapsto 3x - 7\).
The domain is the set of all allowed inputs (\(x\)-values). The range is the set of all outputs (\(f(x)\)-values) that actually occur. On a graph, the domain is read along the \(x\)-axis and the range is read up the \(y\)-axis.
Some domains are restricted for a reason:
- You cannot divide by zero, so \(x\) values that make a denominator zero are excluded.
- You cannot take the square root of a negative number (in real numbers), so the expression under a root must be at least 0.
- A context can restrict the domain. A function for the height of a ball cannot use negative times.
- The domain may simply be stated, such as \(f(x) = x^2\) for \(x \geq 0\).
The vertical line test. A graph represents a function if every vertical line cuts it at most once. If a vertical line cuts it twice, one input has two outputs, so it is not a function.
Finding the range. The easiest method is to sketch the graph, or to use a GDC, and read the lowest and highest \(y\)-values. Think about whether the graph has a minimum or maximum, or a value it approaches but never reaches.
Inverse functions. The inverse function \(f^{-1}\) undoes \(f\). If \(f(a) = b\), then \(f^{-1}(b) = a\). For an inverse to exist as a function, \(f\) must be one-to-one: each output comes from exactly one input. A graph passes the horizontal line test if every horizontal line cuts it at most once. If it fails, you can sometimes restrict the domain to make the function one-to-one.
To find \(f^{-1}(x)\):
- Write \(y = f(x)\).
- Swap \(x\) and \(y\).
- Rearrange to make \(y\) the subject.
Because inputs and outputs swap roles, the domain of \(f^{-1}\) is the range of \(f\), and the range of \(f^{-1}\) is the domain of \(f\). The graphs of \(y = f(x)\) and \(y = f^{-1}(x)\) are reflections of each other in the line \(y = x\). Composite functions and a fuller treatment of inverses follow in the next note.
Definitions and formulae
| Term or formula | Meaning / when to use |
|---|---|
| Function | A rule giving exactly one output for each allowed input. |
| \(f(a)\) | The output when the input is \(a\). Substitute \(a\) for \(x\). |
| Domain | The set of allowed \(x\)-values. |
| Range | The set of values \(f(x)\) can take. |
| One-to-one | Each output comes from only one input. Needed for an inverse function. |
| \(f^{-1}(x)\) | The inverse function. Found by swapping \(x\) and \(y\) and rearranging. |
| \(\text{dom } f^{-1} = \text{ran } f\) | The domain of the inverse is the range of the original function. |
| Reflection in \(y = x\) | How the graph of \(f^{-1}\) relates to the graph of \(f\). |
Worked examples
Example 1 The function \(f\) is defined by \(f(x) = x^2 - 3x\). (a) Find \(f(5)\). (b) Solve \(f(x) = 10\).
(a) Substitute 5 for \(x\): \(f(5) = 25 - 15 = 10\).
(b) Set the rule equal to 10: \(x^2 - 3x = 10\). Rearrange: \(x^2 - 3x - 10 = 0\).
Factorise: \((x - 5)(x + 2) = 0\), so \(x = 5\) or \(x = -2\).
Check \(x = -2\): \((-2)^2 - 3(-2) = 4 + 6 = 10\). This works. Notice that two inputs give the same output, so this function is not one-to-one over all real numbers.
Answer: (a) 10; (b) \(x = 5\) or \(x = -2\)
Example 2 Find the largest possible domain and the range of \(f(x) = \sqrt{2x - 5} + 1\).
Step 1: the expression under the square root must be at least 0. \(2x - 5 \geq 0\), so \(x \geq 2.5\). The domain is \(x \geq 2.5\).
Step 2: find the smallest output. A square root is never negative, and it equals 0 when \(x = 2.5\). So the smallest value of \(f(x)\) is \(0 + 1 = 1\).
Step 3: as \(x\) increases, \(\sqrt{2x - 5}\) increases without limit, so there is no maximum.
Answer: domain \(x \geq 2.5\); range \(f(x) \geq 1\)
Example 3 The function \(g\) is defined by \(g(x) = 4 - x^2\) for \(x \geq 0\). (a) Find the range of \(g\). (b) Find \(g^{-1}(x)\) and state its domain and range.
(a) At \(x = 0\), \(g(0) = 4\). As \(x\) increases, \(x^2\) increases, so \(g(x)\) decreases without limit. The range is \(g(x) \leq 4\).
(b) Write \(y = 4 - x^2\). Swap \(x\) and \(y\): \(x = 4 - y^2\).
Rearrange: \(y^2 = 4 - x\), so \(y = \pm\sqrt{4 - x}\).
Choose the correct sign. The range of \(g^{-1}\) is the domain of \(g\), which is \(y \geq 0\). So we take the positive root.
\(g^{-1}(x) = \sqrt{4 - x}\). Its domain is the range of \(g\), so \(x \leq 4\). Its range is \(g^{-1}(x) \geq 0\).
Answer: \(g^{-1}(x) = \sqrt{4 - x}\), domain \(x \leq 4\), range \(g^{-1}(x) \geq 0\)
Common errors
- Common error: writing \(f^{-1}(x)\) as \(\dfrac{1}{f(x)}\). The \(-1\) is not a power here. It means the inverse function.
- Common error: giving the range in terms of \(x\). The range is a statement about \(y\) or \(f(x)\), for example \(f(x) \geq 1\).
- Common error: forgetting to restrict the domain before finding an inverse of a function like \(x^2\), or choosing both signs of a square root.
- Common error: using the wrong inequality symbol at the end of a domain. A square root needs the inside to be \(\geq 0\), but a denominator needs the value to be \(\neq 0\).
- Common error: stating the domain of \(f^{-1}\) as the domain of \(f\). It is the range of \(f\).
Exam tip: when asked for a range, sketch the graph first, even roughly. Mark the lowest or highest point and any value the graph approaches but never reaches.
Check yourself
- If \(f(x) = 5 - 2x\), find \(f(-3)\) and the value of \(x\) for which \(f(x) = 11\).
Answer
\(f(-3) = 5 - 2(-3) = 11\). Also \(5 - 2x = 11\) gives \(-2x = 6\), so \(x = -3\). - State the largest possible domain of \(h(x) = \dfrac{3}{x - 2} + 4\) and its range.
Answer
The denominator cannot be 0, so \(x \neq 2\). The fraction \(\dfrac{3}{x - 2}\) can take any value except 0, so \(h(x)\) takes any value except 4. Range: \(h(x) \neq 4\). - Find the inverse of \(f(x) = 3x - 7\).
Answer
Let \(y = 3x - 7\). Swap: \(x = 3y - 7\). Then \(y = \dfrac{x + 7}{3}\). So \(f^{-1}(x) = \dfrac{x + 7}{3}\). - The function \(f(x) = x^2\) is defined for \(x \leq 0\). State the range of \(f\) and find \(f^{-1}(x)\).
Answer
For \(x \leq 0\), \(x^2 \geq 0\), so the range is \(f(x) \geq 0\). Swap: \(x = y^2\), so \(y = \pm\sqrt{x}\). The range of \(f^{-1}\) must be \(y \leq 0\), so \(f^{-1}(x) = -\sqrt{x}\), for \(x \geq 0\).