Simply put, a function is a mechanism for taking a number from you and then giving you a number back. In a math class, this is usually a sequence of arithmetic operations. Usually, the function behaves ignorantly, applying the same process no matter what number you give it. A piecewise function behaves more realistically. It looks at the number first, and decides what to do based on the number itself. The first example most people see is the absolute value function. This function needs to know whether the number given it is positive or negative before deciding what to do with it. If the number is already positive, the absolute value leaves it alone. However if the number is negative, the absolute value function has to change its sign.
Piecewise functions generally decide what formula to put a number into on the basis of "where" the number is found. In the above example, positive numbers are found "to the right" of zero and negative numbers are found "to the left" of zero. For the purpose of graphing, it is useful to consider how this relates to the x-y plane. The set of all points associated with a given value of x, such as 2, would be the vertical line of points situated above and below the 2 on the x-axis. Similarly, the points of the plane associated with an interval of points on the x-axis would be a vertical strip of points lying directly above and below the interval. This is akin to specifying the location of an airplane in terms of the ground over which the plane is flying. The control space of a region on the ground is a vertical strip of air directly above that region.
To give you a feel for this, the program colors these strips in pastel colors. Of course, like any graphing program, first you must put the function into the program. When you first do this, you see the graph of the function over the entire window. However, when you view the function along with the others, you see only the part of the graph that appears within the originally specified strip. Do you know how the program achieves this? It gives the function only values of x that are wThis program draws the graph one strip at a time, using a different function to determine the heights of the graph for each strip. Kids, don't try this at home. Wait a minute, you're not kids and so you must try this at home. Use the tables that I have shown you in class. Make an x column with lots of values, but arranged in increasing order. Make a different y column for each of the functions in your graph. Here's an important step: divide the table into horizontal strips, according to which x values go with which function. The boundaries of these strips are found in the "if" statements in the definition of the function. They must also be used to determine which strips go with which function. At this point make sure that each strip has a reasonable number of x values in it. Consider the following piecewise function:(http://kerbaugh.uncfsu.edu/piecewise/piecewise_function.gif)
http://kerbaugh.uncfsu.edu/piecewise/piecewise.html