This note covers composite functions, where the output of one function becomes the input of another, and the inverse of a function, which reverses it. Both ideas are used throughout calculus, and they help you model processes that happen in stages.
Key ideas
Composite functions. The composite \(f \circ g\) means "do \(g\) first, then \(f\)". We write \((f \circ g)(x) = f(g(x))\). To find it, replace every \(x\) in \(f\) with the whole expression for \(g(x)\).
Order matters. In general \(f(g(x))\) and \(g(f(x))\) are different functions. Always work from the inside outwards: the function nearest to \(x\) acts first.
Domain of a composite. The input \(x\) must be allowed in \(g\), and then \(g(x)\) must be allowed in \(f\). For example, if \(f(x) = \sqrt{x}\) and \(g(x) = x - 4\), then \(f(g(x)) = \sqrt{x - 4}\), which needs \(x \geq 4\).
Inverse functions. The inverse \(f^{-1}\) undoes \(f\). Two key results link them:
- \(f(f^{-1}(x)) = x\) and \(f^{-1}(f(x)) = x\), as long as each is defined.
- The graph of \(y = f^{-1}(x)\) is the reflection of \(y = f(x)\) in the line \(y = x\).
An inverse exists only when \(f\) is one-to-one, meaning no output is produced by two different inputs. If needed, restrict the domain to make this true.
Finding an inverse. Write \(y = f(x)\), swap \(x\) and \(y\), then rearrange to make \(y\) the subject. Finally write the answer as \(f^{-1}(x)\). For expressions where \(x\) appears twice, such as \(y = \dfrac{3x + 2}{x - 1}\), you need to collect the terms in \(x\) on one side and factorise.
Domain and range of the inverse. The domain of \(f^{-1}\) is the range of \(f\). The range of \(f^{-1}\) is the domain of \(f\).
Inverse of a composite. To undo "\(g\) then \(f\)", undo \(f\) first and then \(g\). That gives \[(f \circ g)^{-1} = g^{-1} \circ f^{-1}.\] It is like taking off socks and shoes: the order reverses.
Solving equations. You may be asked to solve \((f \circ g)(x) = k\), or to find the value of \(x\) with \(f^{-1}(x) = a\). For the second type, note that \(f^{-1}(x) = a\) means the same as \(x = f(a)\), which is quick to evaluate.
Composites in context. Many real processes happen in stages: a price is reduced and then tax is added, or a temperature is converted and then adjusted. Each stage is a function, and the whole process is their composite. Reading the order of the stages in the wording tells you which function goes on the inside.
Definitions and formulae
| Term or formula | Meaning / when to use |
|---|---|
| \((f \circ g)(x) = f(g(x))\) | Apply \(g\) first, then \(f\). |
| \(f(g(x)) \neq g(f(x))\) | Composition is not usually commutative, so keep the order. |
| \(f^{-1}(f(x)) = x\) | The inverse undoes the function. |
| \(f(f^{-1}(x)) = x\) | The function undoes its inverse. |
| \((f \circ g)^{-1} = g^{-1} \circ f^{-1}\) | The inverse of a composite reverses the order. |
| Self-inverse function (HL) | A function with \(f^{-1}(x) = f(x)\), so \(f(f(x)) = x\). |
| \(f^{-1}(x) = a \iff f(a) = x\) | Quick way to evaluate an inverse at a point. |
Worked examples
Example 1 Let \(f(x) = 2x + 3\) and \(g(x) = x^2 - 1\). (a) Find \((f \circ g)(x)\) and \((g \circ f)(x)\). (b) Solve \((f \circ g)(x) = 19\).
(a) For \(f(g(x))\), replace \(x\) in \(f\) with \(x^2 - 1\): \(f(g(x)) = 2(x^2 - 1) + 3 = 2x^2 - 2 + 3 = 2x^2 + 1\).
For \(g(f(x))\), replace \(x\) in \(g\) with \(2x + 3\): \(g(f(x)) = (2x + 3)^2 - 1 = 4x^2 + 12x + 9 - 1 = 4x^2 + 12x + 8\).
(b) Set \(2x^2 + 1 = 19\). Then \(2x^2 = 18\), so \(x^2 = 9\) and \(x = 3\) or \(x = -3\).
Answer: (a) \(2x^2 + 1\) and \(4x^2 + 12x + 8\); (b) \(x = \pm 3\)
Example 2 (a) A shop applies a 20% discount to a price of \(x\) euros, then adds a delivery charge of 6 euros. With \(d(x) = 0.8x\) for the discount and \(s(x) = x + 6\) for delivery, find the composite function that gives the final cost. (b) Let \(h(x) = \sqrt{x}\) and \(k(x) = 3x - 12\). Find the largest domain of \(h(k(x))\).
(a) Discount first, then delivery. That is \(s(d(x)) = s(0.8x) = 0.8x + 6\).
(b) \(h(k(x)) = \sqrt{3x - 12}\). The expression under the root must be at least 0.
\(3x - 12 \geq 0\), so \(3x \geq 12\) and \(x \geq 4\).
Answer: final cost \(0.8x + 6\); the domain of \(h(k(x))\) is \(x \geq 4\).
Example 3 Let \(f(x) = \dfrac{3x + 2}{x - 1}\) for \(x \neq 1\). (a) Find \(f^{-1}(x)\). (b) State the domain of \(f^{-1}\).
(a) Write \(y = \dfrac{3x + 2}{x - 1}\) and swap \(x\) and \(y\): \(x = \dfrac{3y + 2}{y - 1}\).
Multiply both sides by \(y - 1\): \(x(y - 1) = 3y + 2\), so \(xy - x = 3y + 2\).
Collect the \(y\) terms on one side: \(xy - 3y = x + 2\).
Factorise: \(y(x - 3) = x + 2\), so \(y = \dfrac{x + 2}{x - 3}\).
(b) The domain of \(f^{-1}\) is the range of \(f\). Writing \(f(x) = 3 + \dfrac{5}{x - 1}\), the fraction \(\dfrac{5}{x - 1}\) is never 0, so \(f(x)\) never equals 3. The range of \(f\) is \(f(x) \neq 3\). This matches the denominator \(x - 3\) of the inverse.
Answer: \(f^{-1}(x) = \dfrac{x + 2}{x - 3}\), with domain \(x \neq 3\)
Common errors
- Common error: working in the wrong order. \((f \circ g)(x)\) means \(g\) acts first. Replace the \(x\) in \(f\) by \(g(x)\), not the other way round.
- Common error: forgetting brackets when substituting, for example writing \(2x + 3^2 - 1\) instead of \((2x + 3)^2 - 1\).
- Common error: writing \((f \circ g)^{-1} = f^{-1} \circ g^{-1}\). The order must reverse: \(g^{-1} \circ f^{-1}\).
- Common error: not factorising when \(x\) appears in more than one term during the inverse, and then getting stuck or dividing wrongly.
- Common error: ignoring the domain. A composite may have a smaller domain than either function alone.
Exam tip: test your inverse by choosing a number. If \(f(2) = 8\), then \(f^{-1}(8)\) must be 2. This takes seconds and catches most algebra slips.
Check yourself
- If \(f(x) = x + 5\) and \(g(x) = 3x\), find \((f \circ g)(2)\) and \((g \circ f)(2)\).
Answer
\(g(2) = 6\), so \(f(g(2)) = 11\). Also \(f(2) = 7\), so \(g(f(2)) = 21\). - Find the domain of \(f(g(x))\) when \(f(x) = \dfrac{1}{x}\) and \(g(x) = x - 3\).
Answer
\(f(g(x)) = \dfrac{1}{x - 3}\). The denominator cannot be 0, so \(x \neq 3\). - Given \(f(x) = 3x - 1\) and \(g(x) = \dfrac{x}{2} + 4\), find \((f \circ g)^{-1}(x)\).
Answer
\((f \circ g)(x) = 3\left(\dfrac{x}{2} + 4\right) - 1 = 1.5x + 11\). Let \(y = 1.5x + 11\) and swap: \(x = 1.5y + 11\), so \(y = \dfrac{x - 11}{1.5} = \dfrac{2(x - 11)}{3}\). Check using \(g^{-1}(f^{-1}(x))\): \(f^{-1}(x) = \dfrac{x + 1}{3}\) and \(g^{-1}(x) = 2(x - 4)\), so \(g^{-1}(f^{-1}(x)) = 2\left(\dfrac{x + 1}{3} - 4\right) = \dfrac{2(x - 11)}{3}\). They agree. - If \(f(x) = 2x^2 - 1\) for \(x \geq 0\), find \(f^{-1}(7)\).
Answer
\(f^{-1}(7) = a\) means \(f(a) = 7\). So \(2a^2 - 1 = 7\), giving \(a^2 = 4\). Since the domain of \(f\) is \(x \geq 0\), \(a = 2\).