What makes a function
A function is a rule that takes each input from a set called the domain and gives back exactly one output. A vending machine is a good picture: press one button, get one item. If one button could give two different items, it would not be a function.
On a graph, use the vertical line test: if any vertical line meets the graph more than once, the relation is not a function. A circle fails; a parabola \(y = x^2\) passes.
Notation
\(f(x) = 3x - 2\) names the function \(f\) and its rule. \(f(4) = 10\) means "input 4 gives output 10". The mapping form \(f : x \mapsto 3x - 2\) says the same thing. Writing \(f(a + 1)\) means replacing every \(x\) with \((a + 1)\), brackets included.
Domain and range
The domain is the set of inputs allowed. Unless one is stated, take the largest set of real numbers for which the rule makes sense. The two usual restrictions are:
- no division by zero, and
- no square root of a negative number (and, later, no log of a non-positive number).
The range is the set of outputs actually produced. Find it by thinking about the graph: what \(y\)-values does the curve reach?
Worked example
Let \(f(x) = \sqrt{x - 3}\).
- Domain: \(x - 3 \ge 0\), so \(x \ge 3\).
- Range: the square root is never negative and takes the value 0 at \(x = 3\), so \(f(x) \ge 0\).
- Inverse: write \(y = \sqrt{x - 3}\), swap to \(x = \sqrt{y - 3}\), square to \(x^2 = y - 3\), so \(f^{-1}(x) = x^2 + 3\) with domain \(x \ge 0\).
The domain of \(f^{-1}\) is the range of \(f\), which is why the restriction \(x \ge 0\) is essential: without it, \(x^2 + 3\) would not undo \(f\).
Inverse functions
The inverse \(f^{-1}\) reverses \(f\): if \(f(a) = b\) then \(f^{-1}(b) = a\). Graphically, \(y = f^{-1}(x)\) is the reflection of \(y = f(x)\) in the line \(y = x\), because inputs and outputs swap. An inverse exists only if \(f\) is one-to-one: no two inputs give the same output (the horizontal line test). This is why \(x^2\) needs its domain restricted, for example to \(x \ge 0\), before it has an inverse.
Functions as models
A function can describe a real situation, such as the height \(h(t)\) of a ball \(t\) seconds after it is thrown. Then the domain is limited by context: \(t\) cannot be negative and stops when the ball lands. Always ask whether the mathematical domain matches the real one.
Common mistakes
- Thinking \(f^{-1}(x)\) means \(\frac{1}{f(x)}\).
- Giving the range as the domain of the rule rather than the outputs.
- Forgetting to restrict the domain of an inverse.
- Using strict instead of non-strict inequalities at endpoints, e.g. writing \(x > 3\) for \(\sqrt{x - 3}\).
Exam tips
- Sketch the graph quickly to see the range; it avoids algebra slips.
- State domain and range with inequalities or interval notation and include the variable (\(x\) for domain, \(f(x)\) or \(y\) for range).
- For an inverse, the four steps are: write \(y =\), swap \(x\) and \(y\), rearrange, rename as \(f^{-1}(x)\).