Functions, Relations and Function Notation
Key Terms
- A relation is any set of ordered pairs (x, y). It maps inputs to outputs, but one input can map to many outputs.
- A function is a special relation where every input (x-value) maps to exactly one output (y-value).
- The vertical line test: if any vertical line crosses the graph more than once, the relation is not a function.
- The domain is the set of all allowed input values (x-values).
- The range is the set of all resulting output values (y-values).
- Function notation
- : f(x) is read “f of x”. It means “the output of function f when the input is x”.
- The independent variable is x (the input); the dependent variable is y or f(x) (the output, which depends on x).
- A piecewise function uses different formulas over different parts of the domain.
| Concept | Rule / Example |
|---|---|
| Relation (not a function) | x² + y² = 9 — one x-value maps to two y-values |
| Function | y = 2x + 1 — every x gives exactly one y |
| Function notation | f(x) = x² − 3x; f(2) = 4 − 6 = −2 |
| Natural domain | f(x) = √x: domain is x ≥ 0 (cannot take √ of negatives) |
| Piecewise function | f(x) = { x + 2, x < 0 and x², x ≥ 0 } |
Worked Example 1 — Evaluating a function
Question: Given f(x) = 3x² − 2x + 1, find f(0), f(−1), and f(a + 1).
f(0): 3(0)² − 2(0) + 1 = 1
f(−1): 3(1) − 2(−1) + 1 = 3 + 2 + 1 = 6
f(a + 1): 3(a + 1)² − 2(a + 1) + 1 = 3(a² + 2a + 1) − 2a − 2 + 1 = 3a² + 4a + 2
Worked Example 2 — Domain and range
Question: State the natural domain and range of f(x) = √(x − 3).
Domain: Require x − 3 ≥ 0, so x ≥ 3. Domain: [3, ∞) or x ≥ 3.
Range: Since √(x − 3) ≥ 0 for all x in the domain, Range: y ≥ 0 or [0, ∞).
Worked Example 3 — Piecewise function
Question: Evaluate and sketch the piecewise function:
f(x) = { −x + 2, x < 0
x² + 1, x ≥ 0 }
f(−2): Use first piece (x < 0): −(−2) + 2 = 4
f(0): Use second piece (x ≥ 0): 0² + 1 = 1
f(3): Use second piece: 9 + 1 = 10
Note: At x = 0: left piece gives −(0) + 2 = 2 (open circle) but right piece gives 1 (closed circle), so f(0) = 1.
Relation vs Function: The Key Difference
A relation is any rule that connects inputs to outputs — it can be a formula, a graph, a table, or a set of ordered pairs. The only requirement is that inputs and outputs are paired. A function is a special relation with one additional requirement: every input maps to exactly one output.
Why does this matter? Functions are predictable and well-behaved: given an input, the output is uniquely determined. Relations that are not functions are ambiguous: given the same input, you might get different outputs depending on context. All the standard tools of calculus (derivatives, integrals) require functions. Relations that are not functions must be split into functional pieces before these tools can be applied.
Note: a function CAN have different inputs mapping to the same output. y = x² maps both x = 2 and x = −2 to y = 4 — this is fine. What is not allowed is one input mapping to two different outputs.
The Vertical Line Test: Why It Works
A vertical line x = k represents all points in the plane with x-coordinate equal to k. If such a line intersects the graph at two or more points, those points have the same x-coordinate but different y-coordinates — meaning the input k maps to multiple outputs. That violates the definition of a function.
So the vertical line test is not an arbitrary rule: it is a direct graphical translation of the definition. Every point on a vertical line has the same x-value, so two intersection points mean two y-values for one x-value — not a function.
The circle x² + y² = 9 fails the test because most vertical lines (for −3 < x < 3) intersect it twice. A horizontal parabola like x = y² also fails. A vertical line x = a (where a is fixed) fails dramatically — it is intersected by every horizontal line.
Domain and Range: What Values Are Allowed?
The natural domain is the largest set of real numbers for which the function formula makes sense. Two main restrictions:
(1) No division by zero: if the denominator contains x, exclude values making it zero. For f(x) = 1/(x−3), exclude x = 3; domain is x ≠ 3 or (−∞, 3) ∪ (3, ∞).
(2) No square roots of negative numbers: the expression under the root must be ≥ 0. For f(x) = √(2x − 6), require 2x − 6 ≥ 0, so x ≥ 3.
The range is the set of all actual output values. Finding the range from an equation requires careful analysis: for f(x) = x² − 4, the minimum value is −4 (at x = 0), so range is y ≥ −4. Reading range from a graph is often more straightforward than deriving it algebraically.
Function Notation f(x): Reading It Correctly
f(x) does NOT mean f multiplied by x. The notation f(x) means “the function named f, evaluated at x”. The f is the function (a rule or machine), and x is the input. f(2) means substitute x = 2 into the rule. f(a + b) means substitute the entire expression (a + b) for x.
A very common error: given f(x) = 3x + 1, students write f(x + 2) = 3x + 1 + 2 = 3x + 3. This is wrong. The correct calculation: f(x + 2) = 3(x + 2) + 1 = 3x + 6 + 1 = 3x + 7. The entire input (x + 2) replaces every occurrence of x in the formula.
Composite Functions: Order Matters
The composite function f(g(x)) means: apply g first to x, then apply f to the result. Read from the inside out: g acts first on x, then f acts on g(x). The notation f ˆ g (f composed with g) means the same thing.
Crucially, f(g(x)) and g(f(x)) are almost always different functions. For example, f(x) = x² and g(x) = x + 1: f(g(x)) = (x+1)² = x² + 2x + 1, while g(f(x)) = x² + 1. These are different. Order of composition matters just as order of operations matters.
Mastery Practice
-
Fluency
For each of the following, state whether it is a function or just a relation, and give a reason.
- (a) y = 3x − 5
- (b) x² + y² = 16
- (c) y = x²
- (d) x = 4
- (e) y = √x
-
Fluency
Given f(x) = 2x² − 3x + 1, evaluate each of the following.
- (a) f(0)
- (b) f(2)
- (c) f(−1)
- (d) f(3) − f(1)
-
Fluency
State the natural domain of each function.
- (a) f(x) = 5x − 3
- (b) g(x) = √(2x − 6)
- (c) h(x) = 1/(x − 2)
- (d) p(x) = √(9 − x²)
-
Fluency
State the domain and range for each graph description.
- (a) f(x) = x² − 4
- (b) f(x) = √x + 1
- (c) f(x) = −x² + 9 (state the maximum value and the range)
-
Fluency
For the piecewise function below, evaluate f(−3), f(0), f(1) and f(4).
f(x) = { 2x + 1 for x < 0
x² for 0 ≤ x ≤ 3
10 − x for x > 3 } -
Understanding
Functions from formulas.
Substituting expressions. These require substituting expressions rather than numbers.- (a) Given f(x) = 4x − 1, find f(2a) and simplify.
- (b) Given g(x) = x² + x, find g(x + 1) and expand fully.
- (c) Given h(x) = 2x + 3, show that h(a + b) = h(a) + h(b) − 3 for any values of a and b.
-
Understanding
Restricted domains and piecewise functions.
Real-world piecewise context. A taxi charges a flat fee of $3.50 for the first kilometre and then $2.10 per kilometre after that.- (a) Write a piecewise function C(d) that gives the cost in dollars for a journey of d km, where d ≥ 0.
- (b) Find the cost for a 1 km journey and a 5 km journey.
- (c) Find the distance travelled if the fare is $14.30.
-
Understanding
Identifying functions from graphs and tables.
- (a) A table of values has inputs 1, 2, 3, 4 and outputs 5, 7, 5, 9. Is this a function? Explain.
- (b) A table of values has inputs 1, 2, 2, 4 and outputs 3, 6, 8, 12. Is this a function? Explain.
- (c) Explain why a vertical line x = k (where k is a constant) is not a function.
-
Problem Solving
Modelling with piecewise functions.
Challenge. An electricity plan charges $0.22 per kWh for the first 500 kWh per quarter, then $0.35 per kWh for usage above 500 kWh.- (a) Write a piecewise function C(u) for the quarterly cost in dollars, where u is the number of kWh used.
- (b) Calculate the bill for a household that uses 480 kWh and one that uses 750 kWh.
- (c) A household’s bill was $225.50. How many kWh did they use? Show your working clearly.
-
Problem Solving
Function composition and inverse reasoning.
Challenge. Given f(x) = 2x − 1 and g(x) = x² + 3.- (a) Find f(g(2)) by first evaluating g(2), then applying f.
- (b) Find g(f(x)) as a simplified expression in x.
- (c) Is f(g(x)) = g(f(x))? Test with x = 2 and explain your finding.