Composition: functions in a chain
\((f \circ g)(x) = f(g(x))\) means "do \(g\) first, then \(f\)". The function written closest to \(x\) acts first. Picture two machines in a row: the output of \(g\) is fed straight into \(f\).
Order matters. With \(f(x) = 2x + 1\) and \(g(x) = x^2\):
- \((f \circ g)(x) = f(x^2) = 2x^2 + 1\),
- \((g \circ f)(x) = g(2x + 1) = (2x + 1)^2\).
These are different functions. At \(x = 1\): \(f(g(1)) = 3\) but \(g(f(1)) = 9\).
Domain of a composite
For \(f(g(x))\) to exist, two things must hold: \(x\) must be in the domain of \(g\), and \(g(x)\) must be in the domain of \(f\). Example: \(f(x) = x - 5\) and \(g(x) = \sqrt{x}\). Then \((g \circ f)(x) = \sqrt{x - 5}\), which needs \(x \ge 5\), even though \(f\) itself accepts every real number.
The identity function
The identity is \(I(x) = x\): it changes nothing. It plays the role that 1 plays in multiplication. A function and its inverse compose to give the identity:
\[f(f^{-1}(x)) = x \quad\text{and}\quad f^{-1}(f(x)) = x.\]
Finding an inverse algebraically
- Write \(y = f(x)\).
- Swap \(x\) and \(y\).
- Rearrange to make \(y\) the subject.
- Write \(f^{-1}(x) = \dots\) and state its domain (the range of \(f\)).
Worked example
Find the inverse of \(f(x) = \dfrac{x + 4}{3}\) and verify it.
- \(y = \frac{x + 4}{3}\); swap: \(x = \frac{y + 4}{3}\); so \(3x = y + 4\) and \(y = 3x - 4\).
- \(f^{-1}(x) = 3x - 4\).
- Check: \(f(f^{-1}(x)) = \frac{(3x - 4) + 4}{3} = \frac{3x}{3} = x\). It works.
A second example with a fraction: \(h(x) = \frac{2x}{x - 1}\), \(x \ne 1\). Swap: \(x = \frac{2y}{y - 1}\), so \(xy - x = 2y\), giving \(y(x - 2) = x\) and \(h^{-1}(x) = \frac{x}{x - 2}\), \(x \ne 2\). The excluded value is the horizontal asymptote of \(h\), which matches the idea that the range of \(h\) becomes the domain of \(h^{-1}\).
Solving with composites
Questions like "solve \(f(g(x)) = 7\)" just need you to form the composite and solve. Questions like "find \(f^{-1}(5)\)" can skip finding the inverse formula: solve \(f(x) = 5\) instead.
Common mistakes
- Doing the outer function first, e.g. computing \(g(f(x))\) when \(f(g(x))\) was asked.
- Writing \(f \circ g\) as the product \(f(x) \times g(x)\).
- Forgetting to state the domain of the inverse.
- Confusing \(f^{-1}(x)\) with \((f(x))^{-1}\).
Exam tips
- Substitute with brackets: replace \(x\) by \((\text{whole inner function})\).
- Verify an inverse by composing; it takes one line and catches errors.
- For \((f^{-1} \circ g)(a)\), evaluate inside out with numbers rather than building formulas.