Practice Maths

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.
ConceptRule / Example
Relation (not a function)x² + y² = 9 — one x-value maps to two y-values
Functiony = 2x + 1 — every x gives exactly one y
Function notationf(x) = x² − 3x; f(2) = 4 − 6 = −2
Natural domainf(x) = √x: domain is x ≥ 0 (cannot take √ of negatives)
Piecewise functionf(x) = { x + 2, x < 0 and x², x ≥ 0 }
Input x Function f(x) Output y
Hot Tip When finding the domain, look for two things: (1) no negative numbers under a square root, (2) no zero in the denominator. For a piecewise function, evaluate each piece on its own restricted domain, then combine.

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.

Exam Tip: f(x + 1) ≠ f(x) + 1 in general. These are two completely different things. f(x + 1) involves substituting (x+1) into the formula; f(x) + 1 means evaluating f at x and then adding 1. Only for linear functions f(x) = mx + c do these sometimes simplify to a related form, and even then they are not equal. Always go back to the formula and substitute carefully.
Exam Tip: The range of a function cannot simply be read off the formula — it must be derived. Many students assume the range is all real numbers. For f(x) = x² − 4, the range is y ≥ −4 (not all reals). For f(x) = √(x + 1) + 2, the range is y ≥ 2. The best strategy is to find the minimum or maximum output by identifying the vertex, endpoint, or asymptote, then state the range accordingly.

Mastery Practice

  1. Fluency

    For each of the following, state whether it is a function or just a relation, and give a reason.

    1. (a) y = 3x − 5
    2. (b) x² + y² = 16
    3. (c) y = x²
    4. (d) x = 4
    5. (e) y = √x
  2. Fluency

    Given f(x) = 2x² − 3x + 1, evaluate each of the following.

    1. (a) f(0)
    2. (b) f(2)
    3. (c) f(−1)
    4. (d) f(3) − f(1)
  3. Fluency

    State the natural domain of each function.

    1. (a) f(x) = 5x − 3
    2. (b) g(x) = √(2x − 6)
    3. (c) h(x) = 1/(x − 2)
    4. (d) p(x) = √(9 − x²)
  4. Fluency

    State the domain and range for each graph description.

    1. (a) f(x) = x² − 4
    2. (b) f(x) = √x + 1
    3. (c) f(x) = −x² + 9 (state the maximum value and the range)
  5. 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 }
  6. Understanding

    Functions from formulas.

    Substituting expressions. These require substituting expressions rather than numbers.
    1. (a) Given f(x) = 4x − 1, find f(2a) and simplify.
    2. (b) Given g(x) = x² + x, find g(x + 1) and expand fully.
    3. (c) Given h(x) = 2x + 3, show that h(a + b) = h(a) + h(b) − 3 for any values of a and b.
  7. 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.
    1. (a) Write a piecewise function C(d) that gives the cost in dollars for a journey of d km, where d ≥ 0.
    2. (b) Find the cost for a 1 km journey and a 5 km journey.
    3. (c) Find the distance travelled if the fare is $14.30.
  8. Understanding

    Identifying functions from graphs and tables.

    1. (a) A table of values has inputs 1, 2, 3, 4 and outputs 5, 7, 5, 9. Is this a function? Explain.
    2. (b) A table of values has inputs 1, 2, 2, 4 and outputs 3, 6, 8, 12. Is this a function? Explain.
    3. (c) Explain why a vertical line x = k (where k is a constant) is not a function.
  9. 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.
    1. (a) Write a piecewise function C(u) for the quarterly cost in dollars, where u is the number of kWh used.
    2. (b) Calculate the bill for a household that uses 480 kWh and one that uses 750 kWh.
    3. (c) A household’s bill was $225.50. How many kWh did they use? Show your working clearly.
  10. Problem Solving

    Function composition and inverse reasoning.

    Challenge. Given f(x) = 2x − 1 and g(x) = x² + 3.
    1. (a) Find f(g(2)) by first evaluating g(2), then applying f.
    2. (b) Find g(f(x)) as a simplified expression in x.
    3. (c) Is f(g(x)) = g(f(x))? Test with x = 2 and explain your finding.