3. The value of the integral
∫04 (x − f(x)) dx
where the function f(x) is defined as:
f(x) =
⎧ 0, 0 ≤ x < 1
⎪ 1, 1 ≤ x < 2
⎪ 2, 2 ≤ x < 3
⎪ 3, 3 ≤ x < 4
⎩ 4, 4 ≤ x < 5
is:
(A) 2
(B) 1
(C) −1
(D) −2
Evaluate ∫₀⁴(x − f(x)) dx for a Piecewise Function: Detailed Solution
Correct Option: (A) 2
Understanding the Given Piecewise Function and Integral
The problem asks us to evaluate the definite integral ∫04(x − f(x)) dx, where f(x) is a piecewise constant function. The important feature of this question is that the value of f(x) changes whenever x crosses an integer. Therefore, we cannot treat f(x) as one single constant throughout the interval from 0 to 4.
On the interval 0 ≤ x < 1, the function value is 0. On the next interval 1 ≤ x < 2, the function value becomes 1. Similarly, it is 2 on the interval from 2 to 3 and 3 on the interval from 3 to 4. Thus, the function remains constant within each unit interval but jumps by 1 at every integer.
The given function behaves like the greatest integer function or floor function, commonly written as ⌊x⌋. Therefore, throughout the interval of integration,
f(x) = ⌊x⌋
and the integrand x − f(x) represents the fractional part of x. However, the problem can be solved directly from the given piecewise definition without requiring any special knowledge of the floor function.
Splitting the Integral According to the Piecewise Function
Since the value of f(x) changes at x = 1, x = 2, and x = 3, the original definite integral should be divided into four separate integrals. Thus,
∫04(x − f(x)) dx
=
∫01(x − 0) dx
+
∫12(x − 1) dx
+
∫23(x − 2) dx
+
∫34(x − 3) dx
This interval-wise form makes the problem much easier to understand. In every unit interval, the expression x − f(x) starts from 0 and increases linearly toward 1. As a result, each of the four integrals has exactly the same value.
Evaluating the Integral from 0 to 1
For 0 ≤ x < 1, we have f(x) = 0. Therefore, the integrand becomes x − 0 = x, and the first part of the integral is:
∫01 x dx
=
[x2/2]01
= 1/2 − 0
= 1/2
Thus, the contribution from the first interval is 1/2.
Evaluating the Integral from 1 to 2
For 1 ≤ x < 2, the function value is f(x) = 1. Therefore, the second integral becomes:
∫12(x − 1) dx
The antiderivative of x − 1 is x2/2 − x. Hence,
∫12(x − 1) dx
=
[x2/2 − x]12
= (2 − 2) − (1/2 − 1)
= 1/2
Therefore, the second interval also contributes 1/2 to the total integral.
Evaluating the Integral from 2 to 3
For 2 ≤ x < 3, we have f(x) = 2. Therefore,
∫23(x − 2) dx
Using the substitution u = x − 2, the limits change from u = 0 to u = 1. Therefore,
∫01 u du
=
[u2/2]01
= 1/2
Once again, the contribution from this unit interval is 1/2.
Evaluating the Integral from 3 to 4
For 3 ≤ x < 4, the function value is f(x) = 3. Hence, the final part of the integral is:
∫34(x − 3) dx
Using u = x − 3, the interval again becomes 0 to 1. Therefore,
∫01 u du
=
1/2
Thus, all four unit intervals contribute equally to the value of the definite integral.
Adding the Values of All Four Integrals
We have found that each of the four intervals contributes 1/2. Therefore, the total value of the integral is:
∫04(x − f(x)) dx
=
1/2 + 1/2 + 1/2 + 1/2
= 2
Therefore, the value of the given definite integral is 2, and the correct answer is Option (A).
Alternative Method Using the Linearity of Integration
The same problem can also be solved by separating the original integral into two parts. Using the linearity property of definite integrals,
∫04(x − f(x)) dx
=
∫04x dx
−
∫04f(x) dx
First, evaluate the integral of x:
∫04x dx
=
[x2/2]04
= 16/2
= 8
Now consider the integral of f(x). Since f(x) is constant on each unit interval,
∫04f(x) dx
=
(0 × 1) + (1 × 1) + (2 × 1) + (3 × 1)
= 0 + 1 + 2 + 3
= 6
Therefore,
∫04(x − f(x)) dx
=
8 − 6
= 2
This alternative method is shorter and confirms the result obtained by direct interval-wise integration.
Geometrical Interpretation of the Integral
The expression x − f(x) has the same pattern in every unit interval. Between 0 and 1, it is simply x. Between 1 and 2, it becomes x − 1. Between 2 and 3, it becomes x − 2, and between 3 and 4, it becomes x − 3.
In each interval, the graph rises linearly from a height of 0 toward a height of 1. The area under the graph over each unit interval is therefore the area of a right triangle with base 1 and height 1:
Area = 1/2 × base × height
= 1/2 × 1 × 1
= 1/2
There are four identical unit intervals between 0 and 4. Therefore, the total area is:
4 × 1/2 = 2
This geometrical interpretation provides another clear explanation for why the value of the definite integral is 2.
Detailed Explanation of Every Option
Option (A): 2
Option (A) is correct. The interval from 0 to 4 contains four unit intervals, and on each interval the function x − f(x) has the same integral value of 1/2. Therefore, the total integral is 4 × 1/2 = 2. The same result is obtained by calculating ∫04x dx − ∫04f(x) dx = 8 − 6 = 2.
Option (B): 1
Option (B) is incorrect. A value of 1 does not account for the contribution from all four unit intervals. Each interval contributes 1/2, and there are four such intervals. Adding only two of these contributions would give 1, but the complete interval of integration extends from 0 to 4.
Option (C): −1
Option (C) is incorrect. Throughout each interval, x is greater than or equal to the corresponding value of f(x), so x − f(x) is non-negative. Therefore, the definite integral, which represents the accumulated area under this non-negative function, cannot have a negative value.
Option (D): −2
Option (D) is incorrect. The magnitude 2 appears in the correct calculation, but the negative sign is impossible because x − f(x) remains non-negative throughout the interval from 0 to 4. The total area under the graph is therefore positive and equal to 2.
Final Answer
The piecewise function takes the values 0, 1, 2, and 3 on four consecutive unit intervals between 0 and 4. On each interval, the integral of x − f(x) is equal to 1/2. Therefore, adding the four equal contributions gives:
∫04(x − f(x)) dx = 4 × 1/2 = 2
Correct Option: (A) 2


