The trapezoidal rule approximates a definite integral by fitting a trapezoid under the curve: T = (h/2)(f(a) + f(b)), h = b - a. Example: f(x)=x², [0,1] gives T=1/2; true value=1/3, error=1/6.

The true integral of x^n over [a,b] is (b^(n+1)-a^(n+1))/(n+1), always rational for integer endpoints and non-negative integer n.

Example

Use endpoint heights to estimate an integral with one trapezoid.

highlighted = computed this step

Step 1 — Set up

Set up the interval for the trapezoidal rule.

f(x)=x2[0,1]f(x)= x^{2} \quad [ 0 , 1 ]

Step 2 — Endpoint values

Compute h and the endpoint function values.

h=1f(a)=0f(b)=1h= \hl{1} \quad f(a)= \hl{0} \quad f(b)= \hl{1}

Step 3 — Trapezoid estimate

Apply one trapezoid to get the estimate.

T=12(0+1)=12T= \frac{1}{2} ( 0 + 1 )= \hlmath{\frac{1}{2}}

Step 4 — Result

State the trapezoidal estimate.

T=12T= \hlmath{\frac{1}{2}}
trapezoidal-rule For a single panel over [a,b] with h=b-a: T = (h/2)(f(a) + f(b))