A piecewise function is evaluated by determining which part of the function applies to the given input value, then using that rule to calculate the output. Instead of having one single formula for every possible input, a piecewise function uses different formulas for different intervals of the domain. Learning how to evaluate a piecewise function is important because these functions appear in algebra, calculus, real-world modeling, computer programming, economics, physics, and many other fields.
What Is a Piecewise Function?
A piecewise function is a function defined by multiple sub-functions, where each sub-function applies to a specific part of the domain. The domain is the set of all possible input values, usually written as (x)-values. Each piece of the function has its own condition Nothing fancy..
Quick note before moving on.
For example:
[ f(x)= \begin{cases} x+3, & x<2 \ x^2, & x\geq 2 \end{cases} ]
This function has two pieces:
- (f(x)=x+3) when (x<2)
- (f(x)=x^2) when (x\geq 2)
To evaluate the function, you first decide which condition the input value satisfies. Then you plug that input into the matching rule.
Introduction to Evaluating Piecewise Functions
Evaluating a function means finding the output value for a given input. For a regular function like:
[ f(x)=2x+5 ]
you can substitute any value of (x) into the same formula. But with a piecewise function, you cannot always use the same formula. Each input value belongs to a certain interval, and only the matching piece is used Worth keeping that in mind..
As an example, if:
[ f(x)= \begin{cases} x+3, & x<2 \ x^2, & x\geq 2 \end{cases} ]
then:
- (f(1)) uses (x+3), because (1<2)
- (f(3)) uses (x^2), because (3\geq 2)
- (f(2)) uses (x^2), because (2\geq 2)
The key idea is simple: find the correct rule first, then substitute the input value.
Step-by-Step Steps for Evaluating a Piecewise Function
Step 1: Look at the Input Value
Start with the value being evaluated. If you are asked to find (f(4)), the input value is (4). If you are asked to find (f(-1)), the input value is (-1) Worth knowing..
Step 2: Compare the Input to Each Condition
Next, compare the input value to the conditions listed in the piecewise function. Conditions may include inequalities such as:
- (x<3)
- (x\geq 3)
- (x\leq -2)
- (-1<x\leq 5)
Pay close attention to whether the inequality includes the endpoint. Take this: (x<3) does not include (3), but (x\leq 3) does include (3).
Step 3: Choose the Correct Piece
Once you know which condition the input satisfies, choose the formula attached to that condition. This is the formula you will use to evaluate the function.
Step 4: Substitute and Simplify
Substitute the input value into the correct formula. Then simplify using normal order of operations Easy to understand, harder to ignore..
Step 5: Check for Endpoints
Endpoint values are especially important in piecewise functions. A value like (x=4) might satisfy one condition but not another. To give you an idea, if the function says (x<4) for one piece and (x\geq 4) for another, then (f(4)) must use the second piece.
Short version: it depends. Long version — keep reading The details matter here..
Example 1: Evaluating a Simple Piecewise Function
Suppose:
[ f(x)= \begin{cases} 2x+1, & x<0 \ x^2-4, & x\geq 0 \end{cases} ]
Find (f(-3)).
Since (-3<0), use the first piece:
[ f(x)=2x+1 ]
Substitute (-3):
[ f(-3)=2(-3)+1 ]
[ f(-3)=-6+1=-5 ]
So:
[ f(-3)=-5 ]
Now find (f(2)).
Since (2\geq 0), use the second piece:
[ f(x)=x^2-4 ]
Substitute (2):
[ f(2)=2^2-4 ]
[ f(2)=4-4=0 ]
So:
[ f(2)=0 ]
Example 2: Evaluating at an Endpoint
Consider:
[ g(x)= \begin{cases} x+5, & x<1 \ 3x-2, & x\geq 1 \end{cases} ]
Find (g(1)) The details matter here..
The input value is (1). Check the conditions:
- (x<1)
- (x\geq 1)
Since (1<1) is false, the first piece does not apply. Since (1\geq 1) is true, the second piece applies That's the whole idea..
Use:
[ g(x)=3x-2 ]
Substitute (1):
[ g(1)=3(1)-2 ]
[ g(1)=3-2=1 ]
So:
[ g(1)=1 ]
This example shows why endpoint symbols matter. The value (1) belongs to the second piece because the condition includes equality Which is the point..
Example 3: Evaluating a Function with Three Pieces
Now consider a more complicated example:
[ h(x)= \begin{cases} x+4, & x<-2 \ x^2, & -2\leq x<3 \ 5, & x\geq 3 \end{cases} ]
Find each value.
Find (h(-4))
Since (-4<-2), use the first piece:
[ h(x)=x+4 ]
[ h(-4)=-4+4=0 ]
So:
[ h(-4)=0 ]