Functions & Relations
Every time your phone recognises your face, it relies on a simple mathematical rule: one input, one output. That's the essence of a function — and it governs far more than just your lock screen.
Practise this lesson
Three printable worksheets that build from foundations to mastery — or build your own from any module’s questions.
Your phone's face unlock works because it has learned a rule: your face (the input) must produce exactly one answer — unlock or don't unlock. What do you think would happen if the same face could produce two different answers? And how is this idea connected to mathematics?
$$y = f(x)$$
Key insight: $f(x)$ is read as "$f$ of $x$" — it describes a rule, not a multiplication.
Key facts
- the definition of a function and a relation
- how to use function notation $f(x)$
- the vertical line test
Concepts
- why a function allows only one output per input
- the difference between independent and dependent variables
- how the vertical line test works graphically
Skills
- evaluate functions for given inputs
- apply the vertical line test to graphs
- distinguish functions from relations
In mathematics, a relation is any set of ordered pairs that connects inputs to outputs. A function is a special kind of relation with one strict rule: each input must be connected to exactly one output.
Think of a function like a machine. You put a number in, the machine applies a rule, and exactly one number comes out. If the same input could produce two different outputs, the machine would be unpredictable — and it would no longer be a function.
The vertical line test
On a graph, we can test whether a relation is a function using the vertical line test:
- If every vertical line intersects the graph at most once, the relation is a function.
- If any vertical line intersects the graph more than once, the relation is not a function.
A relation = any set of ordered pairs connecting inputs to outputs; A function = a relation where each input has exactly one output
Pause — copy the function definition (each input maps to exactly one output) and the vertical line test rule into your book.
Did you get this? True or false: a circle with equation $x^2 + y^2 = 25$ represents a function.
Quick check: Which of these is the best description of a function?
We just saw that a function requires exactly one output per input, and the vertical line test detects this on a graph. That raises a question: once we know something is a function, how do we write and evaluate it efficiently? This card answers it → introducing $f(x)$ notation and the independent/dependent variable distinction.
Every function has two kinds of variables:
- Independent variable ($x$): The value you choose or control — the input.
- Dependent variable ($f(x)$ or $y$): The value that results from applying the function's rule — the output.
For example, if $f(x) = 2x + 3$, then:
- $f$ is the name of the function
- $x$ is the input (independent variable)
- $2x + 3$ is the rule that produces the output (dependent variable)
We can also name functions with other letters: $g(x)$, $h(x)$, or even descriptive names like $C(t)$ for "cost as a function of time."
Independent variable: the input — what you choose (usually $x$); Dependent variable: the output — what depends on the input (usually $f(x)$ or $y$)
Pause — copy the independent/dependent variable definitions and the reading rule ($f(x)$ means "$f$ of $x$", not $f$ times $x$) into your book.
Fill the blanks: drag each token into the matching blank.
In $f(x)$, the variable $x$ is the ___ and the ___ variable. The value $f(x)$ is the ___ and the ___ variable.
Worked examples · reveal as you go
If $f(x) = x^2 - 3x + 5$, find the value of $f(2)$ and $f(-1)$.
Determine whether the graph of $x = y^2$ represents a function.
Common mistakes · the 3 traps that cost marks
Thinking $f(x)$ means $f$ multiplied by $x$
The notation $f(x)$ is function notation, not multiplication. $f$ is the name of the function and $x$ is the input. Treating it as multiplication leads to completely wrong answers in every function question.
✓ Fix: Always read $f(x)$ as "$f$ of $x$" — the output of function $f$ when the input is $x$.
Using a horizontal line instead of a vertical line for the test
Some students use a horizontal line. The vertical line test checks whether one input maps to multiple outputs. A horizontal line test checks for one-to-one functions — that's a different concept entirely.
✓ Fix: Remember — vertical line = function test. If it crosses more than once, it's not a function.
Assuming all relations are functions
Circles, sideways parabolas, and many other graphs are relations but not functions. Every function is a relation, but not every relation is a function.
✓ Fix: Always check the "one output per input" rule before calling a relation a function.
Activity 1 — Function or not a function?
For each relation below, decide whether it is a function or not. Explain your reasoning in terms of the "one input, one output" rule.
$y = 2x + 1$
A circle with equation $x^2 + y^2 = 25$
The set of ordered pairs: $(1, 2), (2, 3), (3, 4), (1, 5)$
$y = |x|$
Odd one out: Which of these is NOT a function? Select one.
Activity 2 — Identify the variables
For each situation, identify the independent and dependent variables, then write the relationship using function notation.
A taxi ride costs $5 as a flag fall plus $2 per kilometre. The total cost $C$ depends on the distance $d$ in kilometres: $C(d) = 5 + 2d$.
Identify: (a) the independent variable; (b) the dependent variable; (c) write in function notation.
The area of a square depends on its side length $s$: $A(s) = s^2$.
Identify: (a) the independent variable; (b) the dependent variable.
A scientist records that the temperature $T$ of an object increases as it is exposed to sunlight for $t$ minutes. Write a function notation for this relationship.
Quick-fire practice · 5 reps +2 XP per reveal
Given $f(x) = 3x - 7$, find $f(4)$.
Given $g(x) = x^2 + 2x$, find $g(-3)$.
Does the graph of $y = x^3$ pass the vertical line test? Is it a function?
In $C(t) = 20 + 0.5t$, which is the independent variable and which is the dependent variable?
A relation has ordered pairs $(1,3), (2,5), (3,7), (2,9)$. Is it a function? Explain.
Earlier you were asked: What would happen if the same face could produce two different answers? And how is this connected to mathematics?
If the same input (your face) could produce two different outputs (unlock and don't unlock), the system would be completely unreliable. In mathematics, this is exactly what distinguishes a function from a general relation: a function guarantees exactly one output for every input. This rule of unique outputs makes functions predictable, powerful, and essential for everything from phone security to engineering design.
Pick your answer, then rate your confidence — that tells the system what to drill next.
Q1. Explain the difference between a function and a relation. In your answer, describe how the vertical line test can be used to determine whether a graph represents a function. (3 marks)
Q2. Consider the function $f(x) = 3x^2 - 2x + 4$. (a) Evaluate $f(2)$. (b) Evaluate $f(-1)$. Show all working. (3 marks)
Q3. A smartphone's face unlock system uses a mathematical rule to check whether an image matches the owner's face. The rule must always produce the same output for the same input. Evaluate whether the rule "$y$ equals the square root of $x$" ($y = \sqrt{x}$) would be suitable as the basis for a face unlock system. Justify your answer with reference to the definition of a function. (4 marks)
📖 Comprehensive answers (click to reveal)
Multiple choice — drill bank
MC answers and feedback are shown inline as you complete each question. Use the retry button to attempt a fresh set.
Activity 1 — Sort + Classify model answers
A. $y = 2x + 1$ — Function. It is a straight line; any vertical line will intersect it exactly once. Every input $x$ gives exactly one output $y$.
B. $x^2 + y^2 = 25$ (circle) — Not a function. A vertical line through the centre intersects the circle twice (e.g. at $x = 0$, $y = 5$ and $y = -5$). One input maps to two outputs.
C. $(1, 2), (2, 3), (3, 4), (1, 5)$ — Not a function. The input $1$ appears twice with different outputs ($2$ and $5$), violating the one-input-one-output rule.
D. $y = |x|$ — Function. The graph is a V-shape. Every vertical line intersects it at most once. Each $x$ produces exactly one $y$-value.
Activity 2 — Identify the variables model answers
1. Independent = distance $d$ (km); Dependent = total cost $C$ ($). Notation: $C(d) = 5 + 2d$
2. Independent = side length $s$; Dependent = area $A$. Notation: $A(s) = s^2$
3. Independent = time $t$ (minutes); Dependent = temperature $T$ (°C). Notation: $T(t)$ (exact formula not required)
Short answer model answers
Q1 (3 marks): A relation is any set of ordered pairs that connects inputs to outputs [1]. A function is a special type of relation where each input is paired with exactly one output [1]. The vertical line test checks whether any vertical line intersects a graph more than once; if it does, the relation is not a function because one input would map to multiple outputs [1].
Q2 (3 marks):
(a) $f(2) = 3(2)^2 - 2(2) + 4 = 12 - 4 + 4 = \mathbf{12}$ ✓
(b) $f(-1) = 3(-1)^2 - 2(-1) + 4 = 3 + 2 + 4 = \mathbf{9}$ ✓
Award 1 mark each for correct evaluation with working shown.
Q3 (4 marks): The rule $y = \sqrt{x}$ is technically a function for $x \geq 0$ because the principal square root produces exactly one non-negative output for each non-negative input [1–2]. However, it is not suitable for a face unlock system: its domain is restricted to $x \geq 0$ [1], and far more critically, a face-recognition system requires a complex rule that can distinguish between millions of different faces — $y = \sqrt{x}$ is far too simple and maps all inputs to the same type of output regardless of their structure [1].
Five timed questions on functions and relations. Beat the boss to bank a tier — gold (perfect + fast), silver (80%+), or bronze (cleared).
⚔ Enter the arenaClimb platforms, hit checkpoints, and answer functions questions. Quick recall, lighter than the boss.
Mark lesson as complete
Tick when you've finished the practice and review.