Understanding Piecewise Functions

A piecewise function uses different rules on different parts of its domain. Open and closed endpoints determine which rule includes a boundary input. This guide connects step graphs, evaluation, restricted-interval graphing, and constant-rate models built from elapsed time and accumulated distance.

Course cover for Understanding Piecewise Functions

One Price Won't Fit All

A plant nursery charges different prices for shrubs of different heights. The price depends only on height, measured in feet: a shrub up to 3 feet tall costs $40; a shrub over 3 feet but up to 5 feet costs $150; and a shrub over 5 feet costs $300

This is the purpose of a piecewise function: one function uses different rules on different parts of its domain. Instead of choosing a price independently of height, first determine which height interval contains the shrub

Which rule owns the boundary at exactly 3 feet? The phrase “up to 3 feet” includes 3, while “over 3 feet” excludes it. A shrub exactly 3 feet tall therefore costs $40. Open and closed endpoints on a graph make that distinction explicit

Reading Step Graphs

On the shrub price graph, the horizontal axis represents size in feet and the vertical axis represents price in dollars. The course's graph begins at a height of 1 foot. Each constant price appears as a horizontal shelf, and the price jumps between shelves. A graph with these flat levels and jumps is called a step function

Reading Step Graphs: Size (ft) Price ($) 2 4 6 8 100 200 300
Height intervalPriceGraph endpoints
1 ≤ x ≤ 3$40Closed dots at (1, 40) and (3, 40)
3 < x ≤ 5$150Open circle at (3, 150); closed dot at (5, 150)
x > 5$300Open circle at (5, 300); horizontal ray continues right

The first shelf includes both 1 and 3, so both inequalities have an equal sign. The second shelf excludes 3 but includes 5. The last shelf excludes 5 and continues for larger heights. These intervals cover the graph's modeled domain, x ≥ 1, without overlaps or gaps, so every input in that domain receives exactly one price

Reading Step Graphs: Size (ft) Price ($) 2 4 6 8 100 200 300

At x = 3, the dot at (3, 40) is closed and the circle at (3, 150) is open. Thus the graph confirms that a 3-foot shrub costs $40, not $150. At x = 5, the $150 shelf includes the boundary and the $300 shelf excludes it

Practice 1: Parking garage fees

A parking garage's step graph has a $3 level from a closed dot at (0, 3) to an open circle at (2, 3). Its $7 level starts with a closed dot at (2, 7) and ends with an open circle at (6, 7). Its $12 level starts with a closed dot at (6, 12) and continues right. Equivalently, the fees are $3 for 0 ≤ x < 2, $7 for 2 ≤ x < 6, and $12 for x ≥ 6, where x is hours parked

Reading Step Graphs: 0 2 4 6 8 Hours parked 3 6 9 12 Fee ($)

Exactly 2 hours parked: which fee applies?

A

$3

B

$7

C

Either $3 or $7

Evaluating Piecewise Functions

A curly-brace definition places each expression beside the condition under which it applies. To evaluate the function, first match the input to its one condition. Then substitute into that expression. The condition selects the rule; the expression determines the output

Constant pieces and a boundary input

Define h(x) by three rules: h(x) = −4 when x < 0; h(x) = 8 when 0 ≤ x < 2; and h(x) = 12 when x ≥ 2. Find h(−3) and h(2)

For h(−3), the input satisfies −3 < 0, so the first rule gives h(−3) = −4. For h(2), the first condition fails because 2 is not less than 0. The middle condition also fails because 2 < 2 is false. The last condition, x ≥ 2, includes 2, so h(2) = 12. Choosing the middle output, 8, would use a rule whose condition is false

Algebraic pieces at the boundary

Given p(x) = 3x − 2 for x < 4 and p(x) = x² − 10 for x ≥ 4, find p(−2) and p(4)

Since −2 < 4, use the first expression: p(−2) = 3(−2) − 2 = −6 − 2 = −8. At the boundary, 4 < 4 is false, while 4 ≥ 4 is true. Therefore p(4) = 4² − 10 = 16 − 10 = 6. The calculation 3(4) − 2 = 10 is not the function value at 4 because it uses the wrong piece

