Open Newton-Cotes and midpoint

Open rules that avoid the endpoints of the interval, with special attention to the simple and composite midpoint rule.

Why they are open

Open formulas use only interior nodes. They are useful when the endpoints are not defined, are singular, or have not been measured.

Open ruleSimple approximationLeading error
Punto medio(b-a) f((a+b)/2)(b-a)^3 f''(xi)/24
Dos nodos interiores(b-a)/2 [f((2a+b)/3)+f((a+2b)/3)]3h^3 f''(xi)/4, h=(b-a)/3
Tres nodos interiores(b-a)/3 [2f((3a+b)/4)-f((a+b)/2)+2f((a+3b)/4)]14h^5 f^(4)(xi)/45, h=(b-a)/4

Simple midpoint

The simple midpoint rule replaces the curve by a rectangle whose height is measured at the centre of the interval. It uses one function value, not the endpoints.

abmf(m)(b-a) f(m)function fmidpoint
The approximation is the area of the rectangle with base bab-a and height f(m)f(m), where m=(a+b)/2m=(a+b)/2.
Expand diagram

The approximation is the area of the rectangle with base bab-a and height f(m)f(m), where m=(a+b)/2m=(a+b)/2.

Direct derivation
  1. Define the midpoint of the interval:

    m=a+b2m=\frac{a+b}{2}
  2. Approximate f(x)f(x) by the constant f(m)f(m) on all of [a,b][a,b]:

    abf(x)dxabf(m)dx\int_a^b f(x)\,dx\approx\int_a^b f(m)\,dx
  3. Since f(m)f(m) does not depend on xx, it factors out and leaves the rectangle area:

    M1=(ba)f ⁣(a+b2)M_1=(b-a)f\!\left(\frac{a+b}{2}\right)
  4. If fC2[a,b]f\in\mathcal{C}^2[a,b], the exact error has positive sign under the convention E=IM1E=I-M_1:

    EM=abf(x)dxM1=(ba)324f(ξ)E_M=\int_a^b f(x)\,dx-M_1=\frac{(b-a)^3}{24}f''(\xi)

Composite midpoint

To use midpoint on n subintervals, split [a,b] with step h=(ba)/nh=(b-a)/n and evaluate the function at the centre of each subinterval. This notation does not require n to be even.

width hx₀x₁x₂x₃xₙm₀m₁m₂mᵢheights f(m_i)
Composite midpoint sums rectangles of width hh. Each height is f(mi)f(m_i), with mim_i at the centre of its subinterval.
Expand diagram

Composite midpoint sums rectangles of width hh. Each height is f(mi)f(m_i), with mim_i at the centre of its subinterval.

Derivation for n subintervals
  1. Take the partition nodes and the centre of each subinterval:

    xi=a+ih,mi=xi+xi+12=a+(i+12)hx_i=a+ih,\qquad m_i=\frac{x_i+x_{i+1}}{2}=a+\left(i+\frac12\right)h
  2. On the subinterval [xi,xi+1][x_i,x_{i+1}], use the simple midpoint rule:

    Mi=hf(mi)M_i=h f(m_i)
  3. The composite rule is the sum of all rectangles:

    Mn=hi=0n1f(mi)=hi=0n1f ⁣(a+(i+12)h)M_n=h\sum_{i=0}^{n-1}f(m_i)=h\sum_{i=0}^{n-1}f\!\left(a+\left(i+\frac12\right)h\right)
  4. Summing the local errors h3f(ξi)/24h^3 f''(\xi_i)/24 gives the global error:

    EM=h324i=0n1f(ξi)=ba24h2f(ξ)E_M=\frac{h^3}{24}\sum_{i=0}^{n-1}f''(\xi_i)=\frac{b-a}{24}h^2f''(\xi)

Derivations

DerivationDerivation: simple midpointView as its own page →
abmf(m)(b-a) f(m)function fmidpoint
The base is bab-a and the height is taken at m=(a+b)/2m=(a+b)/2.
Expand diagram

The base is bab-a and the height is taken at m=(a+b)/2m=(a+b)/2.

Rule and error
  1. Define the centre of the interval:

    m=a+b2m=\frac{a+b}{2}
  2. Approximate the function by the constant f(m)f(m):

    abf(x)dxabf(m)dx\int_a^b f(x)\,dx\approx\int_a^b f(m)\,dx
  3. Since f(m)f(m) is constant with respect to xx, the integral is base times height:

    M1=(ba)f(m)=(ba)f ⁣(a+b2)M_1=(b-a)f(m)=(b-a)f\!\left(\frac{a+b}{2}\right)
  4. The linear Taylor term around mm contributes no net area by symmetry. The first remaining term depends on ff'':

    abf(x)dxM1=(ba)324f(ξ)\int_a^b f(x)\,dx-M_1=\frac{(b-a)^3}{24}f''(\xi)
DerivationDerivation: composite midpointView as its own page →
width hx₀x₁x₂x₃xₙm₀m₁m₂mᵢheights f(m_i)
Each rectangle has width hh and height f(mi)f(m_i).
Expand diagram

Each rectangle has width hh and height f(mi)f(m_i).

Formula for n subintervals
  1. Split [a,b][a,b] with step hh:

    xi=a+ih,h=banx_i=a+ih,\qquad h=\frac{b-a}{n}
  2. The centre of the subinterval [xi,xi+1][x_i,x_{i+1}] is:

    mi=xi+xi+12=a+(i+12)hm_i=\frac{x_i+x_{i+1}}{2}=a+\left(i+\frac12\right)h
  3. Apply simple midpoint on each subinterval:

    Mi=hf(mi)M_i=h f(m_i)
  4. Sum all rectangles:

    Mn=hi=0n1f(mi)M_n=h\sum_{i=0}^{n-1}f(m_i)
  5. Substituting the expression for mim_i gives the computable form:

    Mn=hi=0n1f ⁣(a+(i+12)h)M_n=h\sum_{i=0}^{n-1}f\!\left(a+\left(i+\frac12\right)h\right)
  6. The global error is obtained by summing the local errors of the simple midpoint rule:

    EM=h324i=0n1f(ξi)=ba24h2f(ξ)\begin{aligned}E_M&=\frac{h^3}{24}\sum_{i=0}^{n-1}f''(\xi_i)\\&=\frac{b-a}{24}h^2f''(\xi)\end{aligned}