Piecewise functions are no more complicated than normal functions. A piecewise function is called piecewise because it acts differently on different “pieces” of the number line. For example, consider this function:
This function has two parts. For all values of x that are 0 or less, we use the line y = x – 2. We stop at the point (0, -2) since for x-values greater than 0, we use a different line. For values of x that are strictly greater than 0, we use the line y = x+3. Here’s the graph of this function:
Here’s another example:
Now, since and , those endpoints (being the points (1, -1) and (2, 4) will be solid. The other, then, must be hollow. Here’s the graph of the function:
A good way to think about graphing piecewise functions is to divide the graph up into its different pieces in your head, and just graph each function individually. If we graphed the last one in this manner, we’d end up with these three steps:
Given the function , evaluate at the following values:
x=-1, 0, 1, 1.9, 2, 3
In order to do this, we must determine in which “piece” of the number line each value lies. Now, since -1, 0, 1, and 1.9 are all less than 2, we square each of those numbers. And, as 2 and 3 are greater than or equal to 2, their y-values both become -1.
And we’re done!
Graph the piecewise function
Since , we know that the solid point must go at . The rest of the graph will look like this:
Graph the piecewise function .
The graph looks like this: