{{ 'ml-label-loading-course' | message }}
{{ toc.name }}
{{ toc.signature }}
{{ tocHeader }} {{ 'ml-btn-view-details' | message }}
{{ tocSubheader }}
{{ 'ml-toc-proceed-mlc' | message }}
{{ 'ml-toc-proceed-tbs' | message }}
Lesson
Exercises
Recommended
Tests
An error ocurred, try again later!
Chapter {{ article.chapter.number }}
{{ article.number }}. 

{{ article.displayTitle }}

{{ article.intro.summary }}
Show less Show more expand_more
{{ ability.description }} {{ ability.displayTitle }}
Lesson Settings & Tools
{{ 'ml-lesson-number-slides' | message : article.intro.bblockCount }}
{{ 'ml-lesson-number-exercises' | message : article.intro.exerciseCount }}
{{ 'ml-lesson-time-estimation' | message }}
The aim of this lesson is to graph functions that are defined differently for different parts of their domains.

Catch-Up and Review

Here are a few recommended readings before getting started with this lesson.

Challenge

How Many Cans Are There in the Fridge?

Mark always likes to have cans of his favorite soft drink in the refrigerator so that he can enjoy a cold drink whenever he wants.

At the beginning of the week, he had cans in the fridge. Over the week, Mark wrote down each time cans were consumed or added.

  • On Monday, Mark drank can.
  • On Wednesday, Mark bought cans at a convenience store and put them into the fridge.
  • On Friday, Mark had a party and a total of cans were consumed.
  • On Saturday, Mark bought a pack of soda from a supermarket and put them away in the refrigerator.
a How can the number of cans in the fridge be written as a function?
b Graph the number of cans in the refrigerator over the week.
Discussion

Piecewise Functions

A piecewise function is a function that is defined differently for different parts of its domain. These functions are commonly defined using intervals or inequalities. Consider the following example.
This function is defined as one linear function for values of less than and a different linear function for values of that are at least zero. The graph of is obtained by graphing the two rays. It should be noted that both rays represent the same function.
Piecewise Example
For every function, each input can correspond to only one output. Therefore, when two pieces of a piecewise function share a limit value, only one of the pieces can be defined for that value. It can be seen in the example function for that only the second piece is defined for Additionally, it is possible for a piecewise function to be undefined for some intervals.
When plugging an input into a piecewise function, it is important to determine which expression should be used to find the correct output. This will be practiced in the next example.
Pop Quiz

Practice Finding Values

A piecewise function is shown below. For every given value of find the correct value of Round the result to two decimal places, if necessary.

Find the value of f(x)
Discussion

Graphing Piecewise Functions

When graphing a piecewise function, each piece must be considered separately. First, a piece is graphed for the values of its domain. Then an end — or ends — of the piece are marked with one of the following.

  • A closed circle for an value for which the function is defined.
  • An open circle for an value for which the function is undefined.
Consider the following piecewise function.
Now, each piece will be considered one at a time. Then, the graphs will be combined.
1
First Piece
expand_more

The first piece is This is a linear function written in slope-intercept form. The function can be graphed by using the intercept and the slope.

Function 4*x+6 with a y-intercept at (0, 6) and a slope of 4 (4 rise, 1 run).

Now, since the function is limited to inputs less than or equal to the line will be graphed until it reaches Since the inequality is non-strict, the function is defined for and the circle will be closed.

Slope-intercept 1
2
Second Piece
expand_more

A similar process can be repeated to graph the second piece First, the line will be graphed.

This piece is defined for values of greater than This means that the line will be drawn starting at Also, since the inequality is strict, the circle will be open.

3
Combining the Graphs
expand_more

Finally, the pieces will be graphed together in the same coordinate plane to complete the graph. It is important to pay attention to the limit points, since each value of must be assigned to only one value of the function.

Example

Going to the Beach

On his summer vacation, Heichi often rides his bike to a nearby beach. Today he is going to meet a friend there.
surfing USA part 2
After leaving his house, Heichi bikes at miles per hour for one hour until he reaches the beach. He spends hours at the beach, then goes back to his house at miles per hour. He arrives at back home an hour and a half after leaving the beach.
a Write a piecewise function that describes Heichi's distance from home as a function of time.
b Graph the function written in Part A.
c Describe the domain and range of the function written in Part A.

Answer

a
b
Answer Graph
c The domain consists of the number of hours betweeen and hours. The range is all the possible distances between and miles from his house.

Hint

a Determine a function rule for each part of Heichi's trip.
b Graph each piece one at a time.
c Where does the function written in Part A start? Where does it end?

Solution

a To begin with, for the first hour, Heichi bikes at miles per hour. This speed can be used to write the first piece of the desired function. It is important to remember that the distance traveled is the product of the speed and the travel time.
Since Heichi was biking at miles per hour for one hour, he traveled miles in this interval. In the next piece, the value of the function is constant at for the values of between and because he is just hanging out at the beach for these hours.
Finally, when Heichi goes home, he bikes at miles per hour. Since he is returning home, the distance from his house will decrease. Therefore, the distance traveled is written as the product of and
Also, since Heichi arrives at home one and a half hours later, the final value of the last piece should be hours after the beginning of the trip. Therefore, the function needs to be translated units right by subtracting from before multiplying by
Finally, it is possible to write the complete function rule by adding this final piece.
b To graph the obtained piecewise function, each piece will be graphed one at a time on the same coordinate plane. First, the graph of from to can be drawn by using the slope and the intercept Since the limit inequalities are non-strict, the border points will be closed.
First Piece

