MathorynMathematical Formula Database

Calculus

Trapezoidal Rule

The trapezoidal rule approximates a definite integral by splitting the interval into nn equal parts and replacing the curve with straight segments. It is used for numerical integration of tabulated data or functions without an elementary antiderivative.

∫abf(x) dx≈h2[f(x0)+2f(x1)+⋯+2f(xn−1)+f(xn)],h=b−an\int_a^b f(x)\,dx\approx\frac{h}{2}\left[f(x_0)+2f(x_1)+\cdots+2f(x_{n-1})+f(x_n)\right],\quad h=\frac{b-a}{n}
LaTeX\int_a^b f(x)\,dx\approx\frac{h}{2}\left[f(x_0)+2f(x_1)+\cdots+2f(x_{n-1})+f(x_n)\right],\quad h=\frac{b-a}{n}

Variables

a, ba,\ b
limits of integration
nn
number of subintervals
hh
step width
xix_i
nodes a+iha+ih

Example

Approximate ∫02x2 dx\int_0^2x^2\,dx with n=4n=4.

  1. h=0.5h=0.5; values 0, 0.25, 1, 2.25, 40,\ 0.25,\ 1,\ 2.25,\ 4.
  2. 0.52[0+2(0.25+1+2.25)+4]=0.25⋅11\frac{0.5}{2}\left[0+2(0.25+1+2.25)+4\right]=0.25\cdot11.
  3. The exact value is 83≈2.6667\frac83\approx2.6667.

Answer: ≈2.75\approx2.75.

Related formulas