Piecewise Functions
What You’ll Learn
Section titled “What You’ll Learn”In this lesson you’ll learn what piecewise functions are, how to read and evaluate them, and how to graph simple piecewise functions.
The Concept
Section titled “The Concept”A piecewise function is a function defined by different rules for different parts of its domain. It is written with multiple pieces separated by “if” conditions.
Example:
This means:
- When x is less than 0, use the rule 2x + 1
- When x is greater than or equal to 0, use the rule x²
To evaluate a piecewise function:
- Look at the given x-value.
- Decide which piece (condition) it satisfies.
- Use that rule to calculate the output.
Worked Example
Section titled “Worked Example”Given:
The graph shows the two pieces of this function. The blue line is 3x + 5, which applies when x < 2. The orange line is −x + 8, which applies when x ≥ 2. At x = 2, the blue piece has an open dot (not included) and the orange piece has a closed dot (included). This tells you which rule to use at the boundary.
The dashed vertical line at x = 2 marks where the function switches from one rule to the other.
Notice the dots at x = 2. The open circle (hollow dot) on the blue line at (2, 11) means that point is not included. The first piece only applies when x is strictly less than 2. The closed circle (filled dot) on the orange line at (2, 6) means that point is included. The second piece handles x = 2.
This connects directly to the interval notation we learned in the Domain and Range lesson. An open circle on a graph matches a parenthesis ( ) in interval notation, meaning the endpoint is excluded. A closed circle matches a bracket [ ], meaning the endpoint is included. So the blue piece covers the interval (−∞, 2) and the orange piece covers [2, ∞).
1. Find f(1)
Since 1 < 2, use the first piece: f(1) = 3(1) + 5 = 8.
2. Find f(4)
Since 4 ≥ 2, use the second piece: f(4) = −4 + 8 = 4.
3. Find f(2)
Since 2 ≥ 2, use the second piece: f(2) = −2 + 8 = 6.
Real-World Application
Section titled “Real-World Application”Piecewise functions are very common in real life:
- Cell phone plans: first 500 minutes are 0.10 dollars each, then 0.05 dollars each after that.
- Taxes: different tax brackets apply to different income levels.
- Shipping costs: 5 dollars for the first 5 pounds, then 1.50 dollars per additional pound.
- Utility bills: base charge plus different rates depending on how much electricity or gas you use.
- Overtime pay: regular rate up to 40 hours, then 1.5× rate after 40 hours.
Example: a parking garage charges 8 dollars for the first hour and 3 dollars for each additional hour. This can be written as a piecewise function.
Use this function for questions 1 and 2: