Machine-translated by Google. Questions are authored in English.
Top

Discussion

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\)

  • A.The Simpson's rule
  • B.The trapezoidal rule
  • C.The composite Simpson's rule by dividing [-1, 2] into 4 equal subintervals
  • D.The composite trapezoidal rule by dividing [-1, 2] into 3 equal subintervals

Answer: D

The exact rule is the composite trapezoidal rule by dividing [-1, 2] into 3 equal subintervals.

\(f(x) = |x| + |x - 1| + |x - 2|\) is piecewise linear on [-1, 2], with corners only at \(x = 0\) and \(x = 1\). Dividing [-1, 2] into three equal parts puts the nodes at -1, 0, 1, 2, so on each subinterval \(f\) is linear and the trapezoidal rule is exact.

Check: \(f(-1) = 6, f(0) = 3, f(1) = 2, f(2) = 3\), so the composite rule gives \(\frac{1}{2}(6 + 3) + \frac{1}{2}(3 + 2) + \frac{1}{2}(2 + 3) = 9.5\), the exact integral. The single trapezoid and single Simpson's rule ignore the corners, and the four-subinterval Simpson's rule places nodes at -0.25 and 1.25 with panels straddling the corners, where a quadratic cannot match a kink.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.