A relation links one set of values to another. A function is a relation with one extra rule, and that rule is what makes the whole of the rest of mathematics work.
Relations and functions
A relation can be given as a set of ordered pairs, a mapping diagram, a table, a graph or a rule.
{(1,3),(2,5),(4,9)}
A relation is a function when every input has exactly one output.
{(1,2),(2,4),(3,6)} is a function — each of 1, 2 and 3 leads to a single value.
{(1,3),(2,5),(1,7),(4,9)} is not a function, because the input 1 leads to both 3 and 7.
The vertical line test
On a graph, a relation is a function if no vertical line crosses the curve more than once. A vertical line represents a single x value, so two crossings would mean one input with two outputs.
A circle fails the test. A straight line (that is not vertical) passes it. A parabola y=x2 passes it.
Domain and range
The domain is the set of inputs. The range is the set of outputs actually produced.
For {(1,3),(2,5),(4,9)}:
Domain: {1,2,4}
Range: {3,5,9}
Find the range of f(x)=x2 for the domain {−2,−1,0,1,2}.
Square each input: 4,1,0,1,4. A set does not repeat values, so the range is {0,1,4}.
Function notation
f(x) is read "f of x" and names the output of the function f for the input x. It does not mean f multiplied by x.
To evaluate, replace every x with the given value.
If f(x)=2x+7, find f(3).
f(3)=2(3)+7=6+7=13
If f(x)=5−2x, find f(−3).
f(−3)=5−2(−3)=5+6=11
You can also work backwards. If f(x)=4x−3 and f(x)=9, find x.
4x−3=9⇒4x=12⇒x=3
Composite functions
fg(x) means: apply g first, then apply f to the result. Work from the inside out, exactly as with brackets.
Let f(x)=3x−5 and g(x)=x+2.
fg(x)=f(x+2)=3(x+2)−5=3x+6−5=3x+1
Going the other way:
gf(x)=g(3x−5)=(3x−5)+2=3x−3
Check numerically at x=3: fg(3)=3(3)+1=10, and going step by step, g(3)=5 then f(5)=10 ✓. Meanwhile gf(3)=3(3)−3=6 — a different answer, as expected.
Inverse functions
f−1(x) undoes f. If f turns 4 into 7, then f−1 turns 7 back into 4.
To find it: write y=f(x), make x the subject, then swap the letters.
Find the inverse of f(x)=3x−5.
y=3x−5y+5=3xx=3y+5f−1(x)=3x+5
Check: f(4)=3(4)−5=7, and f−1(7)=37+5=4 ✓ — back where we started.
Solving equations graphically
Where two graphs cross, both equations are satisfied at once — so the point of intersection is the solution of the simultaneous equations.
The lines y=2x+1 and y=7−x intersect. Find the point.
Algebraically, set them equal:
2x+1=7−x3x=6x=2
Then y=2(2)+1=5.
The lines cross at (2,5).
Reading a solution off a graph you have drawn gives an estimate, and the accuracy depends on your scale. If a question says "use your graph", an answer to one decimal place is normally expected, and you should say which graph you read it from.