Approximating an Integral with Rectangles

A rectangle rule multiplies a sampled function value by interval width and sums the contributions over subintervals.

Source
Anbloq
Language
English
Created
Updated
Chapters
4
Reading time
1 min
In this article4 chapters
  1. Trace a small calculation
  2. Interpret the error
  3. Use a monotone integrand to bracket its integral
  4. Keep the width factor with each evaluation

Trace a small calculation

For \(f(x)=x\) on \([0,2]\) split into unit intervals, left samples 0 and 1 yield area 1. Right samples 1 and 2 give 3. The exact integral is 2. Interval partitioning provides nonoverlapping intervals.

Interpret the error

On this increasing function the left samples underestimate and the right samples overestimate. Check the sampling convention before comparing results. See absolute error.[1][2]

Use a monotone integrand to bracket its integral

On \([0,2]\), use two width-one rectangles for \(f(x)=x\). The left heights are zero and one, giving total one. The right heights are one and two, giving three. The exact area is two. See trapezoidal integration.

Left: 1×0 + 1×1 = 1
Right: 1×1 + 1×2 = 3
Exact integral: 2
The increasing function lies between the two constant approximations

Keep the width factor with each evaluation

Unequal panels require different widths. A mean of heights alone has the wrong units for an area. Use monotonic reasoning only where the function maintains that property.

References

  1. Tobin A. Driscoll and Richard J. Braun, Fundamentals of Numerical Computation ↩
  2. Nicholas J. Higham, Accuracy and Stability of Numerical Algorithms ↩