Lesson 12

Piecewise Functions

Let’s look at functions that are defined in pieces.

12.1: Frozen Yogurt

A self-serve frozen yogurt store sells servings up to 12 ounces. It charges \$0.50 per ounce for a serving between 0 and 8 ounces, and \$4 for any serving greater than 8 ounces and up to 12 ounces.

Choose the graph that represents the price as a function of the weight of a serving of yogurt. Be prepared to explain how you know.

A

Horizontal axis, ounces of yogurt. Vertical axis, price in dollars. Graph of line through origin, 4 comma 2, 8 comma 4.

B

Horizontal axis, ounces of yogurt. Vertical axis, price in dollars. Graph of line through origin, 4 comma 2, 8 comma 4. Line is horizontal after 8 comma 4.

C

Horizontal axis, ounces of yogurt. Vertical axis, price in dollars. Graph of horizontal line y=4.

D

Horizontal axis, ounces of yogurt. Vertical axis, price in dollars. Graph of line through origin, 3 comma 1, and 9 comma 3.

 

12.2: Postage Stamps

The relationship between the postage rate and the weight of a letter can be defined by a piecewise function.

The graph shows the 2018 postage rates for using regular service to mail a letter.

Horizontal axis, weight in ounces. Scale 0 to 4, by 0 point 5's. Vertical axis, postage in dollars. Scale, 0 to 1 point 5, by 0 pint 2,5's. 
  1. What is the price of a letter that has the following weight?

    1. 1 ounce
    2. 1.1 ounces
    3. 0.9 ounce
  2. A letter costs $0.92 to mail. How much did the letter weigh?
  3. Kiran and Mai wrote some rules to represent the postage function, but each of them made some errors.

    \(\displaystyle K(w) = \begin{cases} 0.50, & 0\leq w\leq 1 \\ 0.71, & 1\leq w\leq 2 \\ 0.92, & 2\leq w\leq 3\\ 1.13, & 3\leq w\leq 3.5\\ \end{cases} \)

    \(\displaystyle M(w) = \begin{cases} 0.50, & 0< w< 1 \\ 0.71, & 1< w< 2 \\ 0.92, & 2< w< 3\\ 1.13, & 3< w< 3.5\\ \end{cases}\)

    Identify the error in each person’s work and write a corrected set of rules.


Here is an image showing how the postal service specifies the different mailing rates.

Notice that it uses the language "weight not over (oz.)" to describe the different rates.

Explain or use a sketch to show how the graph would change if the postal service uses "under (oz.)" instead?

First class mail mailing rates.

12.3: Bike Sharing

Function \(C\) represents the dollar cost of renting a bike from a bike-sharing service for \(t\) minutes. Here are the rules describing the function:

\(C(t)=\begin{cases} \begin{align} &2.50, &\quad &0< t\leq30\\ &5.00,&\quad &30< t \leq 60\\ &7.50, &\quad& 60< t\leq 90\\ &10.00, &\quad &90< t\leq 120\\ &12.50, &\quad &120< t\leq 150\\ &15.00, &\quad &150< t\leq 720 \end{align} \end{cases}\)​​​​​​

a bike share center
  1. Complete the table with the costs for the given lengths of rental.

    \(t\) (minutes) \(C\) (dollars)
    0
    10
    25
    60
    75
    130
    180

    Sketch a graph of the function for all values of \(t\) that are at least 0 minutes and at most 240 minutes.

    Horizontal axis, time in minutes. Scale, 0 to 240, by 30’s. Vertical axis, rental costs, in dollars. Scale, 0 to 15, by 2.5’s.

    ​​​​​​

  2. Describe in words the pricing rules for renting a bike from this bike sharing service.
  3. Determine the domain and range of this function.

12.4: Piecing It Together

Your teacher will give your group strips of paper with parts of a graph of a function. Gridlines are 1 unit apart.

Arrange the strips of paper to create a graph for each of the following functions.

\(\displaystyle f(x)=\begin{cases} \begin{align} \text-5,&\qquad \text-10< x< \text-5 \\ x,&\qquad \text-5\leq x< 0 \\ 1, &\qquad 0\leq x< 3\\ x-2, &\qquad 3\leq x< 8\\6, &\qquad 8\leq x < 1 0\ \end{align} \end{cases}\)

\(\displaystyle g(x)=\begin{cases} \begin{align} 5.5,&\qquad \text-10< x\leq \text-8 \\ 4,&\qquad \text-8< x\leq \text-3 \\ \text-x, &\qquad \text-3< x\leq 2\\ \text-3.5, &\qquad 2< x\leq 5 \\ x-5, &\qquad 5< x\leq 10 \end{align} \end{cases}\)

To accurately represent each function, be sure to include a scale on each axis and add open and closed circles on the graph where appropriate.

Summary

A piecewise function has different descriptions or rules for different parts of its domain.

Function \(f\) gives the train fare, in dollars, for a child who is \(t\) years old based on these rules:

  • Free for children under 5
  • \$5 for children who are at least 5 but younger than 11
  • \$7 for children who are at least 11 but younger than 16

The different prices for different ages tell us that function \(f\) is a piecewise function.

The graph of a piecewise function is often composed of pieces or segments. The pieces could be connected or disconnected. When disconnected, the graph appears to have breaks or steps.

Here is a graph that represents \(f\).

A graph. 

It is important to consider the value of the function at the points where the rule changes, or where the graph “breaks.” For instance, when a child is exactly 5 years old, is the ride free, or does it cost \$5?

On the graph, one segment ends at \((5,0)\) and another segment starts at \((5,5)\), but the function cannot have both 0 and 5 as outputs when the input is 5!

Based on the fare rules, the ride is free only if the child is under 5, which means:

  • \(f(5)=0\) is false. On the graph, the point \((5,0)\) is marked with an open circle to indicate that it is not included in the first segment (which represents ages that qualify for a free ride).
  • \(f(5)=5\) is true. The point \((5,5)\) has a solid circle to indicate that it is included in the middle segment (which represents ages that qualify for \$5 fare).

The same reasoning applies when deciding how \(f(11)\) and \(f(16)\) should be shown on the graph.

  • \(f(11)=7\) is true because 11-year-olds ride for \$7. The point \((11,7)\) is a solid circle.
  • \(f(16)=7\) is false because a 16-year-old no longer qualifies for a child’s fare. The point \((16,7)\) is an open circle.

The fare rules can be expressed with function notation:

\( f(x) = \begin{cases} 0, \quad 0< x<5\\ 5, \quad 5\leq x < 11 \\7, \quad 11\leq x < 16 \end{cases}\)

Glossary Entries

  • domain

    The domain of a function is the set of all of its possible input values.

  • piecewise function

    A piecewise function is a function defined using different expressions for different intervals in its domain.

  • range

    The range of a function is the set of all of its possible output values.