How to graph a piecewise function and write its equation from a graph

A piecewise function can change rules when we cross a certain x-value. Let’s look at what happens on either side of that value and use the open and filled dots to decide what happens right at it.

Match each rule to the x-values where it applies

Read each row as an instruction. Use the expression on the left when x satisfies the condition on the right. A strict inequality leaves the endpoint out. A condition that includes equality assigns the value at the endpoint.

f(x)={x2x<38x=32x+4x>3

Draw the parabola only to the left of x=3. It approaches (3,9). Draw the line only to the right of x=3. It approaches (3,10). Mark those endpoints with open circles, then fill in the dot at (3,8) because f(3)=8.

A parabola and a line with a separate value at x = 3The left piece is the parabola y equals x squared. The right piece is a rising line. At x equals three, open circles are at heights nine and ten and a filled circle is at eight.−23574812(3, 8)(3, 9)(3, 10)xy
At x = 3 only the filled dot, (3, 8), is part of the graph.

Read a rule from each piece of a continuous graph

A rising line connects two horizontal piecesThe left segment has height negative three. The middle segment connects negative two, negative three, to two, two. The right segment has height two.−4−224−32(−2, −3)(2, 2)xy
The middle line joins the horizontal pieces at (−2, −3) and (2, 2).

The left piece stays at -3 and the right piece stays at 2. Between them, the line rises from (-2,-3) to (2,2). Its slope is the change in y over the change in x.

m=2-(-3)2-(-2)=54

Substitute (2,2) into y=mx+b to get 2=(5/4)(2)+b, so b=-1/2. Let the middle rule include both endpoints. It gives the same heights where it meets the two horizontal pieces.

f(x)={-3x<-254x-12-2≤x≤22x>2

Read the separate value at a jump

A graph with three different heights at the breakpointThe parabola approaches two, four from the left. The descending line approaches two, six from the right. A filled dot at two, eight gives the value there.−22468268(2, 4)(2, 6)(2, 8)(−2, 4)(8, 0)xy
The open circles mark the endpoints each branch approaches. The filled dot gives f(2) = 8.

The left piece follows the basic parabola y=x2. It passes through (-2,4) and approaches (2,4). The right piece approaches (2,6) and passes through (8,0). Use those two points to find the slope of the right-hand line, even though its endpoint is open.

m=0-68-2=-1

Using (8,0) gives 0=-8+b, so the line is y=-x+8. At x=2 use the filled point (2,8) for the function value.

f(x)={x2x<28x=2-x+8x>2