Lesson 8: Functions
🎧 Audio narration for this lesson is coming soon.
A function is a machine with a contract: feed it any input from its domain, and it returns exactly one output. The Chinese term 函数 (hánshù), coined by Li Shanlan in 1859, captures it perfectly — a "container of numbers". Functions are the Gaokao's backbone: the paper's hardest questions are function questions, and Lessons 18–19 extend them into calculus. This lesson builds the core skills — notation, evaluation, domain and range, graphs, monotonicity, piecewise definitions — with the rigour the examination expects. Everything later (sequences, trig functions, derivatives) is this lesson wearing different clothes.
Definitions and notation
f(x) reads "f of x": the output when the rule f acts on the input x. The domain is the set of allowed inputs; the range is the set of outputs actually produced. Three domain restrictions cover nearly everything at this level: denominators nonzero, even roots of nonnegative quantities, and (later) logarithms of positive quantities. f(x + 1) means the rule applied to x + 1 — you substitute the whole expression, brackets and all. It does not mean f(x) + 1, and confusing the two is an error with its own special place in the mark scheme's list of traps.
Monotonicity: f is increasing on an interval if larger inputs give larger outputs (x₁ < x₂ implies f(x₁) < f(x₂)), decreasing if the inequality flips. Parabolas y = a(x − h)² + k have vertex (h, k), axis x = h, and are decreasing on one side, increasing on the other — the completed-square form from Lesson 6 displays all of this at a glance.
Worked examples
Worked example 1 — evaluation. Let f(x) = 2x² − 3x + 1. (a) f(−2) = 2 × 4 − 3 × (−2) + 1 = 8 + 6 + 1 = 15. (b) f(a + 1) = 2(a + 1)² − 3(a + 1) + 1 = 2(a² + 2a + 1) − 3a − 3 + 1 = 2a² + 4a + 2 − 3a − 3 + 1 = 2a² + a. Substitute the entire expression as one object, expand carefully, and only then simplify.
Worked example 2 — domain. Find the domain of f(x) = √(x − 2)/(x − 5). Two conditions: the root requires x − 2 ≥ 0, i.e. x ≥ 2; the denominator requires x − 5 ≠ 0, i.e. x ≠ 5. Domain: x ≥ 2 with x ≠ 5, written [2, 5) ∪ (5, ∞). Both conditions must hold simultaneously — "and", not "or".
Worked example 3 — reading a parabola. Analyse y = (x − 2)² − 3. Vertex (2, −3); axis x = 2; opens upward; decreasing on (−∞, 2], increasing on [2, ∞); minimum value −3 at x = 2; x-intercepts where (x − 2)² = 3, i.e. x = 2 ± √3; y-intercept at x = 0: y = 4 − 3 = 1. From one completed-square form, the entire graph. Range: y ≥ −3.
Worked example 4 — a piecewise function. The taxi fare from Lesson 2 is a function: f(x) = 10 for 0 < x ≤ 3, and f(x) = 10 + 2.4(x − 3) for x > 3, where x is distance in km. Evaluate: f(2) = ¥10; f(3) = ¥10 (the boundary belongs to the first piece — check which piece owns it); f(12.5) = 10 + 2.4 × 9.5 = ¥32.8, matching Lesson 2 exactly. Piecewise definitions are how real pricing works; the skill is selecting the right piece before computing.
Worked example 5 — composition. Let f(x) = x² and g(x) = x + 3. Then f(g(2)) = f(5) = 25, but g(f(2)) = g(4) = 7. Composition does not commute: the inner function acts first, and swapping the order changes the result. Nested evaluation — inside out — is the only safe order.
Challenge problem — Gaokao standard
Problem. Find the range of f(x) = x² − 2x + 3 for x in the interval [0, 4].
Solution. Complete the square: f(x) = (x − 1)² + 2. The vertex is at x = 1, which lies inside [0, 4], and the minimum value there is f(1) = 2. The function decreases on [0, 1] and increases on [1, 4], so the maximum on the interval is at whichever endpoint is farther from the vertex: f(0) = 3, f(4) = 16 − 8 + 3 = 11. Range: [2, 11]. The naive method — "range is f(0) to f(4)" — gives [3, 11] and misses the vertex dip. On a closed interval, a continuous function's extremes occur at critical points or endpoints; checking only endpoints is the error this problem exists to punish (Lesson 19 formalises it).
Common mistakes
- f(x + 1) = f(x) + 1. False in general: for f(x) = x², f(x + 1) = x² + 2x + 1. Substitute; never distribute f over addition.
- Domain conditions dropped. √(x − 2)/(x − 5) needs both conditions (Worked example 2). Each feature of the formula — root, denominator, log — contributes its own condition.
- Range from endpoints only. The vertex (Challenge problem) can beat both endpoints. Sketch or complete the square before concluding.
- Boundary ownership in piecewise functions. f(3) for the taxi function is ¥10 because the first piece includes 3. Check the inequality signs at every joint.
- Monotonicity claimed globally for parabolas. A parabola is not "increasing"; it is increasing on [h, ∞) and decreasing on (−∞, h]. Monotonicity is always stated on an interval.
Exam Experience
Multiple choice. The domain of f(x) = √(x + 2) + 1/(x − 1) is: A. x ≥ −2 B. x > −2, x ≠ 1 C. x ≥ −2, x ≠ 1 D. x ≠ 1 Answer: C. The root requires x ≥ −2 (equality allowed); the denominator requires x ≠ 1. Option B wrongly excludes −2, where the root is legitimately 0.
Fill in the blank. The minimum value of f(x) = x² − 4x + 1 on the interval [0, 3] is ____. Answer: −3. Vertex at x = 2 (inside the interval): f(2) = 4 − 8 + 1 = −3, beating the endpoints f(0) = 1 and f(3) = −2.
Solution question (10 marks). A farmer fences a rectangular pen against a long wall, using 60 m of fencing for the other three sides. Let x metres be the length of each side perpendicular to the wall. (1) Express the area A(x) and state its domain. (2) Find the maximum area. Marking scheme. (1) The side parallel to the wall is 60 − 2x — 2 marks. A(x) = x(60 − 2x) = −2x² + 60x — 1 mark. Domain: both lengths positive: x > 0 and 60 − 2x > 0, so 0 < x < 30 — 2 marks. [5 marks] (2) Complete the square: A(x) = −2(x − 15)² + 450 — 2 marks. Maximum 450 m² at x = 15 — 2 marks, plus 1 mark for confirming 15 lies in the domain. [5 marks] Total: 10 marks. (AM-GM from Lesson 7 gives the same result: x(30 − x) ≤ 15². Two tools, one answer — use whichever you see first.)
Going deeper — inverse functions and parity
A function with distinct outputs for distinct inputs can be inverted: run the machine backwards. Let f(x) = 2x − 3. Set y = 2x − 3 and solve for x: x = (y + 3)/2. The inverse is f⁻¹(x) = (x + 3)/2. Verify by composition both ways (the only honest test): f(f⁻¹(x)) = 2 × (x + 3)/2 − 3 = x ✓, and f⁻¹(f(x)) = (2x − 3 + 3)/2 = x ✓. Domain and range swap: f maps ℝ → ℝ here, but for f(x) = √x (domain x ≥ 0, range y ≥ 0) the inverse x² must carry the restriction x ≥ 0 — the range of the original becomes the domain of the inverse, and dropping that restriction is the standard error.
Composition can be startling. Let f(x) = (x − 1)/(x + 1). Compute f(f(x)): substitute the whole expression for x: numerator f(x) − 1 = (x − 1 − (x + 1))/(x + 1) = −2/(x + 1); denominator f(x) + 1 = (x − 1 + (x + 1))/(x + 1) = 2x/(x + 1). Divide: f(f(x)) = −2/(2x) = −1/x. Twice through an unpromising rational function produces a reciprocal — structure hides inside iteration, and Lesson 13's recursions exploit exactly this.
Parity. f is even if f(−x) = f(x) (graph symmetric about the y-axis: x², cos x) and odd if f(−x) = −f(x) (symmetric about the origin: x³, sin x). x² + x is neither (test x = 1: f(−1) = 0 ≠ ±f(1) = ±2... f(1) = 2, f(−1) = 0: neither equal nor opposite). Parity is a free symmetry check: an even function's integral over a symmetric interval doubles the half, and an odd function's vanishes — Lesson 19's world uses this constantly.
Second look — transformations and an equation in disguise
Start from y = x² and apply transformations in sequence: replace x by (x − 2) (shift right 2), then subtract 3 (shift down 3): y = (x − 2)² − 3 — Worked example 3's parabola, now derived rather than announced. The rules: f(x − h) shifts right by h (the counterintuitive sign: substituting x − 2 moves every point to larger x); f(x) + k shifts up by k; −f(x) reflects in the x-axis; f(−x) reflects in the y-axis. Sketching by transformation beats point-plotting whenever the parent graph is known.
Equation in disguise. Where does f(x) = x² − 4x + 1 meet the horizontal line y = 1? Set x² − 4x + 1 = 1: x² − 4x = 0, so x(x − 4) = 0 and x = 0 or x = 4. (Check against the graph: the vertex is (2, −3), the y-intercept is 1 — the meeting point (0, 1) — and symmetry about x = 2 gives the partner (4, 1) for free ✓.) Intersections of graphs are equations; Lesson 6 solves them, Lesson 8 interprets them, and Lessons 18–19 will take their limits and slopes. One idea, four costumes — the curriculum is more unified than its chapter list suggests.
📈 Interactive Graph: Function Explorer — Functions
Explore how functions behave — a core skill for Functions.
🎛️ Interactive Explorer: Quadratic Explorer — Functions
Drag the sliders to change the coefficients of y = ax² + bx + c and watch the parabola transform live.
Notice how a controls the width and direction, b shifts the axis of symmetry, and c moves the graph up and down.
Key Terms
- Function
- A rule assigning each input exactly one output; the central object of modern mathematics.
- Vertical line test
- A graph represents a function iff no vertical line hits it twice.
- Domain / Range
- The set of allowed inputs / possible outputs; always check both.
- Composition
- (f∘g)(x) = f(g(x)); chaining functions input-to-output.
- Transformation
- Shifts, stretches, reflections generating function families from parent graphs.
- Inverse function
- The undoing function f⁻¹; exists iff f is one-to-one; reflects over y = x.
- Vertex form
- y = a(x−h)² + k; reveals the parabola’s vertex (h, k) directly.
- Piecewise function
- Different formulas on different intervals; models real-world tiered pricing.
- One-to-one
- Each output comes from exactly one input; the invertibility condition.
Discussion Questions
- Find domain and range of f(x) = √(4 − x²). Interpret geometrically.
- Describe the transformations from y = x² to y = −3(x + 2)² − 5, then state vertex and range.
- Find the inverse of f(x) = (2x + 1)/(x − 3). State any domain restrictions.
- A delivery fee is ¥8 for ≤2 kg plus ¥3/kg beyond. Write the piecewise function and compute the fee for 5.5 kg.
- Two functions: f(x) = x² − 4, g(x) = 2x + 1. Compute (f∘g)(x) and (g∘f)(x). Are they equal? What lesson does this teach?