Midpoint Rule

Summary

The composite midpoint rule approximates abf(x)dx by summing rectangle areas with heights evaluated at subinterval midpoints. It is a second-order method for smooth integrands.

Prerequisites

Problem Type

Approximate I=abf(x)dx from samples of f .

Method Definition

Partition [a,b] into n equal parts of width h=(ba)/n . On [xi1,xi] with midpoint mi=xi1+h/2 ,

xi1xif(x)dxhf(mi).

Composite rule:[1]

abf(x)dxhi=1nf(a+(i12)h).

Assumptions / Requirements

Algorithm

  1. Choose n , set h=(ba)/n .
  2. Sum hf(a+(i1/2)h) for i=1,,n .

Error / Accuracy

If |f(x)|M on [a,b] , the composite midpoint error satisfies

|E|(ba)24h2M=(ba)324n2M.

Order O(h2) , same order as the composite trapezoidal rule (with a smaller constant for many f ).

Worked Example

Approximate 01x2dx=1/3 with n=2 ( h=1/2 ).

Midpoints: 1/4 , 3/4 .

I12((1/4)2+(3/4)2)=12(116+916)=516=0.3125.

Error |1/35/16|=1/480.0208 . Bound with f=2 , M=2 :

(1)32442=148,

sharp on this example.

Common Failure Modes

Connections

References


  1. Burden & Faires, Numerical Analysis, midpoint / rectangle rules; NIST DLMF Ch. 3, https://dlmf.nist.gov/3 ↩︎