0:00 / 0:00

Piecewise Functions

A piecewise function is a function composed of 2 or more functions with restricted domains.

The notation used for a piecewise function is displayed below:
f(x)={Piece OnePiece TwoPiece Three...f(x)=\begin{cases} \text{Piece~One}\\ \text{Piece Two}\\ \text{Piece Three...} \end{cases}
where each piece of f(x) represents a function and its domain.

A continuous piecewise function means:
  • The function is continuous over the entire domain
  • You do not have to lift your pencil from the paper in order to sketch its graph
  • The output values on the boundary points are equivalent
A discontinuous piecewise function means:
  • The function has discontinuities (holes, gaps, breaks, asymptotes) over the domain
  • You have to lift your pencil from the paper in order to sketch its graph
  • The output values on the boundary points are not equivalent

PAGE BREAK
Example
The following piecewise function, f(x), is graphed below:

There are 2 discontinuities:
  • x=0x=0
  • x(2,3)x\in(2,3)

The domain of the function is:
[5,0]  [0,2]  [3,10][-5,0]~\cup~[0,2]~\cup~[3,10]

PAGE BREAK

The function f(x) can be expressed as 3 separate functions with restricted domains.


Blue Function:
y=x  where  5x0y=x~~\text{where}~~-5\leq{x}\leq{0}

Green Function:
y=x2+10,x2y=x^2+1\quad0,\le x\le2

Purple Function:
y=5,3x10y=5,\quad3\le x\le10


Therefore, the blue, green, and purple function can be expressed as a piecewise function, f(x):

f(x)={x;5x0x2+1;0x25;3x10f(x) = \begin{cases}x;& -5\leq{x}\leq{0}\\ x^2+1;& 0\leq{x}\leq{2}\\ 5;&3\leq{x}\leq{10} \end{cases}

0:00 / 0:00

Example: Piecewise Functions

The function, f(x),f(x), is graphed below.


  1. Find:
  2. Any discontinuities for f(x).f(x).
  3. The domain and range for f(x)f(x)

  1. Find a piecewise function that describes f(x).f(x).

Part 1.

a. There is only one discontinuity at x=3.x=3.

b. Domain:

   [5,10]~~~[-5,10]
   {xR 5x10}~~~\{x\in\mathbb{R}|~-5\leq{x}\leq{10}\}

Range:

   [0,4]~~~[0,4]
   {yR 0y4}~~~\{y\in\mathbb{R}|~0\leq{y}\leq{4}\}

Part 2.

Blue Function:

y=12x;   5x0y=-\frac{1}{2}x;~~~-5\leq{x}\leq{0}

Red Function:

y=x;   0<x<3y=x;~~~0<x<3

Green Function:

y=(x5)2;   3x6y=(x-5)^2;~~~3\leq{x}\leq{6}

Purple Function:

y=1;   6<x10y=1;~~~6<x\le10

Therefore,
f(x)={12x;5x0x;0 <x<3(x5)2;3x61;6<x10f(x)= \begin{cases} -\frac{1}{2}x;&-5\leq{x}\leq{0}\\\\ x;&0\ <{x}<{3}\\\\(x-5)^2;&3\leq{x}\leq6\\\\1;&6<{x}\leq{10} \end{cases}
Note that there are a few different ways we could have chosen to include the endpoints on some of these domains while still being correct, as the points at x=0x=0 and x=6x=6 will remain the same whichever function is used.
The graph shown below is the graph of the piecewise function f(x)f(x).
Select the following statements that are true about f(x)f(x).

Practice: Piecewise Functions

Lynn plans on selling hats at a fundraiser. The wholesale hat company charges Lynn $10 a hat for the first 75 hats. After the first 75 hats purchased up to 150 hats, the price of the hat drops by $2.50/hat. After Lynn purchases 150 hats, the price will decrease to $5/hat.

Determine a function that models this situation.

Practice: Piecewise Functions

What value of 'a' would make the following piecewise function continuous?
f(x)={3x2+4;x<25x+a;x2f(x)=\begin{cases} 3x^2+4;&x<-2\\ 5x+a;&x\geq-2 \end{cases}

Extra Practice