Algebra 1 · S.ID.B.6A

Piecewise functions in context

A price, a wage or a tax follows one rule up to some amount and a different rule after it. How do you write that as one function, and what happens right at the change?

Where you are 4 in Piecewise functions

When you reach for it

Many everyday rules change at a set amount. A worker’s hourly pay goes up after 40 hours in a week. A courier charges by weight band. An ice rink stops charging once a month’s sessions pass a cap. Each rule is written in words, and one formula cannot hold it, because the formula itself changes at the threshold.

The tool is a piecewise function: one formula for each stretch of inputs, each paired with a condition. This lesson is about building one from a description, reading the threshold correctly, and saying what the function’s behavior at the threshold means for the people paying or being paid. Naming the quantities and units follows Function notation in a real situation.

The procedure

Finding the pieces

Read the description for its thresholds, the amounts where the rule changes, and for what the rule says on each side. Two shapes come up again and again.

The rate changes for the part beyond the threshold. Overtime pay and income tax work this way: the first 40 hours are paid at one rate, and only the hours beyond 40 at the higher rate. The second piece is then

\begin{aligned} &(\text{output at the threshold}) \\ &\quad + (\text{new rate}) \times (\text{input} - \text{threshold}). \end{aligned}

The first term is everything earned up to the threshold; \text{input} - \text{threshold} counts only the amount past it, which is all the new rate applies to.

The band sets the whole charge. A courier’s price list works this way: the band a parcel falls in decides its price, and the parcel’s whole weight goes into that band’s formula.

Which piece owns a threshold

Every threshold must belong to exactly one piece, or the threshold input would get two outputs or none. The wording decides which.

The wordsThe condition
up to and including 40, at most 40, no more than 40h \le 40
more than 40, over 40, beyond 40h > 40
at least 40, 40 or moreh \ge 40
less than 40, under 40h < 40

“Up to 40” on its own does not say whether 40 itself is included. When it matters, say which reading you chose.

Join or jump

Put the threshold into both formulas. If they give the same number, the pieces join: the graph has no break there, and a small change in input gives a small change in output. If they differ, the function jumps: crossing the threshold by a tiny amount changes the output by the whole difference, and the outputs in between are never reached. The jump is often the most important fact in the situation, since it is where a buyer or a worker most wants to know which side they are on. Drawing the pieces is Graphing a piecewise function.

Working backwards

To find the input that gives a target output, first work out the output at each threshold. These landmarks show which piece can reach the target, so only that piece’s equation needs solving. The answer must then satisfy that piece’s condition, as in Evaluating a piecewise function.

Worked examples

Example 1

Overtime pay

Calloway is paid 18 dollars an hour for hours up to and including 40 in a week, and time and a half, 27 dollars, for each hour more than 40. He never works more than 60 hours. Write his weekly pay P(h) for h hours, find P(30) and P(46), and say whether the pieces join.

Solution

The threshold is 40 hours. Up to it, pay is 18h. At 40 hours he has earned 18 \times 40 = 720 dollars, and each hour past 40 adds 27, so the second piece is 720 + 27(h - 40). “Up to and including” puts 40 in the first piece:

P(h) = \begin{cases} 18h \\ \quad \text{if } 0 \le h \le 40 \\ 720 + 27(h - 40) \\ \quad \text{if } 40 < h \le 60 \end{cases}

30 \le 40, so P(30) = 18 \times 30 = 540 dollars. 46 > 40, so P(46) = 720 + 27 \times 6 = 882 dollars: 720 for the first 40 hours and 162 for the 6 overtime hours. The rule pays 27 only on the hours past 40; 27 \times 46 = 1{,}242 would be paying every hour at the overtime rate.

At h = 40 the second formula gives 720 + 27(0) = 720, the same as 18 \times 40, so the pieces join. Working 40 hours or a minute more makes almost no difference to the pay.

Example 2

A made-up two-band income tax

In a made-up country, income up to and including 15{,}000 dollars is taxed at 10 percent, and only the part of income above 15{,}000 dollars is taxed at 30 percent. Write the tax T(x) on an income of x dollars, find Delphina’s tax on 40{,}000 dollars, and compare the tax on 15{,}000 and 15{,}001 dollars.

Solution

This is the first shape: the higher rate applies only to the part above the threshold. Tax on the first 15{,}000 dollars is 0.1 \times 15{,}000 = 1{,}500 dollars, so

T(x) = \begin{cases} 0.1x \\ \quad \text{if } 0 \le x \le 15{,}000 \\ 1{,}500 + 0.3(x - 15{,}000) \\ \quad \text{if } x > 15{,}000 \end{cases}

