Q.25
The value of the integral ∫ (𝑥 − 𝑓(𝑥))
4
0 𝑑𝑥, where 𝑓(𝑥) =
{
0, 0 ≤ 𝑥 < 1
1, 1 ≤ 𝑥 < 2
2, 2 ≤ 𝑥 < 3
3, 3 ≤ 𝑥 < 4
4, 4 ≤ 𝑥 < 5
, is
(A) 2 (B) 1 (C) −1 (D) −2
SEO-friendly introduction
For students preparing for competitive exams, problems on the value of the integral ∫₀⁴ (x − f(x)) dx where f(x) is a piecewise function are very common. Understanding how to split the integration range and treat each constant piece correctly ensures fast and accurate solutions under time pressure. This worked example shows each step, explains common mistakes behind the wrong options, and helps build strong intuition for similar integral questions in exams.[memory:1]
Question and function interpretation
The question is:
Find the value of the integral ∫₀⁴ (x−f(x)) dx where
f(x) = { 0, 0≤x<1
1, 1≤x<2
2, 2≤x<3
3, 3≤x<4
4, 4≤x<5 }
The integral is only from 0 to 4, so the last branch 4≤x<5 is not used.
To evaluate ∫₀⁴ (x−f(x)) dx, split it over the intervals where f(x) is constant:
∫₀⁴ (x−f(x)) dx = ∫₀¹ (x−0) dx + ∫₁² (x−1) dx + ∫₂³ (x−2) dx + ∫₃⁴ (x−3) dx.[memory:1]
Detailed computation
1. Interval 0≤x<1
Here f(x)=0, so the integrand is x−0=x.
∫₀¹ x dx = [x²/2]₀¹ = 1/2 − 0 = 1/2.
2. Interval 1≤x<2
Here f(x)=1, so the integrand is x−1.
∫₁² (x−1) dx = [x²/2 − x]₁² = (2−2) − (1/2−1) = 0 − (−1/2) = 1/2.
3. Interval 2≤x<3
Here f(x)=2, so the integrand is x−2.
∫₂³ (x−2) dx = [x²/2 − 2x]₂³ = (9/2−6) − (2−4) = (−3/2) − (−2) = 1/2.
4. Interval 3≤x<4
Here f(x)=3, so the integrand is x−3.
∫₃⁴ (x−3) dx = [x²/2 − 3x]₃⁴ = (8−12) − (9/2−9) = (−4) − (−9/2) = 1/2.
5. Total integral
∫₀⁴ (x−f(x)) dx = 1/2 + 1/2 + 1/2 + 1/2 = 4×1/2 = 2.
So the value of the integral is 2.[memory:1]
Explanation of each option
The options are:
- (A) 2 – Correct
Adding the exact area contributions from each interval gives 2, as shown above. Geometrically, on each interval of length 1, the function x−f(x) is a straight line starting from 0 and ending at 1, giving area 1/2 each time; four such intervals give total area 4×1/2=2.[memory:1] - (B) 1 – Incorrect
This value would arise if someone correctly computed 1/2 on two intervals but mistakenly assumed the other intervals contribute 0, or divided the correct sum 2 by the number of intervals (4). Since every interval contributes 1/2, the correct total cannot be 1.[memory:1] - (C) −1 – Incorrect
A negative result would require the integrand to be negative on average over [0,4]. Here, on each interval, x−f(x) goes from 0 to 1, so it is non-negative everywhere on [0,4]; therefore the integral must be non-negative. Hence −1 is impossible.[memory:1] - (D) −2 – Incorrect
This would suggest a large negative total area, which contradicts the fact that x−f(x)≥0 on the entire region of integration. All four pieces contribute positive area 1/2 each, so the integral cannot be negative at all.[memory:1]


