Intuition What this page is
The parent note taught you how to read f ( x ) : a name (f , the machine), an input (x , what you feed it), and the output f ( x ) (what drops out). This page is the drill floor. We will hit every kind of thing you can shove into a function machine — positive numbers, negatives, zero, whole expressions , nested functions, and a word problem — so no exam case surprises you.
Before we compute anything, we lay out a map of all the cases . Then every worked example is stamped with which square of that map it lives in.
Every function-notation question is one of these "case classes". A blank cell means "we still owe you an example there" — by the end, none are blank.
Case class
What makes it tricky
Covered in
Positive input
plain substitution
Ex 1
Negative input
sign traps: ( − a ) 2 = + a 2
Ex 1
Zero input
most terms vanish → the y -intercept
Ex 1
Fraction / decimal input
arithmetic care, no new rule
Ex 2
Expression as input (f ( a + h ) )
replace every x by the whole blob
Ex 3
Composition f ( g ( x )) vs g ( f ( x ))
order matters, inside-out
Ex 4
Solving f ( x ) = c (working backwards)
notation read in reverse
Ex 5
Difference quotient (limiting behaviour)
the gateway to Limits and calculus
Ex 6
Word problem (real units)
translate English → machine
Ex 7
Exam twist (f ( f ( x )) , piecewise)
self-composition + Piecewise functions
Ex 8
Let me set two functions we will reuse:
f ( x ) = 3 x 2 − 2 x + 5 , g ( x ) = 2 x − 3.
Worked example Example 1 — Positive, negative AND zero input (cells: positive / negative / zero)
For f ( x ) = 3 x 2 − 2 x + 5 , find f ( 2 ) , f ( − 1 ) and f ( 0 ) .
Forecast: Guess the sign of each answer. Will f ( − 1 ) be bigger or smaller than f ( 2 ) ? (Hint: negatives sometimes make quadratics bigger , not smaller.)
Step 1 — f ( 2 ) : substitute 2 for every x .
f ( 2 ) = 3 ( 2 ) 2 − 2 ( 2 ) + 5 = 3 ⋅ 4 − 4 + 5 = 13.
Why this step? The rule f says "square it, times 3, minus twice it, plus 5". Every x is a slot; we drop 2 into all of them.
Step 2 — f ( − 1 ) : the sign trap.
f ( − 1 ) = 3 ( − 1 ) 2 − 2 ( − 1 ) + 5.
Why this step? Two danger points: ( − 1 ) 2 = + 1 (a square is never negative), and − 2 × ( − 1 ) = + 2 (minus times minus is plus). Both terms turn positive .
= 3 ( 1 ) + 2 + 5 = 10.
Step 3 — f ( 0 ) : watch the terms disappear.
f ( 0 ) = 3 ( 0 ) 2 − 2 ( 0 ) + 5 = 0 − 0 + 5 = 5.
Why this step? Anything times 0 is 0 , so only the constant survives. That leftover number is exactly where the graph crosses the vertical axis — the y -intercept . See the picture.
Verify: Plug the outputs back as points. The parabola through ( 2 , 13 ) , ( − 1 , 10 ) , ( 0 , 5 ) opens upward and its lowest point sits between x = − 1 and x = 2 — consistent with all three heights being positive. ✓
Worked example Example 2 — Fraction and decimal input (cell: fraction/decimal)
For g ( x ) = 2 x − 3 , find g ( 2 1 ) and g ( 1.5 ) .
Forecast: One of these lands exactly on zero. Guess which.
Step 1 — g ( 2 1 ) .
g ( 2 1 ) = 2 ⋅ 2 1 − 3 = 1 − 3 = − 2.
Why this step? Nothing new — the machine doesn't care whether the input is whole or a fraction. 2 × 2 1 = 1 .
Step 2 — g ( 1.5 ) .
g ( 1.5 ) = 2 ( 1.5 ) − 3 = 3 − 3 = 0.
Why this step? 2 × 1.5 = 3 , and 3 − 3 = 0 . So x = 1.5 is the input that makes g output nothing — the root of g .
Verify: 1.5 = 2 3 , and 2 ⋅ 2 3 = 3 , and 3 − 3 = 0 . ✓ (Your forecast should have picked 1.5 .)
Worked example Example 3 — A whole expression as input (cell: expression input)
For f ( x ) = 3 x 2 − 2 x + 5 , find f ( a + h ) , fully expanded.
Forecast: Will the answer contain a lone h 2 term? Yes/No — decide before reading.
Step 1 — Replace every x by the blob ( a + h ) .
f ( a + h ) = 3 ( a + h ) 2 − 2 ( a + h ) + 5.
Why this step? The slot doesn't know if you feed it a number or an expression. The whole ( a + h ) is one input — brackets keep it together so we don't square only part of it.
Step 2 — Expand ( a + h ) 2 .
( a + h ) 2 = a 2 + 2 ah + h 2 .
Why this step? This is ( a + h ) ( a + h ) multiplied out; forgetting the middle 2 ah is the classic slip.
Step 3 — Distribute and collect.
f ( a + h ) = 3 a 2 + 6 ah + 3 h 2 − 2 a − 2 h + 5.
Why this step? Multiply the 3 and − 2 through, then there's nothing to combine — every term has a different mix of a and h .
Verify: Set h = 0 : it must collapse back to f ( a ) . Indeed 3 a 2 + 0 + 0 − 2 a − 0 + 5 = 3 a 2 − 2 a + 5 = f ( a ) . ✓ (And yes, the 3 h 2 term survives.)
Worked example Example 4 — Order matters:
f ( g ( x )) vs g ( f ( x )) (cell: composition)
Using f ( x ) = 3 x 2 − 2 x + 5 and g ( x ) = 2 x − 3 , compute f ( g ( 2 )) and g ( f ( 2 )) .
Forecast: Will these two be equal? (Recall composition is generally not commutative — see Composite functions .)
Step 1 — f ( g ( 2 )) : inside first.
g ( 2 ) = 2 ( 2 ) − 3 = 1.
Why this step? Read inside-out. You cannot feed f until you know the value coming out of g .
Step 2 — Feed that into f .
f ( 1 ) = 3 ( 1 ) 2 − 2 ( 1 ) + 5 = 3 − 2 + 5 = 6.
Why this step? Now 1 is the input to f .
Step 3 — g ( f ( 2 )) : swap the order.
f ( 2 ) = 13 ( from Ex 1 ) , g ( 13 ) = 2 ( 13 ) − 3 = 23.
Why this step? Now f runs first. Its output 13 becomes g 's input.
Verify: 6 = 23 , confirming order matters. Sanity: g (a line) is gentle, f (a parabola) blows up — so whichever machine runs last dominates the size, and f -last (= 6 ) vs g -last (= 23 )... wait, f -last gave the smaller answer because its input 1 was small. The lesson: the inner value drives everything. ✓
Worked example Example 5 — Working backwards: solve
f ( x ) = c (cell: solving)
For g ( x ) = 2 x − 3 , find every x with g ( x ) = 11 .
Forecast: A line hits each height exactly once. So how many solutions? Guess.
Step 1 — Write the notation as an equation.
2 x − 3 = 11.
Why this step? g ( x ) = 11 means "the output equals 11 ". Replace g ( x ) by its rule and now it's ordinary algebra — this is running the machine backwards .
Step 2 — Undo the rule step by step.
2 x = 14 ⇒ x = 7.
Why this step? g does "times 2, then minus 3". To reverse, we "add 3, then divide by 2" — undo in the opposite order.
Verify: g ( 7 ) = 2 ( 7 ) − 3 = 11 . ✓ Exactly one solution, as predicted for a straight line.
Worked example Example 6 — The difference quotient (cell: limiting behaviour)
For f ( x ) = 3 x 2 − 2 x + 5 , simplify the difference quotient
h f ( x + h ) − f ( x ) ,
then say what happens as h shrinks toward 0 .
Forecast: After cancelling, will h disappear completely, or leave a leftover h term?
Step 1 — Build f ( x + h ) (same trick as Ex 3).
f ( x + h ) = 3 x 2 + 6 x h + 3 h 2 − 2 x − 2 h + 5.
Why this step? The difference quotient measures how much output changes between input x and a nearby input x + h — we need both.
Step 2 — Subtract f ( x ) .
f ( x + h ) − f ( x ) = 6 x h + 3 h 2 − 2 h .
Why this step? The parts with no h (3 x 2 , − 2 x , + 5 ) are identical in both and cancel. Only the change remains, and notice every surviving term has a factor of h .
Step 3 — Divide by h .
h 6 x h + 3 h 2 − 2 h = 6 x + 3 h − 2.
Why this step? Because every term had an h , division is clean and legal (we're not dividing by zero yet — h is still nonzero here).
Step 4 — Let h → 0 .
6 x + 3 h − 2 ⟶ 6 x − 2.
Why this step? As the second input slides onto the first, the leftover 3 h vanishes. What's left, 6 x − 2 , is the slope of f at x — the doorway to Limits and calculus .
Verify: At x = 1 the slope is 6 ( 1 ) − 2 = 4 . Check with a tiny h = 0.001 : 0.001 f ( 1.001 ) − f ( 1 ) = 6 ( 1 ) + 3 ( 0.001 ) − 2 = 4.003 ≈ 4 . ✓
Worked example Example 7 — Word problem with real units (cell: word problem)
A phone plan costs \ 8ba se pl u s $0.05p er min u t e . W r i t e i t a s C(m), t h e n f in d C(200)an d t h e min u t es t ha t mak e t h e bi l l $20$.
Forecast: Will 200 minutes cost more or less than \ 20$? Guess before computing.
Step 1 — Translate English into a machine.
C ( m ) = 8 + 0.05 m ,
where m is minutes and C ( m ) is dollars.
Why this step? "Base plus per-minute" is a starting value plus a rate times the input — exactly a linear rule. Naming it C (for cost) with input m makes units explicit.
Step 2 — Evaluate C ( 200 ) .
C ( 200 ) = 8 + 0.05 ( 200 ) = 8 + 10 = 18 dollars .
Why this step? Substitute 200 minutes; the 0.05 ⋅ 200 has units \tfrac{\ }{\text{min}}\times\text{min} = $$, so it's dollars — units check.
Step 3 — Solve C ( m ) = 20 (backwards, like Ex 5).
8 + 0.05 m = 20 ⇒ 0.05 m = 12 ⇒ m = 240 min .
Why this step? We want the input that produces a \ 20$ output — read the notation in reverse.
Verify: C ( 240 ) = 8 + 0.05 ( 240 ) = 8 + 12 = 20 . ✓ And 200 min cost only \ 18 < $20$, matching a correct forecast.
Worked example Example 8 — Exam twist: self-composition of a piecewise machine (cell: exam twist)
Let
h ( x ) = { x + 4 , x 2 , x < 0 x ≥ 0
a piecewise function . Find h ( h ( − 3 )) .
Forecast: The inner value h ( − 3 ) — will it land in the x < 0 branch or the x ≥ 0 branch? That choice decides everything.
Step 1 — Inner: h ( − 3 ) , choose the right branch.
Since − 3 < 0 , use x + 4 :
h ( − 3 ) = − 3 + 4 = 1.
Why this step? A piecewise machine first checks which zone the input is in, then applies that zone's rule. − 3 is negative → top branch.
Step 2 — Outer: h ( 1 ) , re-check the branch.
Now the input is 1 , and 1 ≥ 0 , so use x 2 :
h ( 1 ) = 1 2 = 1.
Why this step? The output 1 from step 1 is a new input that must be re-tested against the conditions. It jumped from the negative branch to the non-negative branch — a common trap.
Verify: h ( h ( − 3 )) = h ( 1 ) = 1 . Cross-check by testing the branch boundaries near x = 0 : at x = 0 , x 2 = 0 ; just below, x + 4 ≈ 4 — the machine genuinely behaves differently on each side, so branch-checking mattered. ✓
Recall Rapid self-test
f ( 0 ) for f ( x ) = 3 x 2 − 2 x + 5 ::: 5
f ( − 1 ) for the same f ::: 10
Does f ( g ( 2 )) = g ( f ( 2 )) for f , g above? ::: No — 6 = 23 , composition isn't commutative
The h → 0 limit of the difference quotient of f ::: 6 x − 2
h ( h ( − 3 )) for the piecewise h ::: 1
Minutes so the phone bill is \ 20::: 240$
Mnemonic The two universal moves
SUB then SIMPLIFY for forward questions (feed the machine).
UNDO in reverse order for backward questions (solve f ( x ) = c ).
Every example above is one of these two, possibly nested.
Function notation — f(x), g(x) — the parent this page drills.
Composite functions — Examples 4 and 8 are composition in action.
Inverse functions — Examples 5 and 7 solve f ( x ) = c , the reverse machine.
Piecewise functions — Example 8's branch-checking.
Limits and calculus — Example 6's difference quotient is the first step of the derivative.
Graphing functions — Example 1's zero input is the y -intercept.