Concept understanding — Piecewise Function Evaluation
Piecewise Function Evaluation
Imagine a restaurant that charges by the time of day: breakfast before 11 AM, lunch till 4 PM, dinner after that. The price depends entirely on when you walk in. That is exactly a piecewise function — one function that uses different rules on different parts of its domain.
The intuition
A plain function like f(x)=x2 applies the same rule to every x. A piecewise function instead says: if x is in this interval use Rule A; if it is in that interval use Rule B. To evaluate it you first decide where your input lives, then apply only the rule for that region.
The precise form
f(x)=⎩⎨⎧x+2,3,x2,x<00≤x<5x≥5
Each line pairs a rule (what to compute) with a condition (when to use it).
Watch out
The conditions should be mutually exclusive (no overlap) and should cover every input (no gaps). Where no condition holds, the function is undefined.
How to evaluate
Check the conditions top to bottom and use the first one that is true. Boundary points are decided by whether the inequality includes equality.
f(−2): is −2<0? Yes ⇒x+2=0.
f(0): not <0; is 0≤0<5? Yes ⇒3.
f(7): not <0, not <5; is 7≥5? Yes ⇒72=49.
Notice x=0 lands in the second case because that case includes equality (0≤x), while the first uses strict x<0. …