One function, two rules, and a condition that says which one you are in.
Given
f(x) = 2x + 1 if x < 2
f(x) = x² − 3 if x ≥ 2
Find f(2).
x = 2 satisfies x ≥ 2, so the second rule owns it: 2² − 3 = 1. D uses the first rule (2(2) + 1 = 5), but that branch requires x < 2 strictly. The equals sign decides who gets the boundary point.
1
The condition chooses the rule.
Test the input first. Only then do any arithmetic.
Input
Which condition holds
Rule to use
x = 0
0 < 2 ✓
2x + 1
x = 2
2 ≥ 2 ✓
x² − 3
x = 5
5 ≥ 2 ✓
x² − 3
A piecewise function is still one function: every input gets exactly one output.
The conditions are written so that they never overlap and never leave a gap.
2
Substitute into the chosen rule only.
f(0) = 2(0) + 1
0 is below 2
= 1
the linear piece
f(5) = 5² − 3
5 is at or above 2
= 22
the quadratic piece
Never both
Running the input through each rule and adding, or picking whichever looks
nicer, are both ways of answering a question nobody asked. One input, one
condition, one rule.
3
The boundary belongs to one side.
Here x ≥ 2 owns the number 2, because that is where the “or equal to” sits.
f(2) = 2² − 3
the ≥ rule wins
= 1
not 5
2(2) + 1 = 5
what the other rule would have given
f(0) = 1 · f(2) = 1 · f(5) = 22
Read the inequality signs before anything else
Swap < and ≤ and the value at the boundary changes completely. It is the one
number the question is guaranteed to ask about, and 5 will be sitting there in
the choices.
4
Graph each piece only where it lives.
filled circle ●
the point is included
from ≤ or ≥
open circle ○
the curve stops just short
from < or >
The jump from 5 down to 1 at x = 2 is real — the graph is broken there. Only one of
the two circles is filled, so the function still gives one answer.
The extra charge applies to the hours beyond the first three, so the
subtraction has to be inside the bracket. Charging 15t would bill the flat-rate
hours twice.
6
“Or any part of an hour” rounds up.
A lot charges ₱30 for the first hour or any part of it, then ₱12 for each additional hour or part of an hour. A car stays 4 hours 20 minutes. Then: a driver paid ₱90 — what is the longest stay?
4 h 20 min − 1 h = 3 h 20 min
time beyond the flat band
3 h 20 min → 4 chargeable hours
the 20 minutes start a whole new hour
30 + 12 × 4 = ₱78
not 30 + 12 × 3⅓ = ₱70
Backwards: (90 − 30) ÷ 12 = 5 extra hours
take off the flat band first
1 + 5 = 6 hours at most
one minute more starts a 6th extra hour
Two traps in one fare
Charging the fraction exactly (3⅓ hours) undercharges, and dividing ₱90 by ₱12
forgets the flat first band. Subtract the band, round the rest up.
7
Variations: three pieces with a negative input, and f(f(x)).
Three pieces, a negative input. Let f(x) = 1 − x² if x < −1, f(x) = 3 if −1 ≤ x ≤ 2, and f(x) = 2x − 1 if x > 2. Find f(−3), f(2) and f(2.5).
f(−3) = 1 − (−3)² = 1 − 9 = −8
−3 < −1: first piece; square in brackets
f(2) = 3
−1 ≤ 2 ≤ 2: the middle piece owns 2
f(2.5) = 2(2.5) − 1 = 4
2.5 > 2: last piece
What is different: a constant piece ignores x completely, and a middle condition has two ends to test.
1 − x² at x = −3 is not 10
Squaring comes before the minus in front: 1 − (−3)² = 1 − 9 = −8. Writing
1 + 9 = 10 lets the minus in front cancel the minus of −3, as if the square
were not there.
A function of a function. Let f(x) = x² if x < 3, and f(x) = 10 − 2x if x ≥ 3. Find f(f(2)).
f(2) = 2² = 4
inside first: 2 < 3, the square piece
f(f(2)) = f(4)
the output becomes the new input
f(4) = 10 − 2(4) = 2
4 ≥ 3: now the OTHER piece
What is different: the condition is tested twice, once per input. Using x² again would give 16, the wrong answer.
8
Solving f(x) = a number: solve each piece, then check its condition.
Let f(x) = x² − 4 if x ≤ 1, and f(x) = 2x + 3 if x > 1. Solve f(x) = 5.
x² − 4 = 5 → x = 3 or x = −3
first piece
keep −3, reject 3
this piece only lives at x ≤ 1
2x + 3 = 5 → x = 1
second piece
reject 1
this piece needs x > 1, and 1 is not
x = −3 only
one solution, not three
Check: f(−3) = 9 − 4 = 5 ✓, while f(1) = 1 − 4 = −3 and f(3) = 2(3) + 3 = 9. The
same habit answers “how many solutions” and f(f(x)) questions: work inside out,
choosing the rule fresh at every step.
A letter inside a rule works the same way. Let h(x) = mx − 2 if x < 1, and h(x) = x² + m if x ≥ 1, with h(1) = 5. The input 1 lives in the x ≥ 1 piece, so 1 + m = 5 and m = 4. Now use m in the other piece: h(−2) = 4(−2) − 2 = −10.
On the exam
The boundary value, a fare with “or any part of”, and “how many x give f(x) = c”
are the favourites. For each candidate answer, spend two seconds asking “which
condition does this x satisfy?” — that alone kills most wrong choices.
✓
Check: creep up on the boundary.
Values just below 2 should follow the line; values at 2 and above should follow the parabola.
x = 1.92(1.9) + 1 = 4.8heading for 5
x = 22² − 3 = 1the jump ✓
x = 2.12.1² − 3 = 1.41rising from 1 ✓
Remember the flow
Test the condition · Use that rule only · Watch the boundary
Open circle for a strict inequality, filled for “or equal to”.
Now you try
Practice problem
Given g(x) = x² + 1 if x < −1, and 4 − 3x if x ≥ −1
Find g(−1) + g(−3).
−1 satisfies x ≥ −1, so g(−1) = 4 − 3(−1) = 7. −3 is below −1, so g(−3) = (−3)² + 1 = 10. Sum: 7 + 10 = 17. A gives the boundary to the wrong rule: (−1)² + 1 = 2, and 2 + 10 = 12. C sends −3 through the second rule: 4 − 3(−3) = 13, and 7 + 13 = 20. D drops the sign in 4 − 3(−1), getting 1 instead of 7: 1 + 10 = 11.