## Building a piecewise office from its graph

In this lesson nosotrosâ€™ll look at piecewise-defined functions and how to write the equation of the definition of such a function given its graph.

A piecewise-divers part (also called a piecewise part) is a function thatâ€™s made upwards of different â€śpieces,â€ť each of which has its own â€śsub-functionâ€ť (its own algebraic expression) and its own â€śsub-domainâ€ť (its ain part of the domain of the entire piecewise part).

Weâ€™ll telephone call the â€śsub-functionâ€ť for each piece the
function
for that piece. A piecewise function is divers by giving the algebraic expression for the office for each piece and its domain. The domain of a piece of a piecewise office can be either an interval or simply a single bespeak.

The definition of a piecewise function is written in this class:

Of class a piecewise office doesnâ€™t need to have four pieces. Information technology can take anywhere from two pieces to an infinite number of pieces. Ordinarily, there are simply two or three.

Letâ€™s wait at an example of a definition of a piecewise function and how to graph the function.

To graph a piecewise part, you graph each piece on its domain. Letâ€™s start by graphing the piece with function ???x^two??? and domain ???x<3???, which is (role of) a parabola that opens upwards and has its vertex at the origin.

The domain of the next piece is simply ???10=3???, and weâ€™re given that ???f(iii)=8???, so weâ€™ll plot the point ???(three,8)???. For our graph to be the graph of a function, we canâ€™t have 2 or more points with the same value of ???x???, and so weâ€™ll need to describe an open circle at the â€ścorrect ceaseâ€ť of the parabola, that is, at the signal with ???ten=three???, which has coordinates ???(3,3^two)???, or ???(3,9)???, to show that the betoken ???(3,9)??? isnâ€™t a point of the graph of this piecewise function.

Next we demand to graph the piece with office ???2x+4??? and domain ???x>3???, which is (part of) a line. When nosotros graph this piece of the function, weâ€™ll need to draw an open circumvolve at the bespeak of this line with ???x=3???, which has coordinates ???(3,2(3)+4)???, or ???(iii,10)???, because it isnâ€™t a indicate of the graph of this piecewise function.

You tin can as well write the equation of a piecewise function when youâ€™re given a graph.

## Defining the piecewise function

Case

What is the definition of the piecewise function shown in the graph?

Weâ€™ll work on the graph from left to right. The horizontal line on the left has a ???y???-value of ???-3??? and includes all values of ???x??? in the interval ???x<-2??? (all real numbers ???x??? that are less than ???-2???). For this slice, we write ???-3??? for the function (the constant function whose value is ???-iii???) and ???ten<-2??? for its domain.

The slanted line has a slope of ???5/4??? and a ???y???-intercept of ???-1/2???. To run across how to get the gradient, observe that the points ???(-two,-3)??? and ???(2,2)??? are on this line, then

???y=\frac{5}{4}10-\frac{i}{2}???

For this slice, we write

???f(x)=\frac{5}{4}x-\frac{1}{2}???

for the function and ???-ii\le x\le two??? for its domain.

The horizontal line on the correct has a ???y???-value of ???2??? and includes all values of ???10??? in the interval ???x>two???. For this piece, we write ???2??? for the part and ???x>2??? for its domain.

Putting the iii pieces together, we define this piecewise function as follows:

???f(x) = \begin{cases} -3 & \quad x < -2 \\ \frac{5}{four}x-\frac12 & \quad -ii \leq ten \leq two\\ 2 & \quad ten > two \terminate{cases}???

You might wonder how we decide which piece of this office gets the ???\le??? or ???\ge??? sign and which piece gets the ???<??? or ???>??? sign. The truth is that it doesnâ€™t thing, every bit long as each ???ten??? in the domain of the entire piecewise function is included in the domain of exactly 1 of its pieces – and, of course, that the function for that piece gives the correct value of ???f(x)???. You lot could write it this mode, too:

???f(x)=\begin{cases}-iii & \quad x \leq -2 \\\frac{5}{iv}x-\frac{1}{two} & \quad -2 < x <ii\\two & \quad ten \geq ii\end{cases}???

But information technology could not exist written as

???f(x)=\begin{cases}-3 & \quad ten \leq -2 \\\frac{five}{4}x-\frac{1}{two} & \quad -2 \leq x \leq 2\\ii & \quad 10 \geq 2\end{cases}???

considering here ???-2??? is included in the domains of two different pieces of the role, and so is ???two???.

Instance

What is the definition of the piecewise function shown in the graph.

Going from left to right, the first role of the graph is (part of) the parabola ???y=10^two???, which has its vertex at the origin. (To meet that ???y=ten^2??? is the equation of this parabola, note that information technology passes through the point ???(-2,4)??? and that ???4=(-2)^2???.) Thus the role for this slice is ???x^2???, and its domain is ???10<2???.

The second part of the graph is the point ???(ii,8)???, so the function for this slice is ???8??? and its domain is ???ten=2???.

The last part of the graph is part of the line ???y=-x+8???. To see this, weâ€™ll first compute the gradient from the points ???(8,0)??? and ???(two,6)???, both of which are on this line. Then weâ€™ll use the gradient and the point ???(8,0)??? to go the indicate-slope form of the equation of the line (and then use that to go the slope-intercept form). The slope is

???grand =\frac{6-0}{2-8} =\frac{half-dozen}{-half-dozen} =-1???

The point-slope course of the equation of a line is

???y-y_1=m(ten-x_1)???

Using ???(x_1,y_1)=(8,0)??? and the fact that ???m=-1???, nosotros get

???y-0=-ane(x-8)???

???y=-x+8???

Therefore, the function for the final piece is ???-x+eight??? and its domain is ???x>2???.

Putting the 3 pieces together, we define this piecewise office equally follows: