Step 3: Functions and Inverses
- A function gives exactly one output for each input in its domain. The set of outputs it actually produces is its range.
- \( fg(x) \) means \( f(g(x)) \): apply \( g \) first, then \( f \). It only exists when every output of \( g \) is an input \( f \) accepts.
- Only one-one functions have an inverse. Find \( f^{-1} \) by making \( x \) the subject and swapping letters. Domain and range swap, and the graph reflects in \( y = x \).
- Exam point: changes outside the bracket act on \( y \) as written; changes inside act on \( x \) in reverse, so \( f(x + 3) \) moves the graph 3 units left.
What a function is
Calculus studies functions, so it pays to be fluent with them. Think of a function as a machine. You feed in an input, it applies a fixed rule, and it hands back one output. We name the machine \( f \) and write the output for input \( x \) as \( f(x) \). Cambridge also writes \( f : x \mapsto 4-x^2 \), which means the same as \( f(x) = 4-x^2 \).
A function is one-one if different inputs always give different outputs, and many-one if some output comes from two or more inputs. Two line tests read this off a graph. If a vertical line can meet a graph twice, one \( x \) has two outputs, so the graph is not a function (a circle fails). If a horizontal line can meet the graph of a function twice, two inputs share an output, so the function is many-one (a \( \cup \)-shaped parabola fails).
\( f(x) = 4-x^2 \) for \( x \in \mathbb{R} \). Find \( f(-3) \), solve \( f(x) = -12 \), and decide whether \( f \) is one-one.
The brackets in step 1 matter: \( -3^2 \) would be read as \( -9 \), but \( (-3)^2 = 9 \).
Some graphs have built-in symmetry. A function is even if \( f(-x) = f(x) \) for every \( x \) in its domain (mirror symmetry in the y-axis, like \( x^4 + x^2 \)), and odd if \( f(-x) = -f(x) \) (symmetry under a half-turn about the origin, like \( x^3-4x \)). Most functions are neither. IB lists this test in the HL content.
Domain and range
Two plain questions describe any function. Which inputs are allowed? That set is the domain. Which outputs come out? That set is the range. On a graph, the domain is the spread of x-values covered and the range is the spread of y-values.
If no domain is stated, take the largest set of real numbers the rule can handle. At this level only two things go wrong: dividing by zero, and taking the square root of a negative number. So \( \sqrt{2x + 8} \) needs \( 2x + 8 \ge 0 \), giving domain \( x \ge -4 \) and range \( y \ge 0 \). And \( \dfrac{3}{x-5} \) needs \( x \neq 5 \); its outputs can be any real number except 0, so the range is \( y \neq 0 \).
For a quadratic, complete the square (Step 2) and the vertex gives one end of the range. On a restricted domain you must also check the end points.
\( f(x) = x^2 + 4x + 1 \). Find the range of \( f \) when the domain is (a) all real \( x \), (b) \( -4 \le x \le 1 \).
A common mistake is to use only the end values, giving \( 1 \le f(x) \le 6 \). Always ask whether the turning point is inside the domain.
An economics example: domains with meaning. A demand curve \( P = 90-2Q \) is algebraically happy with any \( Q \). Economically, quantity cannot be negative and neither can price, so \( Q \ge 0 \) and \( 90-2Q \ge 0 \). The sensible domain is \( 0 \le Q \le 45 \), with range \( 0 \le P \le 90 \). Outside this domain the model stops making sense.
Composite functions
Feed the output of one machine straight into another and you get a composite function. The notation \( fg(x) \) means \( f(g(x)) \): \( g \) acts first, because it sits next to \( x \), and \( f \) acts on the result. IB writes the same thing as \( (f \circ g)(x) \).
\( f(x) = 3x-1 \) and \( g(x) = x^2 + 2 \), both for \( x \in \mathbb{R} \). Find \( fg(x) \) and \( gf(x) \), then solve \( gf(x) = 6 \).
Steps 1 and 2 give different functions: for example \( fg(2) = 17 \) but \( gf(2) = 27 \). In general \( fg \neq gf \), so order matters.
A composite \( fg \) exists only if every output of \( g \) is an input that \( f \) accepts: the range of \( g \) must lie inside the domain of \( f \). With \( f(x) = \sqrt{x-2} \) for \( x \ge 2 \) and \( g(x) = x + 5 \), we get \( fg(x) = \sqrt{x + 3} \), but only for inputs with \( g(x) \ge 2 \), that is \( x \ge -3 \).
An economics example: cost in terms of workers. A workshop’s output is \( Q = 4L \) units a day, where \( L \) is the number of workers, and its daily cost is \( C(Q) = 50 + 3Q + 0.05Q^2 \) dollars. The manager hiring staff wants cost in terms of workers, which is the composite \( C(Q(L)) = 50 + 12L + 0.8L^2 \). With 10 workers, \( Q = 40 \) and the cost is \( 50 + 120 + 80 = \$250 \) either way.
Inverse functions
The inverse of \( f \), written \( f^{-1} \), undoes it: if \( f(3) = 11 \), then \( f^{-1}(11) = 3 \). Only one-one functions have inverses. Undoing a many-one function would mean sending one output back to two inputs, which no function may do.
To find it: write \( y = f(x) \), make \( x \) the subject, then swap the letters. The domain of \( f^{-1} \) is the range of \( f \), and its range is the domain of \( f \). The graph of \( f^{-1} \) is the reflection of the graph of \( f \) in the line \( y = x \), because a point \( (a, b) \) on one graph becomes \( (b, a) \) on the other.
\( f(x) = \dfrac{3x-2}{x + 1} \) for \( x \neq -1 \). Find \( f^{-1}(x) \) and check that \( f(f^{-1}(x)) = x \).
Step 2 is the usual move when the new subject appears twice: gather, then factorise.
A many-one function can be given an inverse by restricting its domain so that what remains is one-one. For a parabola, keep one side of the vertex. Take \( f(x) = x^2 + 2x-3 = (x + 1)^2-4 \) for \( x \ge -1 \). Its range is \( f(x) \ge -4 \). Solving \( y = (x + 1)^2-4 \) gives \( x + 1 = \pm\sqrt{y + 4} \), and we take the positive root because \( x \ge -1 \). So \( f^{-1}(x) = -1 + \sqrt{x + 4} \) for \( x \ge -4 \). This \( f \) is increasing, so the two graphs can meet only on the mirror line: \( x^2 + 2x-3 = x \) gives \( x = \dfrac{-1 \pm \sqrt{13}}{2} \), and only \( \dfrac{-1 + \sqrt{13}}{2} \approx 1.30 \) is in the domain.
Transformations of graphs
Once you know a basic shape, small changes to its equation move it in predictable ways. There are three kinds of move (translations, stretches and reflections), and each acts either on the output, vertically, or on the input, horizontally.
| New equation | Effect on \( y = f(x) \) | Point \( (p, q) \) goes to |
|---|---|---|
| \( y = f(x) + a \) | translation \( a \) units up | \( (p, q + a) \) |
| \( y = f(x + a) \) | translation \( a \) units left | \( (p-a, q) \) |
| \( y = af(x) \) | stretch parallel to the y-axis, factor \( a \) | \( (p, aq) \) |
| \( y = f(ax) \) | stretch parallel to the x-axis, factor \( \frac{1}{a} \) | \( (p/a, q) \) |
| \( y = -f(x) \) | reflection in the x-axis | \( (p, -q) \) |
| \( y = f(-x) \) | reflection in the y-axis | \( (-p, q) \) |
Why does \( f(x + 3) \) move the graph left? The old graph reaches its height at \( x = 5 \) by feeding 5 into \( f \). The new rule feeds in \( x + 3 \), so it reaches input 5 when \( x = 2 \). Every feature happens 3 units earlier, which is 3 units to the left. The same reasoning explains why \( f(2x) \) squashes the graph horizontally by a factor of \( \frac{1}{2} \).
Describe a sequence of transformations that maps \( y = \sqrt{x} \) onto \( y = 2\sqrt{x + 1}-3 \), and find the image of the point \( (4, 2) \).
Order matters in the vertical direction: stretch first, then translate. Moving down 3 before stretching would give \( 2(\sqrt{x + 1}-3) = 2\sqrt{x + 1}-6 \), a different curve.
An economics example: a tax shifts supply. Suppose supply is \( P = 15 + Q \) and demand is \( P = 90-2Q \). They meet where \( 15 + Q = 90-2Q \), so \( Q = 25 \) and \( P = \$40 \). Now add a tax of \$6 per unit. Firms still need \( 15 + Q \) for themselves, so buyers must pay \$6 more: the supply curve becomes \( P = 21 + Q \), a vertical translation by 6, exactly the transformation \( y = f(x) + 6 \). The new equilibrium is \( 21 + Q = 90-2Q \), so \( Q = 23 \) and \( P = \$44 \). Buyers pay \$4 more, sellers keep \( 44-6 = \$38 \), which is \$2 less, and the government collects \( 6 \times 23 = \$138 \).
Practise: 6 questions
Try each one on paper first, then check the worked answer.
EasyQ1. \( f(x) = 5-2x \). Find \( f(-3) \) and solve \( f(x) = -7 \). Show worked answer
\( 5-2x = -7 \) gives \( -2x = -12 \), so \( x = 6 \).
EasyQ2. State the largest possible domain of (a) \( \sqrt{12-3x} \) (b) \( \dfrac{1}{x^2-4} \). Show worked answer
(b) Need \( x^2-4 \neq 0 \), so \( x \neq 2 \) and \( x \neq -2 \).
MediumQ3. \( f(x) = x^2-1 \) and \( g(x) = 2x + 3 \), both for \( x \in \mathbb{R} \). Find \( fg(x) \) and \( gf(x) \), and solve \( fg(x) = 0 \). Show worked answer
\( gf(x) = g(x^2-1) = 2(x^2-1) + 3 = 2x^2 + 1 \).
\( 4x^2 + 12x + 8 = 0 \) gives \( x^2 + 3x + 2 = (x + 1)(x + 2) = 0 \), so \( x = -1 \) or \( x = -2 \).
MediumQ4. \( f(x) = \dfrac{x + 5}{2x-1} \) for \( x \neq \tfrac{1}{2} \). Find \( f^{-1}(x) \). What do you notice? Show worked answer
Gather: \( 2xy-x = y + 5 \), so \( x(2y-1) = y + 5 \) and \( x = \dfrac{y + 5}{2y-1} \).
\( f^{-1}(x) = \dfrac{x + 5}{2x-1} \), for \( x \neq \tfrac{1}{2} \).
This is the same as \( f \): the function is its own inverse (self-inverse), so its graph is symmetric in \( y = x \).
MediumQ5. The point \( (-2, 6) \) lies on \( y = f(x) \). Find its image on (a) \( y = f(x-3) + 1 \) (b) \( y = \tfrac{1}{2}f(x) \) (c) \( y = f(-x) \) (d) \( y = f(2x) \). Show worked answer
(b) Halve the y-coordinate: \( (-2, 3) \).
(c) Reflect in the y-axis: \( (2, 6) \).
(d) Halve the x-coordinate: \( (-1, 6) \). Check: \( f(2 \times (-1)) = f(-2) = 6 \).
ExamQ6. The function \( f \) is defined by \( f(x) = 2x^2-8x + 5 \) for \( x \le 2 \). (a) Express \( f(x) \) in the form \( a(x-b)^2 + c \). [2] (b) State the range of \( f \). [1] (c) Find an expression for \( f^{-1}(x) \) and state the domain of \( f^{-1} \). [3] (d) Describe fully a sequence of transformations that maps the graph of \( y = x^2 \) onto the graph of \( y = 2(x-2)^2-3 \). [3] Show worked answer
(b) The vertex \( (2, -3) \) is the end of the domain and \( (x-2)^2 \ge 0 \), so \( f(x) \ge -3 \). [B1]
(c) \( y = 2(x-2)^2-3 \) gives \( (x-2)^2 = \dfrac{y + 3}{2} \). [M1]
Since \( x \le 2 \), \( x-2 \le 0 \), so take the negative root: \( x = 2-\sqrt{\dfrac{y + 3}{2}} \). So \( f^{-1}(x) = 2-\sqrt{\dfrac{x + 3}{2}} \). [A1]
Domain of \( f^{-1} \): \( x \ge -3 \), the range of \( f \). [B1]
(d) Translation by \( \binom{2}{0} \) [B1]; stretch parallel to the y-axis, scale factor 2 [B1]; then translation by \( \binom{0}{-3} \) [B1]. The stretch must come before the vertical translation.
Total: 9 marks.
Check yourself
1. What does \( fg(x) \) mean?
2. Which property must \( f \) have for \( f^{-1} \) to exist?
3. How is the graph of \( y = f(x + 3) \) related to the graph of \( y = f(x) \)?
Your score: 0 out of 3
The short version
- A function gives exactly one output per input. One-one functions pass the horizontal line test; many-one functions fail it.
- Exclude zero denominators and negative square roots to find a natural domain. For a quadratic on a restricted domain, check the vertex and the end points to find the range.
- \( fg(x) = f(g(x)) \), with \( g \) acting first; it exists only if the range of \( g \) lies inside the domain of \( f \).
- Find \( f^{-1} \) by making \( x \) the subject and swapping letters. Domain and range swap, and the graphs are reflections in \( y = x \).
- Outside changes act vertically as written; inside changes act horizontally in reverse. A per-unit tax translates the supply curve up by the tax.
- The full chapter in Mathematics Made Simple has many more worked examples and a full set of practice questions with a complete answer key.
Further reading on EconTutorials
Related in-depth articles from our blog:
