Quarry School

Write and evaluate a piecewise function

Subject: MathematicsLeans on: Order of operationsLeans on: PercentagesLeans on: Negating a negative
Level 2 · BuildingAbout 18 min read10 new termsKeystone idea. Later lessons build on this one.
How this was estimated

Programmatic estimate. Rung levels, worked steps, prerequisites, terms and sentence length contribute to this level. It describes the lesson, not your ability.

Reading counts the whole lesson, including folded explanations, at 180 words a minute. Practice allows two minutes per item. These are planning assumptions; take the time you need.

AI estimate unavailable.

Path to here

Open the unit’s lesson list to follow the lesson order.

    Quick review (2 minutes)

    In plain words

    Picture a parking sign with different prices for different lengths of stay.

    Rule

    Choose the condition your input satisfies, then use that piece's formula.
    The whole domain is the union of the pieces' domains; each allowed input must receive one output.

    Step

    1. 1. Identify what the input measures and where the rule changes.

    2. 2. Write a formula for each region and state its condition with the boundary ownership explicit.

    3. 3. Include any context limits, such as positive whole-number people counts.

    4. 4. To evaluate, compare the input with all conditions before using a formula.

    5. 5. Substitute into the selected formula and follow the order of operations.

    6. 6. At a boundary, check which condition includes equality. Do not add the outputs of different pieces.

    Question

    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).

    Answer

    C(1.5) = $25.
    C(4) = $45.

    Trap

    Using a formula because it is familiar before reading its condition. At g = 2 the data plan uses the g ≥ 2 piece. At g = 0 neither piece applies.

    Strategy

    1. 1. Identify what the input measures and where the rule changes.

    2. 2. Write a formula for each region and state its condition with the boundary ownership explicit.

    3. 3. Include any context limits, such as positive whole-number people counts.

    4. 4. To evaluate, compare the input with all conditions before using a formula.

    5. 5. Substitute into the selected formula and follow the order of operations.

    6. 6. At a boundary, check which condition includes equality. Do not add the outputs of different pieces.

    Term

    Function

    Definition

    A rule assigning exactly one output to each allowed input. Different inputs may share an output.

    Term

    Input

    Definition

    The value you choose or supply to a function before its rule calculates an output.

    Term

    Output

    Definition

    The result a function produces from a chosen allowed input.

    Term

    Formula

    Definition

    A mathematical recipe describing how quantities are related or how to calculate a result.

    Term

    Domain

    Definition

    The set of all inputs allowed for a function, considering its arithmetic and any stated context or restrictions.

    Term

    Range

    Definition

    The set of all outputs a function actually produces from its allowed inputs.

    Term

    Coordinate

    Definition

    One number describing a point's position along an axis. In (x, y), x is horizontal and y is vertical.

    Term

    Discrete function

    Definition

    A function with separate allowed inputs, such as whole-number counts. Its graph has isolated points rather than every intervening input.

    Term

    Continuous function

    Definition

    A function with no break at its domain points. On an interval, its graph has no jumps or holes between allowed inputs.

    Term

    Undefined

    Definition

    Having no assigned value in the number system or function being used. Division by zero is undefined in real arithmetic.

    Term

    Inequality

    Definition

    A comparison using <, >, ≤ or >=. It describes which amount is smaller or larger and whether equality is allowed.

    Term

    Nonnegative

    Definition

    Greater than or equal to 0. It includes positive numbers and 0, but excludes negative numbers.

    Term

    Positive

    Definition

    Strictly greater than 0. Zero is excluded.

    Term

    Negative

    Definition

    Strictly less than 0. Negative numbers lie to the left of 0 on a number line.

    Term

    Number line

    Definition

    A straight line placing real numbers in order, with smaller numbers left and greater numbers right.

    Term

    Interval

    Definition

    A set containing every real number between its limits, with endpoints included or excluded as specified. It may extend without bound.

    Term

    Bracket

    Definition

    The interval symbols [ and ], indicating that the adjacent finite endpoint belongs to the set.

    Term

    Graph

    Definition

    A picture of points representing input and output pairs, usually with inputs horizontal and outputs vertical.

    Term

    Magnitude

    Definition

    A real number's size without its sign, measured by its absolute value or distance from 0.

    Term

    Modulus

    Definition

    Another name for the absolute value of a real number, its nonnegative distance from 0.

    Term

    Piecewise function

    Definition

    A function using different formulas on specified parts of its domain. Each allowed input must have exactly one output.

    Term

    Piece

    Definition

    One formula together with the input condition telling you where it is used in a piecewise function.

    Term

    Boundary

    Definition

    An input where an interval starts or ends, or where a piecewise condition changes. Check which condition includes it.

    Term

    Tax bracket

    Definition

    An income interval with its assigned tax rule. In a marginal model, a higher rate applies only to income within its bracket.

    1 In plain words

    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.

    2 Picture it

    C(g) = 25 if 0 < g < 2

    C(g) = 25 + 10(g − 2) if g ≥ 2

    Choose the condition first

    Reminder

    Reminder: Order of operations, Percentages, Negating a negative
    • Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
    • Percentages. 10% of 10000 is 10100 × 10000 = 1000.
    • Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.

    3 Why

    A function must give one output for each allowed input. Several formulas can work together if their conditions tell you which formula supplies that output. The domain is the union of the allowed branch inputs because an input may belong to any available piece. Boundary conditions show which inputs are assigned or omitted, and help you spot two conflicting outputs. A deliberate gap is allowed outside the domain. Some rules meet at the same height, like the data plan at its threshold. Other rules jump to a new height. Meeting is not required; a single assigned output is required.

    4 The rule

    Choose the condition your input satisfies, then use that piece's formula.

    The whole domain is the union of the pieces' domains; each allowed input must receive one output.

    The same idea, five ways

    Say it

    Say choose the condition, then calculate its formula.

    Write it

    A piecewise function assigns different formulas to specified parts of its domain.

    In math
    • 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
    Like

    A price sign routes your purchase to the rate for its size.

    See it

    C(g) = 25 if 0 < g < 2

    C(g) = 25 + 10(g − 2) if g ≥ 2

    Choose the condition first

    The same idea, other ways

    As a price sign

    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.

    As a routing machine

    Send the input to the condition it satisfies, then let that branch calculate the output. A boundary value belongs wherever equality is included.

    g = 4g >= 2: 25 + 10(g −2)inputoutput$45
    An input of 4 is routed to the excess-usage branch.
    With a distance

    |−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.

    Why the conditions matter

    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.

    Part 1: Absolute 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, ∞).
    (0, 0)domainrange−4−224246
    y = |x|.

    Reminder

    Reminder: Order of operations, Percentages, Negating a negative
    • Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
    • Percentages. 10% of 10000 is 10100 × 10000 = 1000.
    • Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.

    The same idea, five ways

    Say it

    Say keep a nonnegative input; take the opposite of a negative input.

    Write it

    Absolute value uses the formula matching the input’s sign.

    In math
    • |x| = x if x ≥ 0
    • |x| = −x if x < 0
    • Domain: (−∞, ∞)
    • Range: [0, ∞)
    Like

    Your distance from home is nonnegative. At home it is zero; walking either way makes it positive.

    See it
    (0, 0)domainrange−4−224246
    The same picture again: y = |x|.

    Worked example

    Absolute value uses the negative-input piece

    Write |x| as a piecewise rule and use it to find |−11|.

    Show the steps and the answer

    |x| = x if x ≥ 0.

    |x| = −x if x < 0.

    |−11|=11.

    1. 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.
    2. For x≥0, use |x|=x.A nonnegative coordinate is already its own distance from zero.
    3. For x < 0, use |x|=−x.The distance to zero is positive, so negating a negative coordinate gives its length.
    4. The input −11 satisfies x < 0, so choose −x.The input's sign selects the piece; you do not use both rules.
    5. Evaluate −(−11)=11.Taking the opposite of a negative number produces the positive distance.
    Answer
    • |x| = x if x ≥ 0.
    • |x| = −x if x < 0.
    • |−11|=11.
    Double-check Both 11 and −11 are eleven units from zero on the number line. At zero the nonnegative branch gives |0| = 0.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: The formula −x always gives a negative output.
    If x is negative, −x is its positive opposite.
    ✓ Instead: At x = −11, the branch −x gives −(−11) = 11.

    Tips and tricks

    • Substitute the whole negative input in parentheses.

    Part 2: A 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.

    Small group: $5 × n

    At least 10 people: $50

    Actual n is a positive whole number

    Reminder

    Reminder: Order of operations, Percentages, Negating a negative
    • Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
    • Percentages. 10% of 10000 is 10100 × 10000 = 1000.
    • Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.

    The same idea, five ways

    Say it

    Say small groups pay per person; larger groups pay one fixed fee.

    Write it

    Actual groups use positive integer counts; the textbook drawing extends the rule to every positive real input.

    In math
    • 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]
    Like

    A cash register switches from per-person pricing to one fixed group fee.

    See it

    Small group: $5 × n

    At least 10 people: $50

    Actual n is a positive whole number

    Worked example

    Textbook: write a museum group-pricing function

    OpenStax problem

    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.

    Show the steps and the answer
    input actual group size noutput M(n), dollars1594510501250↓ evaluate: input given, read the output below it
    Whole-number groups choose the per-person or fixed-fee rule; sizes 10 and 12 both have output 50.
    0(0, ∞)
    The textbook continuous model uses every positive real input; real groups use only positive integer counts.
    1. 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.
    2. Use 5n when n is a whole number from 1 through 9.Per person means multiply the number of people by $5.
    3. Use 50 when n is a whole number at least 10.A fixed group fee stays $50 even when the group is larger.
    4. The actual domain is {1, 2, 3, …}.A group contains a positive whole-number count of people.
    5. 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).
    6. 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.
    Answer
    • 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].
    Double-check M(9) = $45 and M(10) = $50. The continuous formula would give M(9.5) = $47.50, which explains the drawing but is not a real group size.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: A group of 9.5 people is an actual allowed input.
    An actual head count must be a whole number, even if the exercise drawing interpolates between counts.
    ✓ Instead: Actual inputs are positive integers; 9.5 appears only in the chosen continuous drawing.

    Tips and tricks

    • State whether you are using the real counting rule or the continuous exercise model.

    Part 3: A 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.

    First $10000: 10%

    Income above $10000: 20%

    Keep the first portion's $1000 tax

    Reminder

    Reminder: Order of operations, Percentages, Negating a negative
    • Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
    • Percentages. 10% of 10000 is 10100 × 10000 = 1000.
    • Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.

    The same idea, five ways

    Say it

    Say the first portion and the excess have separate rates.

    Write it

    Only income above the threshold gets the higher rate in this fictional tax model.

    In math
    • T(i) = 0.10i if 0 ≤ i ≤ 10000
    • T(i) = 1000 + 0.20(i − 10000) if i > 10000
    • Domain: [0, ∞)
    Like

    Put the first portion of income and the excess into two baskets with different rates.

    See it

    First $10000: 10%

    Income above $10000: 20%

    Keep the first portion's $1000 tax

    Worked example

    A fictional tax bracket charges only the excess at the higher rate

    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).

    Show the steps and the answer

    T(i) = 0.10i if 0 ≤ i ≤ 10000.

    T(i) = 1000 + 0.20(i − 10000) if i > 10000.

    T(15000) = $2000.

    1. 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.
    2. For 0≤i≤10000, write T(i)=0.10i.Ten percent is 10100 = 0.10 of the income in this first bracket.
    3. The tax on the first $10000 is 0.10×10000=1000.This charge remains part of the total when income enters the second bracket.
    4. 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.
    5. At i=15000, excess income is 15000−10000=5000.Subtracting the threshold isolates the amount charged at 20%.
    6. Compute T(15000)=1000+0.20×5000=1000+1000=2000.The total includes tax from both portions of the income.
    Answer
    • T(i) = 0.10i if 0 ≤ i ≤ 10000.
    • T(i) = 1000 + 0.20(i − 10000) if i > 10000.
    • T(15000) = $2000.
    Double-check At the threshold, both formulas would produce $1000, so the total does not suddenly jump to 20% of all income. Taxing all $15000 at 20% would incorrectly give $3000.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: Charge 20% of the entire $15000 income.
    The higher bracket applies only to $5000 above the threshold.
    ✓ Instead: Keep $1000 on the first $10000 and add $1000 on the excess, for $2000.

    Tips and tricks

    • Find the excess amount before applying the second rate.

    Part 4: A 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.

    g = 2 belongs to g ≥ 2

    C(2) = 25 + 10 × 0 = 25

    g = 0 belongs to neither piece

    Reminder

    Reminder: Order of operations, Percentages, Negating a negative
    • Order of operations. 25 + 10(4 − 2) means subtract first, multiply next, then add: 25 + 20 = 45.
    • Percentages. 10% of 10000 is 10100 × 10000 = 1000.
    • Negating a negative. −(−11) = 11, so the negative-input absolute value branch gives a positive distance.

    The same idea, five ways

    Say it

    Say a base price plus an extra charge above two gigabytes.

    Write it

    The conditions assign one formula to each positive usage input.

    In math
    • C(g) = 25 if 0 < g < 2
    • C(g) = 25 + 10(g − 2) if g ≥ 2
    • Domain: (0, ∞)
    • Range: [25, ∞)
    Like

    Pay a base entrance price, then pay for extra usage beyond what it includes.

    See it

    g = 2 belongs to g ≥ 2

    C(2) = 25 + 10 × 0 = 25

    g = 0 belongs to neither piece

    Worked example

    Piecewise ladder 3: the threshold itself

    For the same data-plan rule, find C(2) and decide whether C(0) is defined.

    Show the steps and the answer
    input goutput C(g), dollars125225445↓ evaluate: input given, read the output below it
    g: 1, 2, 4; C(g), dollars: 25, 25, 45.
    1. We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
    2. At g=2, the condition 0 < g < 2 is false.A strict inequality excludes its boundary.
    3. 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.
    4. At g=0, neither condition is true.Zero is not strictly positive and is not at least 2.
    5. 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.
    Answer
    • C(2) = $25.
    • C(0) is undefined for the stated function.
    Double-check The branch domains (0, 2) and [2, ∞) join to (0, ∞). The threshold belongs, while zero does not.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: The stated data plan assigns a cost to zero usage.
    Neither 0 < g < 2 nor g ≥ 2 includes zero.
    ✓ Instead: Its domain is (0, ∞), and C(0) is undefined.

    Tips and tricks

    • Check zero in the given conditions instead of guessing a policy.

    5 How

    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
    Does the input satisfy this branch's condition?
    YesUse that branch's formula.
    NoCheck the next condition.
    ↓
    2
    Is the input exactly a boundary?
    YesChoose the condition that includes equality.
    NoUse the interval containing the input.
    ↓
    3
    Does no branch assign an output?
    YesThe input is outside the given domain.
    NoCalculate the one assigned output.
    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.

    6 Worked example

    Worked example

    Evaluate a data-plan function

    OpenStax problem

    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).

    Show the steps and the answer
    input goutput C(g), dollars1.525225445↓ evaluate: input given, read the output below it
    g: 1.5, 2, 4; C(g), dollars: 25, 25, 45.
    1. We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
    2. For g=1.5, test 0 < 1.5 < 2.The condition decides which formula applies before any calculation.
    3. Use the first formula: C(1.5)=25.Every input strictly between 0 and 2 has the flat charge.
    4. For g=4, test 4≥2.This input belongs to the second piece.
    5. Subtract the included 2 gigabytes: 4−2=2.Only usage above the threshold is charged at the extra rate.
    6. Calculate C(4)=25+10×2=25+20=45.The base charge and the charge for two excess gigabytes must both be paid.
    Answer
    • C(1.5) = $25.
    • C(4) = $45.
    Double-check The second input uses two gigabytes above the threshold, so its $20 excess charge explains why the total is $20 above the flat $25 charge.

    Ladder: from easy to exam-hard

    Try each rung before you open its steps.

    Rung 1 of 5

    Absolute value uses the negative-input piece

    Write |x| as a piecewise rule and use it to find |−11|.

    Show the steps and the answer

    |x| = x if x ≥ 0.

    |x| = −x if x < 0.

    |−11|=11.

    1. 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.
    2. For x≥0, use |x|=x.A nonnegative coordinate is already its own distance from zero.
    3. For x < 0, use |x|=−x.The distance to zero is positive, so negating a negative coordinate gives its length.
    4. The input −11 satisfies x < 0, so choose −x.The input's sign selects the piece; you do not use both rules.
    5. Evaluate −(−11)=11.Taking the opposite of a negative number produces the positive distance.
    Answer
    • |x| = x if x ≥ 0.
    • |x| = −x if x < 0.
    • |−11|=11.
    Double-check Both 11 and −11 are eleven units from zero on the number line. At zero the nonnegative branch gives |0| = 0.

    Rung 2 of 5

    Piecewise ladder 2: a flat-charge input

    For C(g) = 25 if 0 < g < 2 and C(g) = 25 + 10(g − 2) if g ≥ 2, find C(1).

    Show the steps and the answer
    input goutput C(g), dollars1251.525225↓ evaluate: input given, read the output below it
    g: 1, 1.5, 2; C(g), dollars: 25, 25, 25.
    1. We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
    2. Check 0 < 1 < 2.The input fits the condition of the first branch.
    3. Use C(1)=25.This branch has no variable in its formula, so every input in it has the same cost.
    Answer
    C(1) = $25.
    Double-check Do not substitute 1 into the second formula: it is not assigned to this input.

    Rung 3 of 5

    Piecewise ladder 3: the threshold itself

    For the same data-plan rule, find C(2) and decide whether C(0) is defined.

    Show the steps and the answer
    input goutput C(g), dollars125225445↓ evaluate: input given, read the output below it
    The same picture again: g: 1, 2, 4; C(g), dollars: 25, 25, 45.
    1. We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
    2. At g=2, the condition 0 < g < 2 is false.A strict inequality excludes its boundary.
    3. 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.
    4. At g=0, neither condition is true.Zero is not strictly positive and is not at least 2.
    5. 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.
    Answer
    • C(2) = $25.
    • C(0) is undefined for the stated function.
    Double-check The branch domains (0, 2) and [2, ∞) join to (0, ∞). The threshold belongs, while zero does not.

    Rung 4 of 5

    Piecewise ladder 4: usage above the threshold

    For the same data plan, find C(6.5).

    Show the steps and the answer
    input goutput C(g), dollars2254456.570↓ evaluate: input given, read the output below it
    g: 2, 4, 6.5; C(g), dollars: 25, 45, 70.
    1. We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
    2. Since 6.5≥2, choose C(g)=25+10(g−2).The input belongs to the excess-usage branch.
    3. Calculate 6.5−2=4.5 gigabytes above the included amount.The first two gigabytes are accounted for by the base charge.
    4. 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.
    Answer
    C(6.5) = $70.
    Double-check Compared with C(4) = $45, the extra 2.5 gigabytes add $25. The difference $70 − $45 = $25 agrees.

    Rung 5 of 5

    Piecewise ladder 5: two boundary owners

    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).

    Show the steps and the answer
    input xoutput P(x)−51−2747613↓ evaluate: input given, read the output below it
    x:−5,−2,4,6;P(x):1,7,7,13.
    1. We need the outputs for the given inputs, choosing a condition before calculating.State what is being found before choosing the calculation.
    2. For −5, use x+6 and get −5+6=1.−5 satisfies the first condition x < −2.
    3. For −2, use the constant 7.Equality at −2 is included in the middle condition, not the first.
    4. For 4, also use the constant 7.Equality at 4 is included in the middle condition, not the last.
    5. For 6, use 3x−5 and get 3×6−5=18−5=13.6 satisfies x > 4.
    Answer
    • P(−5)=1.
    • P(−2)=7.
    • P(4) = 7.
    • P(6) = 13.
    Double-check The middle interval [−2, 4] owns both its endpoints, so −2 and 4 each belong to exactly one branch. On a number line, −5 sits left of −2 and 6 sits right of 4, so each of those uses an outer branch.

    Counterexamples

    What it is not, and the tempting wrong moves.

    ✗ Not this: At g = 4, use the flat $25 data-plan rule.
    The flat branch is assigned only to 0 < g < 2. Four gigabytes belongs to g ≥ 2.
    ✓ Instead: C(4)=25+10(4−2)=$45.
    ✗ Not this: The given data plan assigns C(0) = $25.
    Zero satisfies neither 0 < g < 2 nor g ≥ 2. A missing branch cannot be supplied from a guess.
    ✓ Instead: C(0) is undefined for the stated rule.
    ✗ Not this: In the fictional second tax bracket, charge 20% of all $15000.
    Only the $5000 excess is assigned the higher rate; the first $10000 retains its 10% charge.
    ✓ Instead: Tax is $1000 + $1000 = $2000.

    Tips and tricks

    • 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.

    7 The trap

    Using a formula because it is familiar before reading its condition. At g = 2 the data plan uses the g ≥ 2 piece. At g = 0 neither piece applies.

    Comes back in

    Problems marked OpenStax come from Precalculus 2e by Jay Abramson, published by OpenStax, under the CC BY-NC-SA 4.0 licence. Access for free at https://openstax.org/books/precalculus-2e/pages/1-introduction-to-functions.