Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

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


Example

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

Image illustrating Piecewise Functions


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]



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



Blue Function:

y=x  where  −5≤x≤0y=x~~\text{where}~~-5\leq{x}\leq{0}


Green Function:

y=x2+10,≤x≤2y=x^2+1\quad0,\le x\le2


Purple Function:

y=5,3≤x≤10y=5,\quad3\le x\le10



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


f(x)={x;−5≤x≤0x2+1;0≤x≤25;3≤x≤10f(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}


Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Example: Piecewise Functions

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


Image illustrating Example


  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]

   {x∈R∣ −5≤x≤10}~~~\{x\in\mathbb{R}|~-5\leq{x}\leq{10}\}


Range:


   [0,4]~~~[0,4]

   {y∈R∣ 0≤y≤4}~~~\{y\in\mathbb{R}|~0\leq{y}\leq{4}\}


Part 2.

Blue Function:


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


Red Function:


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


Green Function:


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


Purple Function:


y=1;   6<x≤10y=1;~~~6<x\le10


Therefore,

f(x)={−12x;−5≤x≤0x;0 <x<3(x−5)2;3≤x≤61;6<x≤10f(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).

Illustration for practice question: Piecewise Functions

Select the following statements that are true about f(x)f(x).

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Extra Practice