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. …
Same / Similar Concept — real previous-year questions on the same or a closely similar concept, not this exact question.
CBSE 2020Set 65/3/11 markMCQ
Q.If f and g are two functions from R to R defined as f(x)=∣x∣+x and g(x)=∣x∣−x, then fog(x) for x<0 is (A) 4x (B) 2x (C) 0 (D) −4x
›Reveal solutionSolution
For x<0, the composition f(g(x)) simplifies to −4x: g(x)=−2x becomes positive, and f doubles that positive input, giving f(g(x))=2(−2x)=−4x.
The key to this problem is understanding how the absolute value function behaves for negative inputs, and then carefully tracking what happens inside the composition.
Concept and intuition:
Both f and g are built from ∣x∣ and x. For x<0, ∣x∣=−x. This lets us rewrite f and g piecewise. The composition f(g(x)) means we first apply g to x, get some output, and then feed that output into f. The trick is that g(x) for x<0 turns out to be positive, so when we apply f, we must use the branch of f that handles positive inputs.
Let's work it out step by step.
Simplify g(x) for x<0.
For x<0, ∣x∣=−x. So
g(x)=∣x∣−x=(−x)−x=−2x.
Since x<0, −2x is positive. So g(x)>0 for all x<0.
Simplify f(x) for positive inputs.
For any t>0, ∣t∣=t. So
f(t)=∣t∣+t=t+t=2t.
This is the branch of f we will use, because g(x) is positive.
Compose: f(g(x)) for x<0.
Since g(x)=−2x and −2x>0, we have
f(g(x))=f(−2x)=2×(−2x)=−4x. …