Practice 2: Condition and output

Let q(x) = 2 − 5x for x ≤ −1 and q(x) = x² + 1 for x > −1. Evaluate q(−1): which condition does −1 satisfy, and what is the output? The original completion choices are x ≤ −1, x > −1, 7, 2, and −3

The completed statement is: −1 satisfies x ≤ −1, so q(−1) = 7. Substitution gives 2 − 5(−1) = 2 + 5 = 7. The value 2 comes from the second expression, (−1)² + 1, but −1 is not strictly greater than −1, so that piece does not apply

Graphing Piecewise Functions

To graph a piecewise function, draw each expression only over the interval specified by its condition. At each boundary endpoint, use a closed dot if the condition includes that input and an open circle if it excludes it

Graph one constant piece at a time

Graph f(x) = 5 for x < −1 and f(x) = −3 for x ≥ −1. The first piece is a horizontal ray at y = 5 extending left from an open circle at (−1, 5). The second is a horizontal ray at y = −3 extending right from a closed dot at (−1, −3)

At x = −1, only (−1, −3) belongs to the graph, so f(−1) = −3. Any vertical line meets exactly one included point. The jump does not prevent the graph from representing a function: every input still has exactly one output

Linear pieces with a jump

Graph g(x) = −x + 6 for x ≤ 2 and g(x) = ½x + 1 for x > 2, and find g(2). The first line has slope −1 and is restricted to x ≤ 2. At its endpoint, y = −2 + 6 = 4, so place a closed dot at (2, 4) and draw the line to the left

The second line has slope ½ and is restricted to x > 2. Its boundary height is ½(2) + 1 = 2, but this piece excludes 2, so place an open circle at (2, 2) and draw the ray to the right. The closed dot at (2, 4) gives g(2) = 4. Although two endpoint markers are vertically aligned, the hollow one is excluded, so the input 2 has only one output

Graphing Piecewise Functions: -6 -4 -2 2 4 6 6 4 2 -2 -4 -6 0
Graphing Piecewise Functions: 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 0

Practice 3: Classifying boundary endpoints

Let k(x) = x + 3 for x < −2; k(x) = 2x for −2 ≤ x ≤ 1; and k(x) = 5 for x > 1. For each specified piece's boundary endpoint, does the condition include that x-value? The original task sorts three endpoints into “Closed (filled) dot” and “Open (hollow) circle.”

The x + 3 piece at x = −2 has an open circle because x < −2 excludes −2. The 2x piece at x = −2 has a closed dot because −2 ≤ x ≤ 1 includes −2. The constant 5 piece at x = 1 has an open circle because x > 1 excludes 1. Each classification follows the condition, not whether the endpoint is on the left or right

Building Piecewise Models

The lakeside relay

One athlete completes a 55-mile lakeside relay in three stages, moving at a constant speed within each stage. The swim takes 1 hour and covers 3 miles. The bike stage takes 2 hours and covers 40 miles. The run takes 2 hours and covers 12 miles. Find m(x), the total miles traveled after x hours, together with the intervals for its rules

StageStage duration (h)Stage distance (mi)Rate (mi/h)Elapsed-time interval
Swim133 ÷ 1 = 30 ≤ x ≤ 1
Bike24040 ÷ 2 = 201 < x ≤ 3
Run21212 ÷ 2 = 63 < x ≤ 5
Building Piecewise Models: 0 1 2 3 4 5 6 10 20 30 40 50 60 Time (h) Distance (mi) swim bike (1, 3) run (3, 43) (5, 55)

The intervals use total elapsed time, not a new clock for each stage. The swim ends at hour 1. Two more hours place the end of the bike stage at hour 3, and two further hours place the finish at hour 5. Assigning each shared boundary to one interval covers 0 ≤ x ≤ 5 exactly once

Use a slope and a starting point

