Calculus / AI

Trapezoidal Rule

Approximate area under a curve using trapezia of equal width.

Formula

The trapezoidal rule approximates \(\int_a^b y\,dx\) using straight-line segments between points.

\[ \int_a^b y\,dx \approx \frac{h}{2}\left(y_0+2y_1+2y_2+\cdots+2y_{n-1}+y_n\right) \]

Here \(h=\frac{b-a}{n}\).

trapezia approximate the area
The approximation improves when the strips are narrower.

Worked example

Use 4 strips to estimate \(\int_0^2(x^2+1)\,dx\).

  1. \(h=0.5\).
  2. Values: \(1,1.25,2,3.25,5\).
  3. \[A\approx\frac{0.5}{2}(1+2(1.25)+2(2)+2(3.25)+5)=4.75.\]

Trapezoidal rule

Watch on this page.

Trapezoidal rule worked example

Watch on this page.