Graphing Piecewise Functions

Graphing piecewise functions is not just an exercise in mathematical folly!

We use these types of functions so regularly in science and business that you could almost say they are the most "real" of our applications of functions.

Your need to be able to graph piecewise functions. As you do you should

Think about this example from science . . .

If you heat a block of ice, the temperature rises while you heat the ice until you’ve warmed it to 32E F. Then the temperature remains unchanged until the heat has completely transformed the ice to water. Only then does the temperature rise again as you add more heat.

Or, if you don’t like science, think about business . . .

Suppose you plan to buy many blank compact disks. Maybe your music group wants to cut its first Grammy winner! You check price lists and find out that if you buy less than a 1000 CD’s you pay $0.74 each. However if you buy between 1000 and 2000 CD’s the price drops to $0.69 each for the second thousand. Also, for any purchase of more than 2000, the price for the CD’s drops again to $0.64 for each after the 2000th.

These are each piecewise functions. Your calculator can graph the functions in a very simple and informative way...
That is, if you can write down the appropriate piecewise function to feed it!

The Steps

The Instructions

Getting Started

First, turn on your calculator. You'll want to get to where you can enter a function.

For this demonstration, the example screens are taken from a Casio® calculator.

Entering the Function

We will begin with the function for .

This is no problem!

1. At Y1: type an x, but don’t hit ! You'll get the function for all real numbers. It's a nice function, but way too big for our needs.

2. Now to get the "piece" of the domain that we want, type a comma followed by the interval notation for , I.E., .

3. Now enter the formula with the

The first piece of the puzzle.

When you "draw" the graph with the F6 key ( ), you’ll see the graph of for .

Notice it is just the appropriate part of the function .

Let’s expand upon this function.

  • To this point we haven’t entered a piecewise defined function.
  • We’ve only entered a function with a restricted domain.

A New Piece

Now let’s add a new piece to our function. We’ll add on

for .

When we do, we’ll have built the function

Now that really is a piecewise function! No single formula will allow you to draw this function.

The next piece of the puzzle.

When you "draw" the graph with the F6 key ( ), you’ll see the graph of

.

This is definitely piecewise! No single graph shape will allow you to draw it.

Before we go any further, look at the intervals for the formulas we’re using.

  • Your calculator could care less! It doesn’t know anything about vertical line testing. It’s just plotting points. Many, many points. It doesn't even try to connect the dots!! You're mind does that for you.
  • When you enter a piecewise defined function, you need to remember where the critical points of the intervals belong on the graph.
  • In the example so far, that was not a problem. The function is continuous at x = 1. This means the function doesn't jump, become undefined, or break at that point.

The Last Piece

Just to make that point about where the critical values belong, let's add a new branch to our piecewise function.

In the Y3: line, type in the function
.
You've built the function

.

The Whole Story

When you "draw" the graph with the F6 key ( ), you’ll see the graph of

This graph is discontinuous at x = -1.

Check yourself with the challenge question to the left.

Conclusion

The calculator is a very useful tool for graphing piecewise functions once you have a set of formulas.

However,

  • It cannot tell you which of the pieces applies at the critical points. You have to do that.
  • We generally use the symbols ! on a graph to show where the critical points lie on the graph.
  • We use a " to show that an end point of a segment is not included in the graph.
    • Calculate the values of the function at -2, -1, 1 and 2.
    • They are -8, -1, 1 and 4 respectively.
    • Reproduce the shape of the graph from your calculator, then label each end point of each segment appropriately.
  • It will not necessarily show you the complete graph. In the picture above the graph is incomplete.
  • The picture to the right shows how you might sketch the graph of the sample piecewise function. The video is in a loop, so just watch the function "grow" before your eyes.

An Exercise

Using this information:

Suppose you plan to buy many blank compact disks. You check price lists and find out that if you buy a 1000 CD’s or less you pay $0.74 each. However, if you buy between 1000 and 2000 CD’s the price drops to $0.69 each for the second thousand. Also, for any purchase of more than 2000, the price for the CD’s drops again to $0.64 for each after the 2000th.

    1. Create the piecewise function to calculate the cost for purchasing up to 5000 CD's. Let p(n) be the cost to purchase n cd's
    2. Graph p(n) with your calculator.
    3. Provide a hand drawn sketch with end points properly labeled as ordered pairs.
    4. Calculate the cost to buy 250, 1000, 2000, and 3500 CD's respectively.

Click here to see the correct results.

© 2011 by Terry L. Turner, last updated June 27, 2004