Let \( f(x) = |x| + |x - 1| + |x - 2|, \, x \in [-1, 2] \). Which one of the following numerical integration rules gives the exact value of the integral
\[
\int_{-1}^2 f(x) \, dx?
\]
Show Hint
For piecewise linear functions, composite trapezoidal rule with sufficient subintervals ensures exact integration.
The composite Simpson’s rule by dividing \( [-1, 2] \) into 4 equal subintervals
The composite trapezoidal rule by dividing \( [-1, 2] \) into 3 equal subintervals
Show Solution
Verified By Collegedunia
The Correct Option isD
Solution and Explanation
Step 1: Nature of \( f(x) \).
The function \( f(x) \) is piecewise linear, and the composite trapezoidal rule over 3 equal subintervals captures the exact integral.
Step 2: Application of the composite rule.
Dividing \( [-1, 2] \) into 3 equal parts ensures the exact value of the integral because \( f(x) \) is linear in each subinterval.
Step 3: Conclusion.
The correct numerical rule is \( {(4)} \).