
Functions are machines, and in Precalculus you learn to chain them, to run them backward, and to reshape their graphs on purpose. This chapter gives you four powerful tools: composition, inverses, transformations, and symmetry. Together they let you build complicated functions from simple pieces and take them apart again.
1. Composition of functions
When the output of one function becomes the input of another, you are composing them. Think of two machines placed one after the other on an assembly line.
The composition of \(f\) and \(g\) is the function \((f\circ g)(x)=f\big(g(x)\big)\). You apply \(g\) first, then \(f\). Read \(f\circ g\) as “\(f\) of \(g\)”.
Let \(f(x)=3x-2\) and \(g(x)=x^2+1\).
\((f\circ g)(x)=f(x^2+1)=3(x^2+1)-2=3x^2+1\).
\((g\circ f)(x)=g(3x-2)=(3x-2)^2+1=9x^2-12x+5\).
At \(x=2\): \((f\circ g)(2)=3(4)+1=13\) and \((g\circ f)(2)=36-24+5=17\). The two results differ.
In general \(f\circ g\neq g\circ f\). Always work from the inside out: the function written on the right acts first.
It is just as useful to go the other way and decompose a function. For \(h(x)=(5x+4)^3\), take the inner function \(g(x)=5x+4\) and the outer function \(f(x)=x^3\), so that \(h=f\circ g\).
2. Domain of a composite function
A composite function can only be evaluated when every step makes sense. That gives two conditions.
A number \(x\) belongs to the domain of \(f\circ g\) exactly when (1) \(x\) is in the domain of \(g\), and (2) \(g(x)\) is in the domain of \(f\).
- Write down the domain of the inner function \(g\).
- Find which values of \(x\) make \(g(x)\) land in the domain of \(f\).
- Keep only the values that satisfy both conditions. Do this before simplifying the formula.
Let \(f(x)=\dfrac{1}{x-3}\) and \(g(x)=\sqrt{x}\). Then \((f\circ g)(x)=\dfrac{1}{\sqrt{x}-3}\).
Condition 1: \(x\ge 0\). Condition 2: \(g(x)\neq 3\), that is \(\sqrt{x}\neq 3\), so \(x\neq 9\).
The domain is \([0,9)\cup(9,\infty)\).
3. One-to-one functions and the horizontal line test
A function \(f\) is one-to-one if different inputs always give different outputs: \(f(a)=f(b)\) implies \(a=b\).
You can check this on a graph. If some horizontal line meets the graph twice, two different inputs share an output, so the function is not one-to-one.
A function is one-to-one if and only if every horizontal line crosses its graph at most once.
The parabola \(y=x^2\) fails the test: the line \(y=4\) meets it at \(A(-2,4)\) and \(B(2,4)\). By contrast \(y=x^3\) and every non-constant linear function pass. A function that is strictly increasing, or strictly decreasing, on its domain is one-to-one.
On my planet we repair a failing function by cutting its domain in half. Restrict \(x^2\) to \(x\ge 0\) and the horizontal line test is passed!
4. Finding an inverse function
If \(f\) is one-to-one, it can be “undone”. The function that undoes it is its inverse.
If \(f\) is one-to-one, its inverse \(f^{-1}\) is the function that satisfies \(f^{-1}(f(x))=x\) for every \(x\) in the domain of \(f\), and \(f(f^{-1}(y))=y\) for every \(y\) in the range of \(f\). The domain of \(f^{-1}\) is the range of \(f\), and the range of \(f^{-1}\) is the domain of \(f\).
The symbol \(f^{-1}(x)\) does not mean \(\dfrac{1}{f(x)}\). It is a notation for the inverse function.
- Check that \(f\) is one-to-one (restrict its domain if needed).
- Write \(y=f(x)\).
- Solve this equation for \(x\) in terms of \(y\).
- Swap the names: write the result as \(f^{-1}(x)\).
- Verify with \(f(f^{-1}(x))=x\) and state the domain.
Let \(f(x)=\dfrac{2x+1}{x-3}\) for \(x\neq 3\). Set \(y=\dfrac{2x+1}{x-3}\), so \(y(x-3)=2x+1\), then \(xy-3y=2x+1\) and \(x(y-2)=3y+1\). Hence \(x=\dfrac{3y+1}{y-2}\).
So \(f^{-1}(x)=\dfrac{3x+1}{x-2}\) with \(x\neq 2\). Check: \(f(5)=\dfrac{11}{2}\) and \(f^{-1}\!\left(\dfrac{11}{2}\right)=\dfrac{35/2}{7/2}=5\).
The function \(f(x)=x^2-4x+7\) is not one-to-one, but on \(x\ge 2\) it is. Complete the square: \(f(x)=(x-2)^2+3\), with range \([3,\infty)\).
From \(y=(x-2)^2+3\) with \(x\ge2\): \(x=2+\sqrt{y-3}\). So \(f^{-1}(x)=2+\sqrt{x-3}\), with domain \([3,\infty)\) and range \([2,\infty)\).
5. Graphs of inverses
If the point \((a,b)\) lies on the graph of \(f\), then \(f(a)=b\), so \(f^{-1}(b)=a\) and the point \((b,a)\) lies on the graph of \(f^{-1}\).
The graph of \(f^{-1}\) is the reflection of the graph of \(f\) across the line \(y=x\).
In the figure, the purple curve is \(f(x)=\sqrt{x+2}\), whose inverse is \(f^{-1}(x)=x^2-2\) for \(x\ge 0\) (orange curve). The gray line is \(y=x\). Notice that \((-1,1)\) on \(f\) matches \((1,-1)\) on \(f^{-1}\). The domain \([-2,\infty)\) and range \([0,\infty)\) of \(f\) have swapped roles for \(f^{-1}\).
6. Piecewise and absolute value functions
A piecewise function uses different formulas on different parts of its domain. The absolute value function is the most famous example:
\[|x|=\begin{cases} x & \text{if } x\ge 0\\ -x & \text{if } x\lt 0\end{cases}\]
Geometrically, \(|x-c|\) is the distance between \(x\) and \(c\). To solve \(|x-c|=d\) with \(d\gt0\), split into \(x-c=d\) or \(x-c=-d\).
The graph above is \(p(x)=2x+1\) for \(x\lt1\) and \(p(x)=4-x\) for \(x\ge1\). Both pieces give \(3\) at \(x=1\), so there is no jump, only a corner.
Write \(h(x)=|x-2|+|x+1|\) without absolute values. The critical numbers are \(-1\) and \(2\).
- If \(x\lt-1\): \(h(x)=-(x-2)-(x+1)=1-2x\).
- If \(-1\le x\lt2\): \(h(x)=(2-x)+(x+1)=3\).
- If \(x\ge2\): \(h(x)=(x-2)+(x+1)=2x-1\).
Check at \(x=3\): \(|1|+|4|=5=2(3)-1\).
7. Transformations of parent graphs
Every function in a family comes from a parent function such as \(x^2\), \(x^3\), \(\sqrt{x}\), \(|x|\) or \(\dfrac1x\). The function \(y=a\,f(x-h)+k\) is obtained from \(y=f(x)\) by simple moves.
- \(h\): shift right by \(h\) (left if \(h\lt0\)); \(k\): shift up by \(k\) (down if \(k\lt0\)).
- \(a\): vertical stretch by \(|a|\) if \(|a|\gt1\), shrink if \(|a|\lt1\); reflection in the x-axis if \(a\lt0\).
- \(y=f(bx)\): horizontal compression by the factor \(\dfrac1{|b|}\) if \(|b|\gt1\) (stretch if \(|b|\lt1\)); reflection in the y-axis if \(b\lt0\).
A point \((x,y)\) on the parent graph moves to \((x+h,\;a\,y+k)\) on the image of \(y=a f(x-h)+k\).
Start from \(y=x^2\) and obtain \(g(x)=-(x-2)^2+3\): shift right 2, reflect in the x-axis, shift up 3. The vertex moves from \((0,0)\) to \((2,3)\), and the parabola opens downward. The x-intercepts satisfy \((x-2)^2=3\), so \(x=2\pm\sqrt3\).
8. Even and odd functions
- \(f\) is even if \(f(-x)=f(x)\) for all \(x\) in its domain (the graph is symmetric about the y-axis).
- \(f\) is odd if \(f(-x)=-f(x)\) for all \(x\) in its domain (the graph is symmetric about the origin).
- Compute \(f(-x)\) and simplify.
- Compare with \(f(x)\) and with \(-f(x)\).
- If neither matches, the function is neither even nor odd. Remember that a single counterexample is enough to disprove a symmetry.
\(f(x)=x^4-3x^2\): \(f(-x)=x^4-3x^2=f(x)\), so it is even.
\(g(x)=x^3-5x\): \(g(-x)=-x^3+5x=-g(x)\), so it is odd.
\(h(x)=x^2+x\): \(h(1)=2\) but \(h(-1)=0\), which is neither \(2\) nor \(-2\), so \(h\) is neither.
Useful facts: the product of two odd functions is even; the product of an even and an odd function is odd; and if an odd function is defined at \(0\), then \(f(0)=0\).
Key takeaways
- \((f\circ g)(x)=f(g(x))\): the inner function acts first, and usually \(f\circ g\neq g\circ f\).
- The domain of \(f\circ g\) needs \(x\) in the domain of \(g\) and \(g(x)\) in the domain of \(f\).
- One-to-one means every horizontal line meets the graph at most once; only such functions have inverses.
- To find \(f^{-1}\): solve \(y=f(x)\) for \(x\), then swap names; domain and range exchange roles.
- The graph of \(f^{-1}\) is the mirror image of the graph of \(f\) across \(y=x\).
- For piecewise and absolute value functions, split at the critical numbers and treat each case.
- \(y=a f(x-h)+k\) shifts, stretches and reflects the parent graph; \((x,y)\to(x+h,\,ay+k)\).
- Even: \(f(-x)=f(x)\). Odd: \(f(-x)=-f(x)\).
Test yourself: quick challenge for Grade 12
Speed drill for Grade 12: how many in 60 seconds?
🚀 Keep exploring with Zyro
✏️ Math practiceFunction Composition and Inverses: math practice, Grade 12
📝 Math testsFunction Composition and Inverses: math test, Grade 12
🎯 Math quizzesFunction Composition and Inverses: math quiz, Grade 12
✏️ Math practiceTrigonometric Functions and the Unit Circle: math practice, Grade 12
✏️ Math practiceGraphs of Trigonometric Functions: math practice, Grade 12
📝 Math testsTrigonometric Functions and the Unit Circle: math test, Grade 12