The second piece of the function is the horizontal line Also, since the inequality is non-strict, the circle at will be filled.

Second Piece

Now, the intercept can be used to graph the third and final piece. From Part A, it is known that the intercept is

Third Piece

Finally, the graph of the piecewise function is completed.

Function Graph
c From Part A, it can be seen that the function is defined for times between and hours, inclusive. Therefore, the domain of the function consists of all the real numbers in that interval.
The function's output represents how far Heichi is from his house. Looking at the graph, it can be seen that the minimum value of the function is when Heichi is at his house, and the maximum value is when Heichi is at the beach. While he is biking between his house and the beach, all distances from to are reached.
Discussion

Step Functions

A step function is a piecewise function that is defined by a constant value on each part of its domain. As an example, consider the following function.
The graph of a step function consists of horizontal line segments, which can be interpreted as steps. The graph of the given function has four line segments.
Step Function Example
Example

Collecting Boxes Over the Week

As a summer activity, Tearrik participates in charity events for his community. He is volunteering for a food drive event this weekend.

He went to a shopping center multiple times over the week to collect boxes of food for the food drive. On each day, he collected the following number of boxes.

  • boxes on Monday
  • boxes on Tuesday
  • boxes on Wednesday
  • boxes on Thursday
  • boxes on Friday
Write a step function that indicates how many boxes in total Tearrik collected over the week.

Answer

Hint

Use the given days of the week as the domain of the function.

Solution

First, the domain of the function must be determined. The domain can be defined as the given days of the week, starting with the Sunday before Tearrik started collecting the boxes as Since Tearrik makes his first pickup on Monday, he starts with zero boxes on Sunday
On Monday, since one day has passed from Sunday, On this day, Tearrik collected his first boxes.
On the following days, Tearrik collected more boxes. The boxes picked up each day were added to the number of boxes collected previously. Using this information, the pieces can be written in a table.
Day Collected Boxes Boxes in Total
Sunday -
Monday
Tuesday
Wednesday
Thursday
Friday
Finally, the function rule of the step function can be written based on the table.
Discussion

Graphing Step Functions

Since step functions are piecewise functions, to graph them, each piece must be considered separately. First, each piece is graphed in its domain as a part of a horizontal line. The end or ends are then marked with one of the following.

  • A closed circle for an endpoint that is included in the function rule.
  • An open circle for an endpoint that is not included in the function rule.
As an example, consider the following step function.
For this example, one piece will be graphed in detail, then the other pieces will be graphed by following a similar process.
1
Graph a Horizontal Line
expand_more

The first piece is defined over the interval This piece will be graphed by drawing a horizontal line at from to

First Piece Horizontal Line
2
Drawing Endpoints
expand_more

It can be noted that is included in the domain of the first piece, but is not. Therefore, the left end of the segment will be marked with a closed circle and the right end with an open circle.

First Piece Endpoints
3
Graph the Other Pieces
expand_more

Then, the same process is repeated for each piece of the function.

Step Function Graph
Example

Saving Tips for a Week

Zain is working as a server in a restaurant for a week before their summer vacation ends.

Plate Fork Knife Emoji

Most of their payment comes from the tips they receive. Zain made note of how much they received in tips, starting from Monday and through their last day working on Saturday.

  • on Monday
  • on Tuesday
  • on Wednesday
  • on Thursday
  • on Friday
  • on Saturday
a Write a step function that describes the tips that Zain received during the week.
b Graph the function written in Part A.

Answer

a
b
Step Function Graph

Hint

a Determine the domain of the function.
b Graph each piece separately.

Solution

a The first thing to consider when writing a function is the domain. The domain of this function is defined as the days of the week, starting from the Sunday before Zain's week of work. This Sunday will be marked as Each day of the week will correspond to the next consecutive integer.
This indicates that Zain received in tips on Sunday before they start working. On Monday Zain received in tips. This defines the next piece of the function.
Since the function reflects the total amount of money Zain receives in tips, the value of each of the pieces can be determined by adding the new tip value to the total tip amount from the day before. Using this information, the pieces can be written in a table.
Day Tips Received Total Tips
Sunday -
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Finally, the step function can be written based on the table.
b To graph a step function, each piece should be graphed separately on the same coordinate plane. The first section is a horizontal line at limited to and The first circle will be closed and the second will be open.
First Piece

The next piece is the horizontal segment at with a closed endpoint at and an open endpoint at

Second Piece

The remaining pieces can be added to the graph by following the same process.

Step Function Graph
Discussion

Greatest Integer Function