For 40{,}000: the part above the threshold is 25{,}000, so T(40{,}000) = 1{,}500 + 0.3 \times 25{,}000 = 9{,}000 dollars. That is \displaystyle \frac{9{,}000}{40{,}000} = 22.5 percent of her income, less than 30 percent, because her first 15{,}000 dollars is still taxed at 10 percent.

At the threshold, T(15{,}000) = 1{,}500 and T(15{,}001) = 1{,}500 + 0.3 \times 1 = 1{,}500.30 dollars. Crossing into the higher band costs 30 cents on the one extra dollar, not 30 percent of the whole income. The pieces join, since 1{,}500 + 0.3(0) = 0.1 \times 15{,}000.

A rule that taxed the whole income at 30 percent once it passed 15{,}000 would be a different function: 0.3 \times 15{,}001 = 4{,}500.30 dollars, a jump of about 3{,}000 dollars for one extra dollar earned. The figure shows both.

5 10 15 20 25 30 2 4 6 8 income (thousands of dollars) tax (thousands of dollars) whole income at 30% Example 2
Figure 1The made-up tax of Example 2 (solid) only bends at 15{,}000 dollars. A rule taxing the whole income at 30 percent (dashed) would jump by 3{,}000 dollars there.
Example 3

A courier’s weight bands

A courier charges 9 dollars for a parcel up to and including 2 kilograms. A parcel of more than 2 kilograms costs 12 dollars plus 1.50 dollars for each kilogram above 2. It takes nothing heavier than 20 kilograms. Write the charge S(w) for a parcel of w kilograms. Find S(2), S(2.4) and S(10), describe what happens at 2 kilograms, and find the weights that cost 18 dollars and 10.50 dollars.

Solution

A parcel has some weight, so w > 0. The wording puts 2 in the first piece:

S(w) = \begin{cases} 9 \\ \quad \text{if } 0 < w \le 2 \\ 12 + 1.5(w - 2) \\ \quad \text{if } 2 < w \le 20 \end{cases}

S(2) = 9, since 2 \le 2. S(2.4) = 12 + 1.5 \times 0.4 = 12.60 dollars and S(10) = 12 + 1.5 \times 8 = 24 dollars.

At w = 2 the second formula would give 12, not 9, so the function jumps by 3 dollars. A parcel of exactly 2 kilograms costs 9 dollars; one that is a few grams heavier costs just over 12. Here the wording matters: had the description said “under 2 kilograms”, a 2-kilogram parcel would cost 12.

For 18 dollars, the landmarks are 9 (the whole first band) and just over 12 (the start of the second), so solve 12 + 1.5(w - 2) = 18: w - 2 = 4, so w = 6, and 2 < 6 \le 20.

For 10.50 dollars, the first piece gives only 9, and the second gives only outputs above 12. Solving 12 + 1.5(w - 2) = 10.5 gives w = 1, which fails w > 2. No parcel costs 10.50 dollars: the jump skipped every price between 9 and 12.

2 4 6 8 10 3 6 9 12 15 18 21 24 weight (kilograms) charge (dollars)
Figure 2The courier’s charge in Example 3. At 2 kilograms the price jumps from 9 to just over 12 dollars, and no parcel costs anything in between.
Example 4

An ice rink’s monthly cap

An ice rink charges 15 dollars a session, but nobody pays more than 45 dollars in a calendar month: once a member has paid for 3 sessions, later sessions that month are free. Write the monthly cost M(v) for v sessions. Find M(2) and M(7). Gareth-Lee paid 30 dollars one month and 45 the next; how many times did he skate each month? Could anyone pay 40 dollars?

Solution

Sessions are counted, so v is a whole number: 0, 1, 2 and so on. The cost is 15v until it reaches 45, which happens at v = 3, and then stays at 45:

M(v) = \begin{cases} 15v & \text{if } v \le 3 \\ 45 & \text{if } v \ge 4 \end{cases}

M(2) = 30 dollars and M(7) = 45 dollars. At the threshold 15 \times 3 = 45, so the pieces agree, and putting v = 3 in either piece would give the same cost. The graph is separate dots, one per whole number, rising in steps of 15 and then level.

M(v) = 30: only the first piece reaches 30, at v = 2. So he skated twice.

M(v) = 45: the first piece gives v = 3, and the constant piece gives 45 for every v \ge 4. So he skated 3 or more times, and the bill alone cannot say how many. A constant piece makes the input impossible to recover.

M(v) = 40: the first piece needs 15v = 40, \displaystyle v = \frac{8}{3}, not a whole number; the second piece is never 40. No member pays 40 dollars.

Example 5

Three bands of pay

Hollis-Mae is paid 20 dollars an hour for hours up to and including 40, 30 dollars for each hour more than 40 up to and including 50, and 40 dollars for each hour more than 50. Write her weekly pay P(h), check the joins, and find how many hours she worked in a week she was paid 1{,}280 dollars.

