Piecewise Models
Real situations often change their rules partway through. A phone plan charges nothing extra until you pass your data limit; income tax uses a higher rate once you earn more than a threshold; a train speeds up, cruises, then brakes. A single formula can’t describe these, but a piecewise function, with a different formula on each interval, can. This page shows you how to read, evaluate and graph piecewise models, how to choose a parameter so the pieces join up, and how to work backwards from an output to an input.
Key ideas
Section titled “Key ideas”Piecewise notation
Section titled “Piecewise notation”A piecewise function lists each formula with the interval where it applies:
To evaluate at a given input, first decide which interval the input belongs to, then use only that formula. Here and . Watch the inequality signs at the boundaries: belongs to the second piece (because of ), so .
Graphing
Section titled “Graphing”Graph each formula only over its own interval.
- A closed dot marks an endpoint that is included ( or ).
- An open dot marks an endpoint that is excluded ( or ).
- Your GDC can graph each piece separately if you restrict the domain of each one.
Joining up (continuity)
Section titled “Joining up (continuity)”At a boundary , the pieces meet (the graph has no jump) when both formulas give the same value at . A function whose graph can be drawn without lifting your pencil is called continuous. (You don’t need the formal definition; see continuity if you’re curious.)
To find a parameter that makes a piecewise model continuous at :
- Substitute into the formula on the left of the boundary.
- Substitute into the formula on the right.
- Set the two results equal and solve for the parameter.
Many models should be continuous: a speed can’t jump instantly, and a pool’s floor has no cliffs. Others are naturally not continuous, like shipping costs that jump from one price to the next.
Step functions
Section titled “Step functions”A step function is a piecewise function where every piece is constant, like postage rates or parking fees “per hour or part of an hour”. Its graph looks like a staircase, with an open dot at one end of each step and a closed dot at the other.
Working backwards: finding an input
Section titled “Working backwards: finding an input”To solve for a piecewise function:
- Find the range of outputs on each piece (often just by evaluating at the boundaries).
- Only solve on the pieces whose range contains .
- Check that each solution lies in that piece’s interval. Reject any that don’t.
There may be more than one answer (a speed of m/s while speeding up and again while slowing down), or none (no parcel costs exactly $15 if prices jump from $12 to $18).
Worked examples
Section titled “Worked examples”Example 1: A tram’s speed profile
Section titled “Example 1: A tram’s speed profile”A tram leaves a stop. Its speed m/s after seconds is
- (a) Find , and .
- (b) Show that the speed is continuous at and .
- (c) Find all times when the speed is m/s.
Solution.
(a) is in the first piece: m/s. is in the second: m/s. is in the third: m/s.
(b) At : the first formula gives , and the second gives . They agree. At : the second gives and the third gives . They agree. So the speed has no jumps, which makes sense for a real tram.
(c) The first piece takes values from up to (not including) , and the third takes values from down to , so both can give . The middle piece is always , so it can’t.
The tram is moving at m/s at s (speeding up) and at s (slowing down).
Example 2: Making a slide’s pieces meet
Section titled “Example 2: Making a slide’s pieces meet”The height metres of a playground slide, metres horizontally from the top of the ladder, is
- (a) Find the value of that makes the slide continuous.
- (b) Find .
- (c) Find where the slide is m high.
Solution.
(a) At , the left piece gives and the right piece gives . Set them equal:
(b) is in the second piece: m.
(c) First piece: gives , but the first piece only applies for , so reject it. (This piece only takes heights between and .)
Second piece: gives , so . Only lies in .
The slide is m high at m (3 s.f.).
Example 3: Tax brackets
Section titled “Example 3: Tax brackets”In a (fictional) country, income tax is charged as follows:
| Taxable income | Rate on income in this band |
|---|---|
| first $15 000 | |
| over $15 000 up to $50 000 | |
| over $50 000 |
- (a) Write the tax on an income of dollars as a piecewise function.
- (b) Find the tax on incomes of $40 000 and $80 000.
- (c) Mei pays $12 000 in tax. Find her income, and the percentage of her income she pays in tax.
Solution.
(a) Each rate applies only to the part of the income inside its band. On the first $15 000 there’s no tax. On an income in the second band, is paid on the amount above $15 000. The tax on a full second band is dollars, and income above $50 000 is taxed at :
Check the joins: at both formulas give ; at both give . So is continuous, which is how real tax systems work (earning one more dollar never makes your tax jump).
(b) , so $5000.
, so $17 500.
(c) The second band produces at most $7000 of tax, so Mei’s income is in the third band:
Her income is about $64 285.71, roughly $64 300 (3 s.f.). Her tax is of her income, much less than her top rate of .
Example 4: Shipping costs as a step function
Section titled “Example 4: Shipping costs as a step function”A courier charges by mass (kg) for parcels up to kg:
where is in dollars.
- (a) Find the cost of parcels of kg and kg.
- (b) Sketch the graph.
- (c) Is there a parcel that costs exactly $15?
Solution.
(a) is in , so it costs $12. is in , so it costs $18. An extra kg costs $6 more!
(b)
(c) No. The only possible costs are $8, $12, $18 and $25, so the equation has no solution. This model is not continuous: it jumps at , and .
Common mistakes
Section titled “Common mistakes”Using the wrong piece at a boundary. At in , only the second piece applies. Read the inequality signs carefully before substituting.
Applying a tax rate to the whole income. A top rate means of the part above the threshold, not of everything. Add the full tax from each lower band, then the top rate on the remainder only.
Keeping solutions outside their piece. When you solve on each piece, every answer must be checked against that piece’s interval. In Example 2, solved the first formula but wasn’t in .
Missing a second solution. A piecewise function can take the same value on two pieces. Check the range of every piece, not just the first one that works.
Setting the wrong things equal for continuity. To make the pieces meet at , substitute the same boundary value into both formulas. Don’t set the formulas equal to each other as equations in .
Joining the dots across a jump. Step functions and other discontinuous models must be drawn with open and closed dots and gaps, not as one connected line.
Practice
Section titled “Practice”1. (Warm-up) Let .
- (a) Find , and .
- (b) Is continuous at ? Explain.
Solution
(a) ; ; .
(b) Yes. At the first formula gives and the second gives . The pieces meet.
2. (Warm-up) A car park charges $3 for the first hour or part of an hour, then $2 for each additional hour or part of an hour, up to a maximum of $15 per day. Find the cost of parking for minutes, hours and hours.
Solution
minutes: part of the first hour, so $3.
hours: charged as hours (the half hour counts as a full hour), so , which is $7.
hours: dollars, but the daily maximum is $15, so $15.
3. (Warm-up) A phone plan costs $30 per month, which includes GB of data. Extra data costs $6 per GB (charged for the exact amount used). Write the monthly cost as a piecewise function of the data used, GB, and find the cost when GB are used.
Solution
, so $48.
4. (Core) Let .
- (a) Find the value of that makes continuous.
- (b) For this value of , find and .
Solution
(a) At : , so and .
(b) and .
5. (Core) Another country’s income tax is on the first $20 000, on income over $20 000 up to $60 000, and on income over $60 000.
- (a) Find the tax on an income of $45 000.
- (b) Write the tax as a piecewise function of the income dollars.
- (c) Find the income of someone who pays $22 000 in tax.
Solution
(a) , so $8250.
(b) A full first band gives $2000 of tax, and a full second band gives a further , so $12 000 in total at $60 000.
(c) $22 000 is more than $12 000, so the income is in the top band:
The income is $85 000.
6. (Core) A swimming pool is m long. Its depth is m for the first m from the shallow end, then the floor slopes down in a straight line to a depth of m at m from the shallow end, and the depth stays at m for the rest of the pool.
- (a) Write the depth metres as a piecewise function of the distance metres from the shallow end.
- (b) Find where the depth is m.
Solution
(a) On the sloping part, the depth increases by m over m, a slope of .
(b) Only the middle piece takes the value : gives , so m from the shallow end.
7. (Core) A taxi charges a fixed fee of $4.50, plus $2.10 per kilometre for the first km and $1.60 per kilometre for every kilometre after that.
- (a) Write the fare dollars as a piecewise function of the distance km.
- (b) Find the fare for km and for km.
- (c) A trip costs $45.30. How far was it?
Solution
(a) After km the fare is dollars.
(b) , so $17.10. , so $33.50.
(c) $45.30 is more than $25.50, so the trip was longer than km:
The trip was about km (3 s.f.).
8. (Challenge) A skydiver jumps from a plane. A simple model for her height metres after seconds is
where the parachute opens at .
- (a) Find the value of that makes continuous.
- (b) Find when she lands.
- (c) In the first piece her speed at is m/s, and in the second it is m/s. Comment on the model.
Solution
(a) At : , and . So and .
(b) She lands when , so s (3 s.f.). (Check: this is after , so it’s in the second piece. ✓)
(c) The height is continuous, but the speed jumps from m/s to m/s instantly, which is impossible: a real parachute takes a few seconds to slow her down. The free-fall piece also ignores air resistance, which would keep her speed well below m/s. The model is reasonable for rough timings, but not for describing the motion near .
9. (Challenge) Let
- (a) Find and so that is continuous.
- (b) Solve .
Solution
(a) At : , so . At : , so .
(b) Find the outputs on each piece. First piece: goes from up to (not including) , so it never equals . Second piece: goes from up to (not including) . Third piece: goes from down to , so it never equals .
Only the second piece works: gives , so . Only is in .
The solution is (3 s.f.).