## Piecewise Functions

You CAN Ace Precalculus

17trek > precalculus > piecewise functions

### Page Tools, Related Topics and Links

Wikipedia - Piecewise Functions

Wikipedia - Piecewise Linear Function

### Piecewise Functions FAQs

ideas to save on books - bags - supplies

Are you a little apprehensive about piecewise functions? If so, it may help to read this introductory article called Piecewise Functions - The Mystery Revealed before going through the material on this page.

### Piecewise Functions - The Mystery Revealed

Many students find working with piecewise functions confusing and bewildering. Some students may even cringe when they find out that understanding piecewise functions is very important for limits and, consequently, the rest of calculus. Why is that? What makes piecewise functions so difficult to comprehend?

Here are some possible reasons.
1. You may have had it explained to you the first time by a teacher that really didn't understand it themselves.
2. Or the teacher may have understood it but may not have been able to communicate it well.
3. If you feel like math is something you cannot understand or do well in, your own mental block may keep you from understanding some (or all) topics.
4. Some students think they can understand things without studying them and, therefore, when a more difficult topic comes up, they are lost because they don't spend the time outside of class learning it. Eventually, that mindset will come back to bite you, especially in calculus. [ how to study calculus ]

Whatever the reason, it is time for you to take charge of your own learning and learn how to work with piecewise functions. As mentioned above, I have helped many students come to understand this topic and they look at me and say, 'is that it?!' meaning that they were surprised that they could now understand it.

Piecewise functions are not that hard and you can understand them too. Go through the discussion on this page, working through the example. Then try your hand at a few practice problems and see for yourself how easy it is. You will be glad you did when you get to limits.

This is an incredibly important concept that you need to understand for limits, which are the key to calculus. To understand this topic, you need to know why the domain of a function is important.
Many students think this is a difficult concept but I have had students that come into my class not understanding this and, after they get it, they look at me and say, 'That's it?!" as if it should be harder. But it is not hard, it just stretches your brain a tad bit but you can get it. Here is the idea.

A regular function usually has a single domain, which may or may not be explicitly stated. If it is not stated, you can imply it from the equation. In contrast, a piecewise function always specifies the domain AND the domain is usually broken into pieces. Graphically, you can think about breaking up the xy-plane with vertical lines. First, let's look at a graph and then we will discuss what the equations look like.

plot 1

Look at plot 1 to the right. Notice that at $$x = 1$$ something strange is happening. We can divide the xy-plane into two parts, one to the left of $$x = 1$$ and one to the right. So, what we do is consider each side separately. There is no overlap (Otherwise it would not be a function, would it?).

So, if we cover up the part of the plane from $$x = 1$$ to the right (take a piece of paper and do that now, if you need to), we have something that looks like part of a parabola, right? Now, we if cover up the part of the plane from $$x = 1$$ to the left, we have something that looks like part of an upside-down parabola, right? So this graph could be described by the equation

$$\displaystyle{ f(x) = \left\{ \begin{array}{rrl} x^2 & & x < 1 \\ -(x-2)^2+3 & & x \geq 1 \end{array} \right. }$$

Okay, we have seen how an equation might fit a graph. But what if you are given the equation and you need to come up with a graph? I will show you how I do it and see if this helps you.

Let's start with the same equation above, i.e. $$\displaystyle{ f(x) = \left\{ \begin{array}{rrl} x^2 & & x < 1 \\ -(x-2)^2+3 & & x \geq 1 \end{array} \right. }$$ and let's try to build the graph shown in plot 1.

Start by just graphing both functions on the same set of axes to get the plot 2 below. The red graph is $$y = x^2$$. The blue graph is $$-(x-2)^2+3$$. At this point, we show the complete graphs of both equations without taking into account the domains. You can tell this is not a function, right?

What we need to do now is implement the domain of each part of f(x). To do this we notice that $$y=x^2$$ is defined only for $$x < 1$$. So we 'erase' or remove all of the red graph that is to the right of $$x = 1$$. We also notice that $$x < 1$$ means that x must be less than one but not equal to one. So we need an open circle on the red graph to indicate this exclusion of one. The result of these changes is the plot 3 below.

plot 2

plot 3

plot 1 (again)

Okay, we are almost done. Now we need to implement the domain of $$x \geq 1$$ on the blue graph. The equation tells us that the blue graph is defined only for $$x \geq 1$$. So we 'erase' or remove all of the blue graph to the left of $$x= 1$$. We also notice that this graph includes $$x = 1$$ since the greater than or equal sign is used. So we need a closed circle at $$x = 1$$. The result is plot 1, repeated here.

So, that's one way to do it. This idea can be extended to more than two parts, i.e. the graph may be broken at more than just one point. Just break the domain into the separate sections and deal with as many sections as you have in your equation. The practice problems contain some examples.

### Can sections of piecewise functions overlap?

Long Answer - - As with many questions, the answer depends on the wording of the question. When writing down the piecewise equation of a graph, sections can certainly overlap. The mathematics is there to allow such a graph. However, since the word 'function' is used in the question, if there were any overlaps in the definition or the graph, we would no longer have a function (since the graph would not pass the vertical line test). So in order to define a piecewise function, none of the sections may overlap.

Note: We are assuming here that the question is implying that 'overlap' means there exists at least one x-value with two possible corresponding y-values, i.e. there is at least one vertical line that crosses the graph at more than one point.

like? 0

Practice Problems

Instructions - - Unless otherwise instructed,
- if the problem gives an equation, graph the function
- if the problem shows a graph, write an equation for the graph
[ Click on the practice problem to reveal/hide the solution. ]

 Level A - Basic

 Level B - Intermediate