Solution

Each piece starts from the pay at its threshold. At 40 hours: 20 \times 40 = 800. At 50 hours: 800 + 30 \times 10 = 1{,}100. So

P(h) = \begin{cases} 20h \\ \quad \text{if } 0 \le h \le 40 \\ 800 + 30(h - 40) \\ \quad \text{if } 40 < h \le 50 \\ 1{,}100 + 40(h - 50) \\ \quad \text{if } h > 50 \end{cases}

At h = 40 the middle formula gives 800 + 0 = 800, and at h = 50 the last gives 1{,}100 + 0 = 1{,}100, which equals the middle piece’s 800 + 30 \times 10. Both thresholds join, as they must when each piece starts from the pay already earned.

The landmarks are 800 and 1{,}100. Since 1{,}280 > 1{,}100, only the third piece reaches it:

\begin{aligned} 1{,}100 + 40(h - 50) &= 1{,}280 \\ 40(h - 50) &= 180 \\ h &= 54.5 \end{aligned}

54.5 > 50, so it satisfies the condition. She worked 54.5 hours. Solving the other pieces would give 20h = 1{,}280, so h = 64, failing h \le 40, and h = 56 from the middle piece, failing h \le 50: the landmarks saved that work.

Boundaries

A piecewise model is only as exact as its description. Each threshold has to be assigned to one piece; when the words leave it open and the pieces jump there, the answer at the threshold depends on a choice, which should be stated.

The domain comes from the situation. Hours cannot be negative, a parcel has positive weight and a courier sets a limit, and sessions are whole numbers, so that model’s graph is dots, not a line.

A rule whose higher rate applies only above the threshold always joins, because its second piece starts from the output already reached. A jump appears only when a band’s price is set afresh, as with the courier, or when the whole input is charged at the new rate.

The tax rates and bands here are made up. Real tax systems have more bands, allowances and exceptions, though the idea that only the income above each threshold pays that band’s rate is the same.

Where this goes next

Reading such a rule back off a graph is Writing a piecewise rule from a graph. A function that jumps at every whole number, like a charge for each started hour, is a step function, studied as the Step functions and the greatest integer function. Each piece here is a line, so the work on rate and starting value in Modeling with linear relationships applies to every piece separately.

Exercises

Writing the rule

  1. Eamon-Rhys earns 16 dollars an hour for hours up to and including 40 in a week, and 24 dollars for each hour more than 40. Write his weekly pay P(h) and find P(35) and P(44).
  2. A made-up tax charges nothing on income up to and including 10{,}000 dollars and 20 percent on the part of income above 10{,}000 dollars. Write the tax T(x) and find T(8{,}000) and T(25{,}000).
  3. A second courier charges 6 dollars for a parcel under 1 kilogram, 10 dollars for a parcel of 1 kilogram up to and including 5 kilograms, and, for more than 5 kilograms up to 25, 10 dollars plus 2 dollars for each kilogram above 5. Write the charge S(w) and find S(1), S(5) and S(7.5). Read “up to 25” as up to and including 25.
  4. A second ice rink charges 12 dollars a session with a monthly cap of 60 dollars. Write the monthly cost C(v) for v sessions, and find C(4) and C(9).

Which piece owns the threshold

  1. An online shop says: orders of more than 50 dollars ship free; every other order pays 5 dollars shipping. Write the shipping fee F(x) on an order of x dollars, and find F(50) and F(50.01).
  2. For the shop in Exercise 5, find the total paid, order plus shipping, for an order of 48 dollars and for one of 51 dollars.
  3. Calloway’s employer in Example 1 rewrites the conditions as 0 \le h < 40 and 40 \le h \le 60, with the same formulas. Find P(40) under each version.
  4. The courier in Example 3 rewrites its first band as “under 2 kilograms” and its second as “2 kilograms or more”, same formulas. Find the new S(2).

Join or jump

  1. For each threshold of the rules in Exercises 1, 3 and 4, say whether the pieces join or jump, and give the size of any jump.
  2. A different made-up tax charges 10 percent of the whole income for incomes up to and including 15{,}000 dollars and 30 percent of the whole income above that. Find the tax and the take-home pay (income minus tax) on 15{,}000 dollars and on 15{,}100 dollars. Then find the take-home pay on 15{,}100 dollars under Example 2’s rule.

Working backwards

  1. Under the rule of Exercise 1, Eamon-Rhys was paid 784 dollars one week. How many hours did he work?
  2. Under Example 2’s tax, Fianna paid 3{,}300 dollars. What was her income?
  3. Under the rule of Exercise 3, which weights cost 10 dollars, which cost 8 dollars, and which cost 20 dollars?
  4. Under the rule of Exercise 4, how many sessions give a monthly cost of 36 dollars, of 60 dollars, and of 50 dollars?

Reasoning

  1. Using Example 2’s rule, explain why earning more never lowers take-home pay, and say how much of each extra dollar above 15{,}000 a person keeps.
  2. A description says “up to 40 hours” without saying whether 40 itself is included. Explain why this would not change Calloway’s pay in Example 1, but the same gap in the courier’s wording would change the price of a 2-kilogram parcel.
  3. A print shop’s price in dollars for a banner x meters long is R(x) = 8 if 0 < x \le 3, and R(x) = 8 + 2(x - 3) if x > 3. Write the rule as a sentence a customer could read, and say whether it joins at 3.
Answers
  1. P(h) = 16h if 0 \le h \le 40, and P(h) = 640 + 24(h - 40) if h > 40. P(35) = 560 dollars; P(44) = 640 + 24 \times 4 = 736 dollars.
  2. T(x) = 0 if 0 \le x \le 10{,}000, and T(x) = 0.2(x - 10{,}000) if x > 10{,}000. T(8{,}000) = 0; T(25{,}000) = 0.2 \times 15{,}000 = 3{,}000 dollars.
  3. S(w) = 6 if 0 < w < 1; S(w) = 10 if 1 \le w \le 5; and S(w) = 10 + 2(w - 5) if 5 < w \le 25. S(1) = 10 and S(5) = 10, both in the middle band; S(7.5) = 10 + 2 \times 2.5 = 15 dollars.
  4. C(v) = 12v for v = 0, 1, 2, 3, 4, 5 and C(v) = 60 for v \ge 6, with v a whole number; the cap is reached at 12 \times 5 = 60. C(4) = 48 dollars; C(9) = 60 dollars.
  5. F(x) = 5 if 0 < x \le 50, and F(x) = 0 if x > 50. F(50) = 5, since 50 is not more than 50; F(50.01) = 0.
  6. 53 dollars and 51 dollars. 48 + 5 = 53, and 51 + 0 = 51: the larger order costs less in total, because the fee jumps down by 5 at 50.
  7. 720 dollars both times. The second formula gives 720 + 27(0) = 720 and the first gives 18 \times 40 = 720; the pieces join, so moving the threshold changes nothing.
  8. S(2) = 12 + 1.5(0) = 12 dollars, since 2 now belongs to the second piece.
  9. Exercise 1 joins at 40: 16 \times 40 = 640 and 640 + 0 = 640. Exercise 3 jumps by 4 dollars at 1 (from 6 to 10) and joins at 5 (10 and 10 + 0). Exercise 4 joins at 5: 12 \times 5 = 60.
  10. On 15{,}000: tax 1{,}500, take-home 13{,}500 dollars. On 15{,}100: tax 0.3 \times 15{,}100 = 4{,}530, take-home 10{,}570 dollars, so 100 more earned leaves 2{,}930 less. Under Example 2’s rule the tax on 15{,}100 is 1{,}500 + 0.3 \times 100 = 1{,}530, take-home 13{,}570 dollars.
  11. 46 hours. The landmark is P(40) = 640 < 784, so 640 + 24(h - 40) = 784 gives h - 40 = 6.
  12. 21{,}000 dollars. 3{,}300 > 1{,}500, the tax at the threshold, so 1{,}500 + 0.3(x - 15{,}000) = 3{,}300 gives x - 15{,}000 = 6{,}000.
  13. 10 dollars: every weight with 1 \le w \le 5. 8 dollars: none, since the bands give 6, then 10, then more than 10. 20 dollars: 10 + 2(w - 5) = 20 gives w = 10.
  14. 36 dollars: 3 sessions, from 12v = 36. 60 dollars: 5 or more sessions. 50 dollars: none, since 12v = 50 gives \displaystyle v = \frac{25}{6}, not a whole number, and the cap is 60.
  15. Take-home pay is x - T(x): 0.9x up to 15{,}000, and x - 1{,}500 - 0.3(x - 15{,}000) = 13{,}500 + 0.7(x - 15{,}000) above it. Both pieces rise as x rises, and they join at 13{,}500, so take-home pay never drops. Each dollar above 15{,}000 keeps 70 cents.
  16. Calloway’s pieces agree at 40: both give 720, so whichever piece owns 40, the pay is the same. The courier’s pieces differ at 2: 9 against 12. So the price of a parcel of exactly 2 kilograms depends on which piece owns 2, and the words have to settle it.
  17. “Any banner up to and including 3 meters long costs 8 dollars; a longer banner costs 8 dollars plus 2 dollars for each meter beyond 3.” It joins: 8 + 2(0) = 8.
kg1128 · updated 2026-10-10 · CC-BY-SA-4.0