Write and evaluate a piecewise function
Picture a parking sign with different prices for different lengths of stay. You first read which time interval your stay belongs to. Only then do you calculate its price. A piecewise function works this way: one rule applies on one part of its domain, and another rule applies somewhere else. Each part is called a piece. The conditions beside the formulas tell you which lane to choose. A boundary is the input where a lane starts or stops. Look carefully at whether equality is allowed there. The price rule for the next lane may be different, even though the two inputs are very close.
- Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
- Percentages. 10% of 10000 is × 10000 = 1000.
- Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.
The whole domain is the union of the pieces' domains; each allowed input must receive one output.
Say choose the condition, then calculate its formula.
A piecewise function assigns different formulas to specified parts of its domain.
- C(g) = 25 if 0 < g < 2
- C(g) = 25 + 10(g − 2) if g ≥ 2
- Domain: {g | g > 0} = (0, ∞)
- Graph words: each formula is used only on its own input interval
A price sign routes your purchase to the rate for its size.
A museum sign can say $5 per person for a small group and $50 for a larger group. The group size chooses the rule. You do not pay both listed prices.
Send the input to the condition it satisfies, then let that branch calculate the output. A boundary value belongs wherever equality is included.
|−11| uses the rule −x because its input is negative, giving 11. |11| uses x because its input is nonnegative, also giving 11. Two processes produce the same kind of distance.
If an input receives different answers from overlapping conditions, the rule is not a function at that input. Usual piecewise notation avoids this by assigning each input to one branch. If overlapping formulas agree, they still give only one output.
.1Absolute value as two formulas
Absolute value measures how far a number is from zero. This distance is also called its magnitude or modulus. A nonnegative number already tells its distance. A negative number needs its opposite, so the two sides of zero use different formulas.
- |x| = x when x ≥ 0.
- |x| = −x when x < 0.
- −x is positive when x is negative; it does not mean the output is always negative.
- The domain is (−∞, ∞) and the range is [0, ∞).
- Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
- Percentages. 10% of 10000 is × 10000 = 1000.
- Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.
Say keep a nonnegative input; take the opposite of a negative input.
Absolute value uses the formula matching the input’s sign.
- |x| = x if x ≥ 0
- |x| = −x if x < 0
- Domain: (−∞, ∞)
- Range: [0, ∞)
Your distance from home is nonnegative. At home it is zero; walking either way makes it positive.
Write |x| as a piecewise rule and use it to find |−11|.
- We need one formula for nonnegative inputs, another for negative inputs, then the output at −11.Absolute value measures distance from zero, so an input’s sign determines which formula returns that distance.
- For x ≥ 0, use |x| = x.A nonnegative coordinate is already its own distance from zero.
- For x < 0, use |x| = −x.The distance to zero is positive, so negating a negative coordinate gives its length.
- The input −11 satisfies x < 0, so choose −x.The input's sign selects the piece; you do not use both rules.
- Evaluate −(−11) = 11.Taking the opposite of a negative number produces the positive distance.
- |x| = x if x ≥ 0.
- |x| = −x if x < 0.
- |−11| = 11.
- Substitute the whole negative input in parentheses.
.2A museum group discount
For a small tour group, adding one person adds $5 to the bill. At ten people, the group pays a fixed $50. A discrete function here uses whole-number people counts. For the exercise, you extend the rule to real inputs between counts. This particular extension is a continuous function because its graph has no jumps or holes, including at ten.
- Actual small-group charge: 5n for n in {1, 2, …, 9}.
- Actual larger-group charge: 50 for integers n ≥ 10.
- For the textbook continuous drawing, use 0 < n < 10 and n ≥ 10, with domain (0, ∞).
- The actual count domain is {1, 2, 3, …}; a fractional person is not a real group member.
- Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
- Percentages. 10% of 10000 is × 10000 = 1000.
- Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.
Say small groups pay per person; larger groups pay one fixed fee.
Actual groups use positive integer counts; the textbook drawing extends the rule to every positive real input.
- M(n) = 5n if 0 < n < 10
- M(n) = 50 if n ≥ 10
- Actual domain: {1, 2, 3, …}
- Continuous domain: (0, ∞)
- Continuous range: (0, 50]
A cash register switches from per-person pricing to one fixed group fee.
A museum charges $5 per person for groups of 1 to 9 people and a fixed $50 for groups of 10 or more. Write the actual pricing rule and the textbook continuous exercise model.
- We need a pricing formula on each group-size condition, then the actual and continuous input and output sets.The price changes its calculation at a group size of 10; the actual visitor counts and the continuous exercise model use different input sets.
- Use 5n when n is a whole number from 1 through 9.Per person means multiply the number of people by $5.
- Use 50 when n is a whole number at least 10.A fixed group fee stays $50 even when the group is larger.
- The actual domain is {1, 2, 3, …}.A group contains a positive whole-number count of people.
- For a continuous drawing, use 5n on 0 < n < 10 and 50 on n ≥ 10.The source asks for a continuous drawing; here we extend the small-group rule over every real input strictly between 0 and 10 so it forms a line segment with an open point at (0, 0).
- The actual range is {5, 10, 15, 20, 25, 30, 35, 40, 45, 50}; the continuous range is (0, 50].Positive integer counts give separate actual prices. In the continuous model, positive inputs can approach 0 without reaching it, so their costs can approach $0 without attaining it. The first branch approaches $50 and the second branch supplies $50 itself.
- Actual rule: M(n) = 5n for n in {1, …, 9}.
- Actual rule: M(n) = 50 for integers n ≥ 10.
- Actual domain: {1, 2, 3, …}.
- Actual range: {5, 10, 15, 20, 25, 30, 35, 40, 45, 50}.
- Textbook continuous model: M(n) = 5n if 0 < n < 10.
- Textbook continuous model: M(n) = 50 if n ≥ 10.
- Continuous domain: (0, ∞).
- Continuous range: (0, 50].
- State whether you are using the real counting rule or the continuous exercise model.
.3A fictional marginal tax model
Imagine placing the first portion of income in one basket and the excess in a second basket. The baskets have different percentage charges. Crossing the boundary puts only the added income into the second basket. This is a fictional teaching model, not a statement about a current tax law.
- A tax bracket is an income interval with a specified tax rate in this model.
- For income through $10000, use 10% of that income.
- Above $10000, retain $1000 on the first portion and add 20% of only the excess.
- At $10000 the first branch includes the boundary; the second branch starts above it.
- Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
- Percentages. 10% of 10000 is × 10000 = 1000.
- Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.
Say the first portion and the excess have separate rates.
Only income above the threshold gets the higher rate in this fictional tax model.
- T(i) = 0.10i if 0 ≤ i ≤ 10000
- T(i) = 1000 + 0.20(i − 10000) if i > 10000
- Domain: [0, ∞)
Put the first portion of income and the excess into two baskets with different rates.
In this fictional model, income through $10000 is taxed at 10%, and only additional income is taxed at 20%. Write T(i) for i ≥ 0 and find T(15000).
- We need the tax formula in each income bracket and its value at $15000.The lower rate covers the first $10000, and only the excess uses the higher rate.
- For 0 ≤ i ≤ 10000, write T(i) = 0.10i.Ten percent is = 0.10 of the income in this first bracket.
- The tax on the first $10000 is 0.10 × 10000 = 1000.This charge remains part of the total when income enters the second bracket.
- For i > 10000, write T(i) = 1000 + 0.20(i − 10000).The second rate applies to the income above $10000, not to the whole income.
- At i = 15000, excess income is 15000 − 10000 = 5000.Subtracting the threshold isolates the amount charged at 20%.
- Compute T(15000) = 1000 + 0.20 × 5000 = 1000 + 1000 = 2000.The total includes tax from both portions of the income.
- T(i) = 0.10i if 0 ≤ i ≤ 10000.
- T(i) = 1000 + 0.20(i − 10000) if i > 10000.
- T(15000) = $2000.
- Find the excess amount before applying the second rate.
.4A data plan with a threshold
The plan charges a base amount for usage below two gigabytes. Beyond that threshold, it adds a price for excess usage. The given formula includes two gigabytes in the second branch. It does not assign a price to zero usage, so do not invent one.
- C(g) = 25 for 0 < g < 2.
- C(g) = 25 + 10(g − 2) for g ≥ 2.
- Domain: (0, 2) ∪ [2, ∞) = (0, ∞).
- Range: [25, ∞), because the base charge is reached and arbitrary nonnegative excess charges can be added.
- Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
- Percentages. 10% of 10000 is × 10000 = 1000.
- Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.
Say a base price plus an extra charge above two gigabytes.
The conditions assign one formula to each positive usage input.
- C(g) = 25 if 0 < g < 2
- C(g) = 25 + 10(g − 2) if g ≥ 2
- Domain: (0, ∞)
- Range: [25, ∞)
Pay a base entrance price, then pay for extra usage beyond what it includes.
For the same data-plan rule, find C(2) and decide whether C(0) is defined.
- We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
- At g = 2, the condition 0 < g < 2 is false.A strict inequality excludes its boundary.
- The condition g ≥ 2 is true, so C(2) = 25 + 10(2 − 2) = 25.The second condition includes equality, and the excess usage is zero.
- At g = 0, neither condition is true.Zero is not strictly positive and is not at least 2.
- Report C(0) as undefined for this given rule.No branch assigns an output to zero; a real provider's policy would require a separately supplied rule.
- C(2) = $25.
- C(0) is undefined for the stated function.
- Check zero in the given conditions instead of guessing a policy.
- 1. Identify what the input measures and where the rule changes.
- 2. Write a formula for each region and state its condition with the boundary ownership explicit.
- 3. Include any context limits, such as positive whole-number people counts.
- 4. To evaluate, compare the input with all conditions before using a formula.
- 5. Substitute into the selected formula and follow the order of operations.
- 6. At a boundary, check which condition includes equality. Do not add the outputs of different pieces.
Write or evaluate a piecewise rule
- 1. Identify what the input measures and where the rule changes.
- 2. Write a formula for each region and state its condition with the boundary ownership explicit.
- 3. Include any context limits, such as positive whole-number people counts.
- 4. To evaluate, compare the input with all conditions before using a formula.
- 5. Substitute into the selected formula and follow the order of operations.
- 6. At a boundary, check which condition includes equality. Do not add the outputs of different pieces.
A data plan has C(g) = 25 for 0 < g < 2, and C(g) = 25 + 10(g − 2) for g ≥ 2. Here g is gigabytes and C is dollars. Find C(1.5) and C(4).
- We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
- For g = 1.5, test 0 < 1.5 < 2.The condition decides which formula applies before any calculation.
- Use the first formula: C(1.5) = 25.Every input strictly between 0 and 2 has the flat charge.
- For g = 4, test 4 ≥ 2.This input belongs to the second piece.
- Subtract the included 2 gigabytes: 4 − 2 = 2.Only usage above the threshold is charged at the extra rate.
- Calculate C(4) = 25 + 10 × 2 = 25 + 20 = 45.The base charge and the charge for two excess gigabytes must both be paid.
- C(1.5) = $25.
- C(4) = $45.
Write |x| as a piecewise rule and use it to find |−11|.
- We need one formula for nonnegative inputs, another for negative inputs, then the output at −11.Absolute value measures distance from zero, so an input’s sign determines which formula returns that distance.
- For x ≥ 0, use |x| = x.A nonnegative coordinate is already its own distance from zero.
- For x < 0, use |x| = −x.The distance to zero is positive, so negating a negative coordinate gives its length.
- The input −11 satisfies x < 0, so choose −x.The input's sign selects the piece; you do not use both rules.
- Evaluate −(−11) = 11.Taking the opposite of a negative number produces the positive distance.
- |x| = x if x ≥ 0.
- |x| = −x if x < 0.
- |−11| = 11.
For C(g) = 25 if 0 < g < 2 and C(g) = 25 + 10(g − 2) if g ≥ 2, find C(1).
- We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
- Check 0 < 1 < 2.The input fits the condition of the first branch.
- Use C(1) = 25.This branch has no variable in its formula, so every input in it has the same cost.
For the same data-plan rule, find C(2) and decide whether C(0) is defined.
- We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
- At g = 2, the condition 0 < g < 2 is false.A strict inequality excludes its boundary.
- The condition g ≥ 2 is true, so C(2) = 25 + 10(2 − 2) = 25.The second condition includes equality, and the excess usage is zero.
- At g = 0, neither condition is true.Zero is not strictly positive and is not at least 2.
- Report C(0) as undefined for this given rule.No branch assigns an output to zero; a real provider's policy would require a separately supplied rule.
- C(2) = $25.
- C(0) is undefined for the stated function.
For the same data plan, find C(6.5).
- We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
- Since 6.5 ≥ 2, choose C(g) = 25 + 10(g − 2).The input belongs to the excess-usage branch.
- Calculate 6.5 − 2 = 4.5 gigabytes above the included amount.The first two gigabytes are accounted for by the base charge.
- Calculate 10 × 4.5 = 45, then add 25 to get 70.The excess amount is charged at $10 per gigabyte, on top of the base charge.
Let P(x) = x + 6 if x < −2, P(x) = 7 if −2 ≤ x ≤ 4, and P(x) = 3x − 5 if x > 4. Find P(−5), P(−2), P(4), and P(6).
- We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
- For −5, use x + 6 and get −5 + 6 = 1.−5 satisfies the first condition x < −2.
- For −2, use the constant 7.Equality at −2 is included in the middle condition, not the first.
- For 4, also use the constant 7.Equality at 4 is included in the middle condition, not the last.
- For 6, use 3x − 5 and get 3 × 6 − 5 = 18 − 5 = 13.6 satisfies x > 4.
- P(−5) = 1.
- P(−2) = 7.
- P(4) = 7.
- P(6) = 13.
- Memory device: choose the lane, then calculate.
- Underline the condition that contains the boundary's equality sign.
- For a threshold charge, write excess = input − threshold before multiplying by the extra rate.