This note covers function notation, evaluating functions, building composite functions such as \(fg(x)\), and finding inverse functions. Functions are a way of describing a rule that turns one number into another, and they are the language used in graphs, calculus and modelling.
Key ideas
A function is a rule that takes an input and gives exactly one output. We write \(f(x) = 2x + 5\) and read it as "f of x equals 2x plus 5". To find \(f(4)\), replace every \(x\) with 4: \(f(4) = 2(4)+5 = 13\).
The set of allowed inputs is the domain. The set of outputs is the range. Some inputs may have to be excluded. For \(f(x) = \dfrac{1}{x-3}\) we need \(x \neq 3\), because division by zero is not defined.
Composite functions. The notation \(fg(x)\) means "do \(g\) first, then \(f\)". It is the same as \(f(g(x))\). The function nearest to \(x\) is applied first.
- To find \(fg(x)\), replace each \(x\) in \(f(x)\) with the whole expression \(g(x)\).
- In general \(fg(x) \neq gf(x)\). The order matters.
- \(ff(x)\) means apply \(f\) twice: \(f(f(x))\).
- To find a number such as \(fg(2)\), work out \(g(2)\) first, then put the result into \(f\).
Inverse functions. The inverse \(f^{-1}\) undoes what \(f\) does. If \(f(a) = b\), then \(f^{-1}(b) = a\). To find \(f^{-1}(x)\):
- Write \(y = f(x)\).
- Rearrange to make \(x\) the subject.
- Replace \(y\) with \(x\) in the result. This is \(f^{-1}(x)\).
Facts about inverses:
- \(f^{-1}f(x) = x\) and \(ff^{-1}(x) = x\).
- The graph of \(y = f^{-1}(x)\) is the reflection of the graph of \(y = f(x)\) in the line \(y = x\).
- The domain of \(f^{-1}\) is the range of \(f\), and the range of \(f^{-1}\) is the domain of \(f\).
- The notation \(f^{-1}\) does not mean \(\dfrac{1}{f}\).
Only functions that give a different output for each input have an inverse. For instance \(f(x) = x^2\) on all real numbers does not, because \(f(3)\) and \(f(-3)\) are equal.
Thinking of a function as a machine. It helps to picture \(f(x) = 2x+5\) as a two-step machine: multiply by 2, then add 5. The inverse reverses the steps in the opposite order: subtract 5, then divide by 2. This gives \(f^{-1}(x) = \dfrac{x-5}{2}\) directly. The same idea works for composite functions: \(fg\) is simply machine \(g\) followed by machine \(f\), joined together.
Reading functions from graphs. To find \(f(a)\) from a graph, go to \(x = a\) on the horizontal axis, up to the curve, then across to read the output. To find \(f^{-1}(b)\), start from \(b\) on the vertical axis and read across to the curve and down to the \(x\)-axis. Some functions are their own inverse, such as \(f(x) = \dfrac{1}{x}\) and \(f(x) = 6 - x\). Their graphs are symmetrical about the line \(y = x\).
Setting out. When you build \(fg(x)\), write the substitution first, for example \(f(x^2-3) = 2(x^2-3)+5\), then simplify. This keeps the method visible and makes errors easy to spot.
Solving equations with functions. Substitute the expressions in, then solve in the usual way, for example \(fg(x) = 17\) becomes a quadratic or linear equation.
Definitions and formulae
| Term or formula | Meaning / when to use |
|---|---|
| \(f(x)\) | The output of function \(f\) for input \(x\). |
| Domain | The set of allowed input values. |
| Range | The set of possible output values. |
| \(fg(x) = f(g(x))\) | Composite function: apply \(g\) first, then \(f\). |
| \(f^{-1}(x)\) | Inverse function: reverses \(f\). |
| \(ff^{-1}(x) = x\) | A function followed by its inverse gives back the input. |
| Reflection in \(y = x\) | Relates the graph of \(f\) to the graph of \(f^{-1}\). |
Worked examples
Example 1 \(f(x) = 2x + 5\) and \(g(x) = x^2 - 3\). Find (a) \(f(4)\) and \(g(-2)\), (b) \(fg(x)\), (c) \(gf(x)\), (d) the values of \(x\) for which \(fg(x) = 17\).
(a) \(f(4) = 2(4) + 5 = 13\). \(g(-2) = (-2)^2 - 3 = 4 - 3 = 1\).
(b) \(fg(x) = f(x^2 - 3) = 2(x^2 - 3) + 5 = 2x^2 - 6 + 5 = 2x^2 - 1\).
(c) \(gf(x) = g(2x + 5) = (2x + 5)^2 - 3\).
Expand: \((2x+5)^2 = 4x^2 + 20x + 25\). So \(gf(x) = 4x^2 + 20x + 22\).
(d) Solve \(2x^2 - 1 = 17\). Then \(2x^2 = 18\), \(x^2 = 9\), so \(x = 3\) or \(x = -3\).
Check \(x=3\): \(g(3) = 6\), \(f(6) = 17\). Correct.
Answer: (a) 13 and 1 (b) \(2x^2-1\) (c) \(4x^2+20x+22\) (d) \(x = \pm 3\)
Example 2 \(f(x) = \dfrac{3x+1}{x-2}\) for \(x \neq 2\). Find \(f^{-1}(x)\), and state the value of \(x\) that must be excluded from its domain.
Write \(y = \dfrac{3x+1}{x-2}\).
Multiply both sides by \((x-2)\): \(y(x-2) = 3x + 1\).
Expand: \(xy - 2y = 3x + 1\).
Collect the \(x\) terms on one side: \(xy - 3x = 2y + 1\).
Factorise: \(x(y - 3) = 2y + 1\).
So \(x = \dfrac{2y+1}{y-3}\), and therefore \(f^{-1}(x) = \dfrac{2x+1}{x-3}\).
The denominator is zero when \(x = 3\), so \(x \neq 3\) in the domain of \(f^{-1}\). (The function \(f\) never gives an output of 3.)
Check: \(f(3) = \dfrac{10}{1} = 10\) and \(f^{-1}(10) = \dfrac{21}{7} = 3\). Correct.
Answer: \(f^{-1}(x) = \dfrac{2x+1}{x-3}\), with \(x \neq 3\)
Example 3 \(g(x) = 4x - 7\). Find \(g^{-1}(x)\) and solve \(g^{-1}(x) = g(x)\).
Write \(y = 4x - 7\). Then \(y + 7 = 4x\), so \(x = \dfrac{y+7}{4}\).
Therefore \(g^{-1}(x) = \dfrac{x+7}{4}\).
Set the two expressions equal: \(\dfrac{x+7}{4} = 4x - 7\).
Multiply by 4: \(x + 7 = 16x - 28\).
Rearrange: \(35 = 15x\), so \(x = \dfrac{35}{15} = \dfrac{7}{3}\).
Check: \(g\left(\tfrac73\right) = \tfrac{28}{3} - \tfrac{21}{3} = \tfrac73\), and \(g^{-1}\left(\tfrac73\right) = \dfrac{7/3 + 7}{4} = \dfrac{28/3}{4} = \tfrac73\). Both agree.
Answer: \(g^{-1}(x) = \dfrac{x+7}{4}\); \(x = \dfrac73\)
Common errors
- Common error: applying the functions in the wrong order. \(fg(x)\) means \(g\) first. Read it from the right.
- Common error: writing \(f(g(x))\) as \(f(x) \times g(x)\). Composition means substituting, not multiplying.
- Common error: forgetting brackets when substituting, for example writing \((2x+5)^2\) as \(2x^2 + 5^2\). Put the whole expression in brackets, then expand.
- Common error: reading \(f^{-1}(x)\) as \(\dfrac{1}{f(x)}\).
- Common error: in inverse questions with \(x\) on both sides, not collecting the \(x\) terms and factorising before dividing.
Exam tip: To check an inverse, pick a number such as \(x = 1\), find \(f(1)\), and put the result into your \(f^{-1}\). You should get 1 back.
Check yourself
- \(f(x) = x^2 - 4x\). Find \(f(5)\) and the other value of \(x\) with \(f(x) = f(5)\) that is negative.
Answer
\(f(5) = 25 - 20 = 5\). Solve \(x^2 - 4x = 5\): \(x^2 - 4x - 5 = 0\), so \((x-5)(x+1) = 0\). The negative solution is \(x = -1\). Check: \(f(-1) = 1 + 4 = 5\). - \(f(x) = 3x + 2\) and \(g(x) = x - 5\). Find \(gf(x)\) and \(fg(x)\).
Answer
\(gf(x) = (3x+2) - 5 = 3x - 3\). \(fg(x) = 3(x-5) + 2 = 3x - 13\). - Find the inverse of \(f(x) = \dfrac{4x - 1}{3}\).
Answer
\(y = \dfrac{4x-1}{3}\), so \(3y = 4x - 1\), \(4x = 3y + 1\), \(x = \dfrac{3y+1}{4}\). Hence \(f^{-1}(x) = \dfrac{3x+1}{4}\). - \(f(x) = x + 2\) and \(g(x) = x^2\). Solve \(gf(x) = fg(x)\).
Answer
\(gf(x) = (x+2)^2 = x^2 + 4x + 4\). \(fg(x) = x^2 + 2\). Set equal: \(4x + 4 = 2\), so \(x = -\tfrac12\). Check: \(gf(-\tfrac12) = 1.5^2 = 2.25\) and \(fg(-\tfrac12) = 0.25 + 2 = 2.25\).