If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

# Worked example: graphing piecewise functions

A piecewise function is a function that is defined in separate "pieces" or intervals. For each region or interval, the function may have a different equation or rule that describes it. We can graph a piecewise function by graphing each individual piece.

## Want to join the conversation?

• At the blue and purple lines join at a point. How do you know whether to make that point an open circle or a closed circle, if they were different inequalities? Does it always just become coloured in? •  Christopher,
You asked an excellent question. In the video, Sal did not stress why he filled in the circle, probably because he assumed this had been covered in another video.

I'll try to explain it.

When Sal did the first interval, at , he left the circle not filled in at (-2,5) because the second sign was > and not ≤. But then Sal did the next interval at the same point at (-2,5) was calculated, but this time the ≤ was used in the first part of the interval. Because this included being "equal to", the circle was then filled in.

Had the second interval been x+7, -2 *<* x < -1, neither interval would have had a closed circle at (-2,5), so the point would have had an open circle.

As each interval is worked, the circle is either filled in or left open If the same point is first left open, but in the next interval, it should be filled in, it is filled in. However, if the problem had been different, and the point was filled in on the first interval, but the same point would have normally been not filled in on the next interval, it still remains filled in.

I hope that helps make it click for you.
• Does this mean that you can make the graphs of functions I've seen that bump up and down using this? Is there anything else? Thx • what should I do if the equation says f(x) = (bracket) 3 if x< 2. what should I do with the 3? where can I plug in the 2? • are the lines not always straight? • Do you write the x and y points in the order of which line is the highest on the graphs? • mmk, but what if there's no "x" in the first part of the equation? (for example if it was just 7 instead of "x+7") • at how do you know if the blue and purple lines are closed or open circles. • When writing a piecewise function that doesn't have any jumps, would it be possible to say that a value could equal both equations? Like (in the video) the first equation and the second equation when -2 is the input, they give the same output. So when writing, would it be possible to write -10≤x≤-2 and -2≤x<-1 ? Or would I have to lock -2 into a single equation? • If the top equation say x is less than -2, why does sal graph on -2
(1 vote) • He puts an open circle on -2 which means it goes right up to -2 but never quite reaches it. If you are only thinking whole numbers, then -3 makes sense, but if you can go all the way to -2.00000000000001 (or if you wanted to add any number of zeroes before the 1), there is no way to graph numbers so close to 2, but we can open a circle at 2 which says 2 does not count, but we can get as close to 2 as we want. 