Piecewise and Step Functions
Overview
Piecewise functions are functions that have different expressions for different parts of their domain. They are commonly used to describe situations where a rule or pattern changes depending on the input value.
Piecewise Function
A piecewise function is defined by multiple sub-functions, each applying to a specific interval of the domain. It can be written as:
\( f(x) = \{ \)
expression 1, for \( x < a \)
expression 2, for \( a \leq x < b \)
expression 3, for \( x \geq b \)
\( \} \)
The function changes its behavior at certain values of \( x \), which are often referred to as breakpoints or transition points.
Example of a Piecewise Function
Consider the following piecewise function:
\( f(x) = \{ \)
\( x + 2 \), for \( x < 0 \)
\( 2x - 1 \), for \( 0 \leq x < 3 \)
\( x - 1 \), for \( x \geq 3 \)
\( \} \)
This function behaves differently in three different intervals of \( x \): for \( x < 0 \), the function is \( x + 2 \); for \( 0 \leq x < 3 \), it is \( 2x - 1 \); and for \( x \geq 3 \), it is \( x - 1 \).
Step Function
A step function is a type of piecewise function where the graph consists of horizontal line segments, often used to model situations where something remains constant for a given range of values and then "jumps" to a new value. Step functions are often represented by the greatest integer function.
Example of a Step Function
Consider the step function \( f(x) = \lfloor x \rfloor \), where \( \lfloor x \rfloor \) represents the greatest integer less than or equal to \( x \). The graph of this function consists of horizontal steps, with the value of the function jumping to the next integer as \( x \) increases.
Graphing Piecewise Functions
To graph a piecewise function, you need to plot each sub-function on the appropriate interval and connect the pieces. Be sure to pay attention to whether the function is defined at the boundary points, and whether there are open or closed circles at the endpoints.
Example: Graphing a Piecewise Function
Consider the piecewise function:
\( f(x) = \{ \)
\( 2x + 1 \), for \( x < 1 \)
\( -x + 3 \), for \( 1 \leq x < 4 \)
\( x - 2 \), for \( x \geq 4 \)
\( \} \)
To graph this function, plot each piece on its respective domain:
- For \( x < 1 \), plot the line \( y = 2x + 1 \) up to \( x = 1 \).
- For \( 1 \leq x < 4 \), plot the line \( y = -x + 3 \) from \( x = 1 \) to \( x = 4 \).
- For \( x \geq 4 \), plot the line \( y = x - 2 \) starting at \( x = 4 \).
Practice Questions
- Given the piecewise function:
\( f(x) = \{ \)
\( x - 2 \), for \( x < 0 \)
\( 3x + 1 \), for \( 0 \leq x < 5 \)
\( 2x - 1 \), for \( x \geq 5 \)
\( \} \)
Graph the function and identify any jumps or discontinuities.Solution
To graph the function:
- For \( x < 0 \), plot the line \( y = x - 2 \) with an open circle at \( x = 0 \).
- For \( 0 \leq x < 5 \), plot the line \( y = 3x + 1 \) from \( x = 0 \) to \( x = 5 \), including a closed circle at \( x = 0 \) and an open circle at \( x = 5 \).
- For \( x \geq 5 \), plot the line \( y = 2x - 1 \), starting from \( x = 5 \).
- Write the piecewise function for the following graph:
- For \( x < 2 \), the function is the line \( y = -x + 4 \).
- For \( 2 \leq x < 5 \), the function is a horizontal line at \( y = 2 \).
- For \( x \geq 5 \), the function is the line \( y = x - 3 \).
Solution
The piecewise function is:
\( f(x) = \{ \)
\( -x + 4 \), for \( x < 2 \)
\( 2 \), for \( 2 \leq x < 5 \)
\( x - 3 \), for \( x \geq 5 \)
\( \} \)
- Given the step function \( f(x) = \lfloor x \rfloor \), determine the value of \( f(3.7) \), \( f(-1.2) \), and \( f(5) \).
Solution
For the greatest integer function \( f(x) = \lfloor x \rfloor \):
- For \( f(3.7) \), the greatest integer less than or equal to 3.7 is 3.
- For \( f(-1.2) \), the greatest integer less than or equal to -1.2 is -2.
- For \( f(5) \), the greatest integer less than or equal to 5 is 5.
- Consider the function \( f(x) = \lfloor 2x \rfloor \). What is \( f(3.1) \), \( f(-2.3) \), and \( f(0.5) \)?
Solution
For \( f(x) = \lfloor 2x \rfloor \):
- For \( f(3.1) \), \( 2 \times 3.1 = 6.2 \), and the greatest integer less than or equal to 6.2 is 6.
- For \( f(-2.3) \), \( 2 \times -2.3 = -4.6 \), and the greatest integer less than or equal to -4.6 is -5.
- For \( f(0.5) \), \( 2 \times 0.5 = 1.0 \), and the greatest integer less than or equal to 1.0 is 1.
- Sketch the graph of the piecewise function:
\( f(x) = \{ \)
\( 3x + 1 \), for \( x < 2 \)
\( x^2 \), for \( 2 \leq x < 4 \)
\( 5 - x \), for \( x \geq 4 \)
\( \} \)
Solution
The graph consists of three parts:
- For \( x < 2 \), plot the line \( y = 3x + 1 \).
- For \( 2 \leq x < 4 \), plot the curve \( y = x^2 \).
- For \( x \geq 4 \), plot the line \( y = 5 - x \).