Instant PDF download, name-and-email checkout. Complete bundle: every Economics, Statistics and Mathematics book
Mathematics guide, Foundations, step 3 of 33Previous stepNext step

Step 3: Functions and Inverses

Syllabus9709 P1 1.2 · IB SL 2.2–2.5
In 30 seconds
  • 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.
Video lesson coming soonA short animated lesson for this step will appear here.

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 \).

Key termFunction: a rule that assigns to each input in its domain exactly one output. Several inputs may share an output, but no input may have two outputs.

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).

Worked example

\( f(x) = 4-x^2 \) for \( x \in \mathbb{R} \). Find \( f(-3) \), solve \( f(x) = -12 \), and decide whether \( f \) is one-one.

Step 1Replace \( x \) by the input in brackets: \( f(-3) = 4-(-3)^2 = 4-9 = -5 \).
Step 2\( 4-x^2 = -12 \) gives \( x^2 = 16 \), so \( x = 4 \) or \( x = -4 \).
Step 3Two different inputs give the same output \( -12 \), so \( f \) is many-one, not 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.

Worked example

\( 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 \).

Step 1Complete the square: \( f(x) = (x + 2)^2-3 \). The vertex is \( (-2, -3) \), a minimum.
Step 2(a) A square is never negative, so the range is \( f(x) \ge -3 \).
Step 3(b) The vertex \( x = -2 \) lies inside \( -4 \le x \le 1 \), so the minimum \( -3 \) is still reached.
Step 4End points: \( f(-4) = 16-16 + 1 = 1 \) and \( f(1) = 1 + 4 + 1 = 6 \). The larger is 6, so the range is \( -3 \le f(x) \le 6 \).

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) \).

\[ fg(x) = f\big(g(x)\big) \]
Worked example

\( 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 \).

Step 1\( g \) first: \( fg(x) = f(x^2 + 2) = 3(x^2 + 2)-1 = 3x^2 + 5 \).
Step 2\( f \) first: \( gf(x) = g(3x-1) = (3x-1)^2 + 2 = 9x^2-6x + 3 \).
Step 3\( (3x-1)^2 + 2 = 6 \) gives \( (3x-1)^2 = 4 \), so \( 3x-1 = \pm 2 \).
Step 4\( 3x-1 = 2 \) gives \( x = 1 \); \( 3x-1 = -2 \) gives \( x = -\tfrac{1}{3} \).

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.

Key termInverse function: for a one-one function \( f \), the function \( f^{-1} \) with \( f^{-1}(f(x)) = x \) for every \( x \) in the domain of \( f \), and \( f(f^{-1}(x)) = x \) for every \( x \) in the range of \( f \).

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.

Worked example

\( f(x) = \dfrac{3x-2}{x + 1} \) for \( x \neq -1 \). Find \( f^{-1}(x) \) and check that \( f(f^{-1}(x)) = x \).

Step 1Let \( y = \dfrac{3x-2}{x + 1} \). Clear the fraction: \( xy + y = 3x-2 \).
Step 2Gather the x terms and factorise: \( xy-3x = -2-y \), so \( x(y-3) = -(y + 2) \) and \( x = \dfrac{y + 2}{3-y} \).
Step 3Swap letters: \( f^{-1}(x) = \dfrac{x + 2}{3-x} \), for \( x \neq 3 \). (The range of \( f \) is every real number except 3, its horizontal asymptote.)
Step 4Check: the top of \( f(f^{-1}(x)) \) is \( \dfrac{3(x + 2)-2(3-x)}{3-x} = \dfrac{5x}{3-x} \) and the bottom is \( \dfrac{(x + 2) + (3-x)}{3-x} = \dfrac{5}{3-x} \). Dividing gives \( 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.

f(x) = (x + 1)² − 4, x ≥ −1, and its inverse
y = xy = f(x)y = f⁻¹(x) = −1 + √(x + 4)
−5−4−3−2−11234567−5−4−3−2−112345670xy(−1, −4)(−4, −1)(1.30, 1.30)
Figure 1. f and f⁻¹ are mirror images in y = x. The end point (−1, −4) reflects to (−4, −1), and the graphs meet on the mirror line at x = (−1 + √13)/2 ≈ 1.30.
Common mistakeReading \( f^{-1}(x) \) as \( \dfrac{1}{f(x)} \). The \( -1 \) is not an index here: it means “undo \( f \)”. For \( f(x) = 2x + 1 \), the inverse is \( \dfrac{x-1}{2} \), while \( \dfrac{1}{2x + 1} \) is a different function altogether.
Exam tipWhen a Cambridge 9709 question says “find an expression for \( f^{-1}(x) \)”, a mark is often reserved for the domain of \( f^{-1} \). Find the range of \( f \) first and copy it across. When you take a square root, justify the sign you keep by pointing to the original domain, as in “positive root, since \( x \ge -1 \)”.

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 equationEffect 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} \).

Worked example

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) \).

Step 1\( \sqrt{x} \to \sqrt{x + 1} \): translation 1 unit left, by the vector \( \binom{-1}{0} \).
Step 2\( \sqrt{x + 1} \to 2\sqrt{x + 1} \): stretch parallel to the y-axis, scale factor 2.
Step 3\( 2\sqrt{x + 1} \to 2\sqrt{x + 1}-3 \): translation 3 units down, by \( \binom{0}{-3} \).
Step 4Follow the point: \( (4, 2) \to (3, 2) \to (3, 4) \to (3, 1) \). Check: \( 2\sqrt{4}-3 = 1 \).

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.

From y = √x to y = 2√(x + 1) − 3
y = √xy = 2√(x + 1)y = 2√(x + 1) − 3
−2−1123456789−4−3−2−11234560xy(−1, −3)(4, 2)(3, 1)
Figure 2. y = √x is moved 1 left, stretched vertically by factor 2 (dashed), then moved 3 down. The start point (0, 0) ends at (−1, −3), and (4, 2) ends at (3, 1).

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
\( f(-3) = 5-2(-3) = 5 + 6 = 11 \).
\( 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
(a) Need \( 12-3x \ge 0 \), so \( 3x \le 12 \) and \( x \le 4 \).
(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
\( fg(x) = f(2x + 3) = (2x + 3)^2-1 = 4x^2 + 12x + 8 \).
\( 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
\( y(2x-1) = x + 5 \), so \( 2xy-y = x + 5 \).
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
(a) 3 right and 1 up: \( (1, 7) \).
(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
(a) \( 2(x^2-4x) + 5 = 2\left[(x-2)^2-4\right] + 5 \) [M1] \( = 2(x-2)^2-3 \). [A1]
(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?

\( fg(x) = f(g(x)) \). The function next to \( x \) acts first, so \( g \) goes first.

2. Which property must \( f \) have for \( f^{-1} \) to exist?

An inverse sends each output back to a single input, which is only possible when no two inputs share an output.

3. How is the graph of \( y = f(x + 3) \) related to the graph of \( y = f(x) \)?

A change inside the bracket acts on \( x \) in reverse: \( f(x + 3) \) reaches each value 3 units earlier, so the graph moves 3 left.

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.
Want more questions like these, with worked answers?
The practice book has hundreds more, graded from easy to exam level.
Next: step 4 of 33Lines and Circles