3H

The trapezoidal rule

Approximating a definite integral with the trapezoidal rule using equally spaced function values, and using concavity to decide whether the estimate is too big or too small.

The rule

Many functions have no simple primitive, and sometimes you only have a table of values. Joining neighbouring points with straight lines turns the region into trapezia, whose areas are easy to add.

Trapezoidal rule ($n$ subintervals)
$$\int_a^b f(x)\,dx \approx \frac{h}{2}\Big(y_0 + 2\big(y_1 + y_2 + \dots + y_{n-1}\big) + y_n\Big), \quad h = \frac{b - a}{n}$$
Example 1●

Use the trapezoidal rule with $2$ subintervals to estimate $\displaystyle\int_0^2 x^2\,dx$.

$h = 1$, and the values are $0, 1, 4$.
$\tfrac12\big(0 + 2 \times 1 + 4\big) = 3$.
Example 2: a table●●

Estimate $\displaystyle\int_0^4 f(x)\,dx$ from this table.

$x$01234
$f(x)$35642
$h = 1$: $\tfrac12\big(3 + 2(5 + 6 + 4) + 2\big) = \tfrac12 \times 35 = 17.5$.

Too big or too small?

Example 3●●

Estimate $\displaystyle\int_0^4 \sqrt{x}\,dx$ with $4$ subintervals and compare with the exact value.

$h = 1$: $\tfrac12\big(0 + 2(1 + \sqrt2 + \sqrt3) + 2\big) \approx 5.146$.
Exact: $\Big[\tfrac23 x^{\frac32}\Big]_0^4 = \tfrac{16}{3} \approx 5.333$. The estimate is too small, because $y = \sqrt{x}$ is concave down.
Flashcards
Trapezoidal rule
$\dfrac{h}{2}\big(\text{first} + 2 \times \text{middles} + \text{last}\big)$
Concave up
The rule overestimates.
Concave down
The rule underestimates.
Practice
  1. Use $2$ subintervals to estimate $\displaystyle\int_0^2 x^2\,dx$.

  2. Use the table in Example 2 to estimate $\displaystyle\int_0^4 f(x)\,dx$.

  3. Use $1$ subinterval to estimate $\displaystyle\int_0^1 x^3\,dx$.

  4. Use $2$ subintervals to estimate $\displaystyle\int_0^1 x^3\,dx$.

  5. Find $h$ for $\displaystyle\int_1^5 f(x)\,dx$ with $4$ subintervals.

  6. How many function values are needed for $6$ subintervals?

  7. Estimate $\displaystyle\int_0^4 \sqrt{x}\,dx$ with $4$ subintervals, to 2 decimal places.

  8. $f$ is concave up on $[a, b]$. The trapezoidal rule gives:

  9. The trapezoidal rule is exact when $f$ is:

More questions

New numbers every time. Keep going until you get five in a row.

Formula sheet