What is a function (quick reminder)?
A function is a rule that takes an input (usually ) and gives exactly one output (usually ).
Example:
f(x)=2x
If x=3, then f(3)=6
What does “piecewise” mean?
Piecewise means “made of pieces.”
A piecewise function uses different rules depending on the value of xx.
Instead of one formula, you have multiple formulas, each used on a specific interval.
How piecewise functions are written
They usually look like this:
{2x+1 if x<0
f(x)=
{x^2 if x≥0
This means:
-
If is less than 0, use 2x+1
-
If is 0 or greater, use x^2
How to evaluate a piecewise function
Step 1: Look at the value of x
Step 2: Decide which rule applies
Step 3: Plug into that rule
Example:
Find f(−2
Since −2<0, use:
2x + 1 = 2(-2) + 1 = -3
So, f(-2) = -3
Why piecewise functions exist
They’re used when:
-
Rules change (tax brackets, phone plans, shipping costs)
-
Graphs behave differently in different regions
-
Real-world situations aren’t “one-rule-fits-all”