Concept understanding — Piecewise Function Definition
What is a Piecewise Function? — The Intuition
Imagine you're describing how much a taxi ride costs. The fare might be: ₹25 for the first kilometer, then ₹15 for every kilometer after that. That's not a single, simple rule — the rule changes depending on how far you've gone. That's exactly what a piecewise function captures: a function whose rule is made of different "pieces," each applying to a different part of the input.
In everyday life, piecewise rules are everywhere:
Income tax slabs (different rates for different income ranges)
Mobile data plans (different speeds after a limit)
Postage rates (different costs for different weights)
A piecewise function lets you write all these different rules in one clean mathematical statement.
The Precise Definition
A piecewise function is a function defined by multiple sub-functions, each applying to a specific interval (or "piece") of the domain.
Here's the standard notation:
f(x)=⎩⎨⎧f1(x),f2(x),⋮fn(x),x∈D1x∈D2⋮x∈Dn
Where:
f1,f2,…,fn are the sub-functions (each is a rule)
D1,D2,…,Dn are disjoint intervals that together cover the entire domain
Each input x belongs to exactly one of these intervals
Important
A piecewise function is still one function — not several functions glued together. For every x in the domain, there is exactly one output f(x).
A Concrete Example
Let's write the taxi fare example properly. Suppose the first kilometer costs ₹25, and every subsequent kilometer costs ₹15 per km. For a ride of x kilometers:
f(x)={25,25+15(x−1),0<x≤1x>1
Let's test it:
For x=0.5 km: f(0.5)=25 (first piece)
For x=1 km: f(1)=25 (first piece, includes the endpoint)
For x=3 km: f(3)=25+15(3−1)=25+30=55 (second piece)
Notice how the second piece uses x−1 — that's because the ₹15 rate only applies to the distance beyond the first kilometer.
Common Pitfalls (Watch Out!)
Watch out
Don't forget the domain conditions. A piecewise definition is incomplete without specifying which x values go with which rule. Writing just f(x)={x2,2x+1} is meaningless — you must say when each applies.
Watch out
Check the boundaries carefully. At the point where two pieces meet (like x=1 in the taxi example), the function must give only one output. If both pieces try to claim the same x, you have a problem — it's no longer a function.
The absolute-value function f(x)=∣x−2∣+∣2+x∣ changes behaviour at the critical points x=−2 and x=2, where each absolute value switches sign. Breaking the domain into three regions and simplifying yields a piecewise-linear function with minimum value 4 at all points in [−2,2].
The key to understanding any function built from absolute values is recognising that ∣u∣ is really a piecewise definition: it equals u when u≥0 and −u when u<0. The function switches its formula at the zeros of the expressions inside the absolute values.
Here we have two absolute values: ∣x−2∣ changes at x=2, and ∣2+x∣=∣x+2∣ changes at x=−2. These critical points divide our domain [−3,3] into three intervals, and on each interval both expressions have constant sign, so we can drop the absolute value bars.
Finding the piecewise formula
Region I: −3≤x<−2
When x<−2, we have x−2<0 (so ∣x−2∣=−(x−2)=2−x) and x+2<0 (so ∣x+2∣=−(x+2)=−x−2).
f(x)=(2−x)+(−x−2)=−2x
Region II: −2≤x≤2
When −2≤x≤2, we have x−2≤0 (so ∣x−2∣=2−x) and x+2≥0 (so ∣x+2∣=x+2).
f(x)=(2−x)+(x+2)=4
Region III: 2<x≤3
When x>2, both x−2>0 (so ∣x−2∣=x−2) and x+2>0 (so ∣x+2∣=x+2).
Same / Similar Concept — real previous-year questions on the same or a closely similar concept, not this exact question.
AP EAPCET 2026Set eng-2026-05-12-FN1 markMCQ
Q.[x] represents the greatest integer less than or equal to x.
If a function f:R→N is defined by f(x)=[x]2+[x]+1, then {x∈R/f−1(7)=x}=
(A) [2,3) only
(B) [0,7)
(C) [−3,3)−[−2,2)
(D) [−4,4]−[−3,−2)
›Reveal solutionSolution
Solving [x]2+[x]+1=7 gives [x]=2 or [x]=−3, i.e. x∈[2,3)∪[−3,−2), which is exactly the set difference [−3,3)−[−2,2).
Concept and Intuition
Since [x] (the greatest-integer / floor function) is always an integer, an equation in [x] is first solved as an ordinary quadratic in the integer variable n=[x]; each valid integer root n=k then corresponds to the whole interval x∈[k,k+1), because [x]=k exactly on that half-open interval.
Step-by-Step Solution
Let n=[x] (an integer). The equation becomes n2+n+1=7, i.e. n2+n−6=0.
Factor: (n−2)(n+3)=0⇒n=2 or n=−3. Both are integers, so both are valid values of [x].
[x]=2⇔2≤x<3, i.e. x∈[2,3).
[x]=−3⇔−3≤x<−2, i.e. x∈[−3,−2).
So the full solution set is [−3,−2)∪[2,3).
Compare with the options: [−3,3)−[−2,2) means "all x with −3≤x<3, except those with −2≤x<2", which leaves precisely [−3,−2)∪[2,3) — an exact match. …
Q.Let g(x)=1+x−[x] and f(x)=⎩⎨⎧−1,0,1,x<0x=0x>0, [x] denotes the greatest integer less than or equal to x. Then for all x, f(g(x))=
(A) 1
(B) x
(C) f(x)
(D) g(x)
›Reveal solutionSolution
g(x)=1+{x} is always in [1,2), i.e. always strictly positive, no matter what x is. Since f maps every positive input to 1, the composition f(g(x)) is constantly 1. Answer: 1.
Concept and Intuition
[x] is the greatest-integer (floor) function, so x−[x]={x} is the fractional part of x, which by definition always lies in [0,1) — it can never be negative and never reach 1.
g(x)=1+x−[x]=1+{x} is therefore always shifted into the range [1,2): it is never zero or negative, for any real x (positive, negative, integer, or non-integer).
f is the sign-type function: f(t)=−1 if t<0, 0 if t=0, 1 if t>0. Since we only ever feed f a strictly positive number (namely g(x)), f always returns 1.
Step-by-Step Solution
Recall {x}=x−[x] satisfies 0≤{x}<1 for all real x (this is the definition/property of the floor function).
So g(x)=1+{x} satisfies 1≤g(x)<2 for every real x.
In particular, g(x)≥1>0 for all x — g(x) is never≤0. …
Q.If f(x) is the signum function, then in terms of f(x), the constant function g(x)=1,∀x∈R is
(A) g(x)={2−f(x),f(x),x<0x≥0
(B) g(x)={f(x)+f(−x),f(x)f(−x),x<0x≥0
(C) g(x)={1+f(x),1−f(x),x>0x≤0
(D) g(x)=⎩⎨⎧f(x)+2,1+f(x),f(x),x<0x=0x>0
›Reveal solutionSolution
Directly substituting the signum function's three cases into each option shows only option D gives g(x)=1 in every case.
Concept and Intuition
The signum function is f(x)=1 for x>0, f(x)=0 for x=0, f(x)=−1 for x<0. To find which piecewise expression built from f always equals the constant 1, substitute each branch of each option against the corresponding case(s) of x.
Step-by-Step Solution
Recall f(x): +1 for x>0; 0 for x=0; -1 for x<0.
Check option (D): g(x)=f(x)+2 for x<0; 1+f(x) for x=0; f(x) for x>0.
x<0: f(x)=-1, g=-1+2=1.
x=0: f(x)=0, g=1+0=1.
x>0: f(x)=1, g=1.
All branches give 1, so g(x)=1 for every real x. …
Q.If A is the domain and B is the range of the function f(x)={3x−1,x2+1,x>1x≤1, then A - B =
(A) (1,∞)
(B) (−∞,1)
(C) R−(−1,1)
(D) (−1,1)
›Reveal solutionSolution
The function is defined on all of ℝ, and its range works out to [1,∞); subtracting that from the domain leaves (−∞,1).
Concept and Intuition
For a piecewise function, the domain is simply everywhere at least one branch applies (here, every real number falls under either x>1 or x≤1, so the domain is all of ℝ). The range is the union of the images of each piece over its own restricted interval, which can require care since a parabola or line might not cover its "naive" range on a restricted domain.
Step-by-Step Solution
Domain: since "x>1" and "x≤1" partition ℝ completely, A = ℝ.
For x ≤ 1: g(x) = x² + 1. As x ranges over (−∞, 1], x² ranges over [0, ∞) (x can be any non-positive-or-small value including large negative x, and x=0 gives x²=0). So x²+1 ranges over [1, ∞).
For x > 1: h(x) = 3x − 1. As x → 1⁺, h(x) → 2⁺; as x → ∞, h(x) → ∞. So this piece covers (2, ∞). …
Q.The range of the function f(x)=⎩⎨⎧4x−1,x2−2,3x+4,x>3−2≤x≤3x<−2 is
(A) (−∞,∞)
(B) R−(−3,3)
(C) R−(7,11]
(D) (7,11]
›Reveal solutionSolution
Evaluate the range on each piece and take the union: the pieces cover everything except the interval (7,11], so the range is R−(7,11].
Concept and Intuition
For a piecewise function, the overall range is the union of the ranges attained on each piece. We just need to carefully find the range each branch sweeps out, paying attention to which endpoints are included (based on strict vs non-strict inequalities in the domain).
Step-by-Step Solution
Piece 1 (x>3): f(x)=4x−1 is increasing; as x→3+, f→4(3)−1=11 (not attained, since x>3 strictly), and as x→∞, f→∞. Range: (11,∞).
Piece 2 (−2≤x≤3): f(x)=x2−2. On this interval, x2 attains its minimum 0 at x=0 (included) and maximum 9 at x=3 (included, since ∣3∣>∣−2∣). Since the interval is connected and f continuous, x2 sweeps all of [0,9], so f(x)=x2−2 sweeps [−2,7].
Piece 3 (x<−2): f(x)=3x+4 is increasing; as x→−2−, f→3(−2)+4=−2 (not attained, strict inequality), and as x→−∞, f→−∞. Range: (−∞,−2). …