Each stage is a line whose slope is the constant speed. The swim starts at (0, 0) and has slope 3, so y = 3x. At hour 1, the distance is 1 × 3 = 3 miles, giving the endpoint (1, 3)

The bike stage starts at (1, 3) with slope 20. Point-slope form gives y − 3 = 20(x − 1). Expanding and adding 3 gives y = 20x − 20 + 3 = 20x − 17. During its 2 hours, the bike stage adds 2 × 20 = 40 miles. The accumulated distance is then 3 + 40 = 43 miles at hour 3

The run starts at (3, 43) with slope 6. Point-slope form gives y − 43 = 6(x − 3), so y = 6x − 18 + 43 = 6x + 25. At hour 5, this gives 6(5) + 25 = 55 miles, confirming the total relay distance

Assemble the model and its graph

The complete function is m(x) = 3x for 0 ≤ x ≤ 1; m(x) = 20x − 17 for 1 < x ≤ 3; and m(x) = 6x + 25 for 3 < x ≤ 5

On a graph with time in hours on the horizontal axis and distance in miles on the vertical axis, the swim segment connects (0, 0) to (1, 3). The steeper bike segment connects (1, 3) to (3, 43), and the run segment connects (3, 43) to (5, 55). Consecutive segments meet at their shared endpoints, so the complete graph is continuous, with no jumps or holes. Separate hollow markers are unnecessary at the joins of this assembled graph because those points are included by the preceding pieces

Practice 4: Paddleboard rental

A paddleboard rental costs a flat fee of $18 for up to 2 hours. Every hour beyond 2 costs $5 more, and the rental can last up to 8 hours. Complete the second cost rule for 2 < x ≤ 8, where x is hours rented: C(x) = 18 + 5 ·

hours charged at $5

= 5x +

$$simplified constant$$

. The original choices are (x − 2), x, 8, and 18

The extra hours are x − 2 because the flat fee already covers the first 2 hours. Therefore C(x) = 18 + 5(x − 2) = 18 + 5x − 10 = 5x + 8 for 2 < x ≤ 8. The blanks are (x − 2) and 8. Multiplying 5 by x would incorrectly charge the additional rate for hours already covered by the flat fee

Summary

One rule per interval: in the piecewise definitions used here, the conditions partition the modeled domain without overlaps or gaps. Each input in that domain receives exactly one output

Dots decode boundaries: a filled, closed dot includes its endpoint and corresponds to ≤ or ≥. A hollow, open circle excludes its endpoint and corresponds to < or >. When different candidate heights occur at the same boundary input, the included point determines the function value

Evaluate and graph by condition: match the input to its condition before substituting, and draw each expression only over its specified interval. A jump is allowed as long as each input still has exactly one output

Build models with elapsed time: intervals use the total clock, slopes are the constant rates, and later pieces start from the previous stage's endpoint. For example, the relay's bike equation begins with y − 3 = 20(x − 1), not y = 20x

Quiz

Quiz 1: Evaluate at a boundary

For this question, f(x) = 2x + 1 when x < −3 and f(x) = 5 − x² when x ≥ −3. Find f(−3)

Using the definition shown, what is f(-3)?

A

-4

B

-5

C

14

D

Both -4 and -5

Quiz 2: Identify the boundary configuration

For this question, g(x) = x − 1 when x ≤ 3 and g(x) = −x + 7 when x > 3. At x = 3, the first expression gives height 2 and the second gives height 4. The boundary configurations named in the options describe the two vertically aligned endpoint markers: the lower marker is at (3, 2), and the higher marker is at (3, 4)

Tap the boundary picture that correctly graphs g at x = 3

A

Filled low dot, hollow high circle

B

Hollow low circle, filled high dot

C

Both dots filled

Quiz 3: Model a later stage

A traveler walks at 4 miles per hour for the first 2 hours, covering 8 miles. Then a bus carries the traveler at 30 miles per hour until hour 3. Let y be total miles after x hours

Which equation models the bus stage for 2 < x $$\le$$ 3?

A

y = 30x - 52

B

y = 30x

C

y = 30x + 8

Continue with the interactive lesson