Step by step
The question
Question: graph f(x): −2 if x < −1, x if −1 ≤ x < 2, 4 if x ≥ 2.
This is a piecewise function.
It has 3 rules.
Which rule we use depends on x.
Each x uses only one rule.
Careful!
At an edge, look at the sign.
Less than or greater than: the edge is not in, an open dot.
With "or equal to": a filled dot.
1 Make a table
Each rule gets its own x's, in its own colour.
The edges we work out with both rules that meet there: it shows where each piece ends.
2 Draw the grid
Draw the grid.
3 Draw the first piece
−2 is for x less than −1.
Plot its points.
At the edge −1: −1 is not in, so an open dot at (−1, −2).
Join them with a flat line, only for these x's.
It keeps going on the open side.
4 Draw the second piece
x is for x from −1 to 2.
Plot its points.
At the edge −1: −1 is in, so a filled dot at (−1, −1).
At the edge 2: 2 is not in, so an open dot at (2, 2).
Join them with a straight line, only for these x's.
5 Draw the third piece
4 is for x greater than or equal to 2.
Plot its points.
At the edge 2: 2 is in, so a filled dot at (2, 4).
Join them with a flat line, only for these x's.
It keeps going on the open side.
6 Check
Let's check the edge x = −1.
Every x has only one y, so only one dot there can be filled.
−1 belongs to the second rule.
f(−1) = −1: the filled dot (−1, −1).
It works!
Let's look back.
First: make a table.
Then: draw the grid.
Then: draw the first piece.
Then: draw the second piece.
Then: draw the third piece.
Last: check.