The greatest integer function, also known as the floor function, assigns the largest integer that is less than or equal to the value of This function is usually written as or Consider the following examples.
It can be noted that if is an integer, the function returns the same value.
Otherwise, it returns the closest integer at the left of in a number line.
Greatest Integer Function Examples

Considering more values can help understand how to draw the graph of the function.

From the table above, it can be seen that the function only changes its value when a new integer is reached. It can be noted that the greatest integer function is a step function. Its graph is presented as follows.

The domain of the function is the set of all real numbers, but its range is the set of integers. A filled point indicates that the point is part of the graph, while an open point indicates that it is not.
Example

The Price of Parking at the Cinema

Dominika is going to a movie at a local theater on her last day of vacation.

Mall Emoji

The cost to park in the theater lot is for less than an hour. An additional is charged for each hour of parking.

a Write the greatest integer function that describes the prices of the mall's parking lot.
b Graph the function obtained in Part A.

Answer

a

b
Greatest Integer Function Graph Answer

Hint

a If is charged every hour, only the integer part of the number of hours determines parking charges.
b Start with the graph of the greatest integer function. Then, apply transformations to modify the graph.

Solution

a The first thing to notice to write the function is that is charged for each hour of parking. This means that as soon as one hour is reached, is added to the total cost of parking. At the two hour mark, the next is charged. This can be written by multiplying by where is the parking time in hours.
Additionally, the lot requires an initial payment of for the first minutes of parking. This information can be used to add to the value of the obtained function
This completes the required function, as the price to enter is considered and is added as each hour is reached.
b This function can be graphed by modifying the graph of the greatest integer function. Since only the positive values of are relevant, the graph will be considered only in the first quadrant. This graph is shown as follows.
Greatest Integer Function Graph

Next, since the greatest integer function is multiplied by each value of is multiplied by vertically stretching the spaces between each horizontal segment.

Greatest Integer Function Graph Multiplied

Then, since is added to the product, each segment is translated vertically units up.

Greatest Integer Function Graph Multiplied and Addition

Finally, the scope of the coordinate plane will be adjusted so that more steps of the graph can be seen.

Greatest integer function graph after transformations and with skipped values
Example

Math Graphing Assignment

During his summer vacation, Ignacio went to private math lessons. After learning about the greatest integer function, Ignacio was asked by his math tutor to graph the numbers greater than or equal to

Teacher Asks a Question
Help Ignacio with his answer and graph the inequality

Answer

Answer Graph

Hint

Graph the greatest integer function. Then, determine the solution set by shading the appropriate region.

Solution

The first step to graph an inequality is to graph the border function. The border function of the given inequality is given by the greatest integer function. This function is a step function whose output is the greatest integer less than or equal to the input Note that the inequality is non-strict, so the horizontal lines are drawn as solid lines.

Greatest Integer Function Graph
Now a random point can be used to test which region satisfies the inequality. Any point that does not lie on the border function can be chosen. For this example, will be used.

Since the point does not satisfy the inequality, the region on the other side of the border function is solution set of the inequality.
Shaded Region
Finally, it is important to verify if the borders of the vertical segments between each horizontal segment are solid or dashed, to avoid confusion whether the points that lie on this line satisfy the inequality or not. To verify this, as with the initial solution region, a test point will be selected and substituted into the inequality. In this case, will be used.

Since the point does not satisfy the inequality, the vertical segments should be dashed.
Dashed Vertical Segments Graph

Finally, the following is the complete graph of the inequality that the teacher asked for.

Answer Graph
Closure

Cans in the Fridge

At the beginning of this lesson, it was asked that a function for the number of soda cans in Mark's refrigerator be written. Mark starts the week with cans in the fridge and then does the following.

  • On Monday, Mark drank can.
  • On Wednesday, Mark bought cans at a convenience store and put them into the fridge.
  • On Friday, Mark had a party and a total of cans were consumed.
  • On Saturday, Mark bought a pack of soda from a supermarket and put them away in the refrigerator.
a How can the number of cans in the fridge be written as a function?
b Graph the number of cans in the refrigerator over the week.

Answer

a
b
Step Function Graph

Hint

a First, determine the domain of the function.
b What kind of functions have constant outputs for each part of their domain?

Solution

a The first thing to do when writing a function is to determine its domain. In this case, the domain can be written as the number of days passed from the beginning of the week, starting from Sunday as With the given information, it is possible to write the first part of the piecewise function.
Mark drank one can of soda on Monday. Therefore, he has now cans left in the fridge that day. Also, since he neither drank nor bought any soda on Tuesday, the function's output is still until Wednesday, when
Mark bought cans on Wednesday, meaning that there are cans of soda in the fridge that day. Since he neither bought nor drank any of the soda in the refrigerator on Thursday, he has cans until Friday.
At Friday's party, a total of cans were drunk. Therefore, he has cans left in the refrigerator for Saturday. Then, on Saturday, he bought a pack of soda cans, making it for cans in the refrigerator for that day. Because no more information was given, the whole function rule can now be written.
b Since every part of this function is a constant value, this is a step function. The graph of a step function consists of horizontal lines limited to specific inputs. It is important to remember the values for which the inequality for is strict or non-strict.
Step Function Graph



Loading content