Piecewise-Defined Functions
Sometimes a function is defined by different formulas on different parts of its domain. A function with this property is known as a piecewise-defined function.
piecewise-defined function
A piecewise-defined function is composed of several sub-functions, each with its own formula and domain. These segments work together to form a complete function.
The absolute value function is an example of a piecewise-defined function because the formula changes with the sign of [latex]x[/latex]:
Other piecewise-defined functions may be represented by completely different formulas, depending on the part of the domain in which a point falls.
Graphing Piecewise-Defined Functions
To graph a piecewise-defined function, we graph each part of the function in its respective domain, on the same coordinate system. If the formula for a function is different for [latex]x < a[/latex] and [latex]x > a[/latex], we need to pay special attention to what happens at [latex]x=a[/latex] when we graph the function. Sometimes the graph needs to include an open or closed circle to indicate the value of the function at [latex]x=a[/latex].
How to: Given a Piecewise Function, Sketch a Graph.
- Split the function into its parts, one for each interval.
- Plot each section on the graph within its designated interval.
- Use open or closed circles to indicate whether the endpoints are included (closed) or excluded (open) for each interval.
- Check for smooth transitions or intentional breaks between the function’s pieces. Make sure the points where the function changes are correct and that the graph matches the function’s rules for those spots.
Sketch a graph of the following piecewise-defined function:
[latex]f(x)=\begin{cases} x+3, & x < 1 \\ (x-2)^2 & x \ge 1 \end{cases}[/latex]
In a big city, drivers are charged variable rates for parking in a parking garage. They are charged [latex]$10[/latex] for the first hour or any part of the first hour and an additional [latex]$2[/latex] for each hour or part thereof up to a maximum of [latex]$30[/latex] for the day. The parking garage is open from 6 a.m. to 12 midnight.
- Write a piecewise-defined function that describes the cost [latex]C[/latex] to park in the parking garage as a function of hours parked [latex]x[/latex].
- Sketch a graph of this function [latex]C(x)[/latex].