# Understanding the trapezoidal rule

Walk through an example using the trapezoid rule, then try a couple of practice problems on your own.

By now you know that we can use Riemann sums to approximate the area under a function. Riemann sums use rectangles, which make for some pretty sloppy approximations. But what if we used trapezoids to approximate the area under a function instead?

**Key idea:**By using trapezoids (aka the "trapezoid rule") we can get more accurate approximations than by using rectangles (aka "Riemann sums").

# An example of the trapezoid rule

Let's check it out by using three trapezoids to approximate the area under the function $f(x) = 3 \ln(x)$ on the interval $[2, 8]$.

Here's how that looks in a diagram when we call the first trapezoid $T_1$, the second trapezoid $T_2$, and the third trapezoid $T_3$:

Recall that the area of a trapezoid is $h \left(\dfrac{b_1 + b_2}{2}\right)$ where $h$ is the height and $b_1$ and $b_2$ are the bases.

## Finding the area of $T_1$

We need to think about the trapezoid as if it's lying sideways.

The height $h$ is the $2$ at the bottom of $T_1$ that spans $x = \greenD 2$ to $x = \maroonD 4$.

The first base $b_1$ is the value of $3 \ln(x)$ at $x = \greenD 2$, which is $3 \ln (\greenD 2)$.

The second base $b_2$ is the value of $3 \ln(x)$ at $x = \maroonD 4$, which is $3 \ln (\maroonD 4)$.

Here's how all of this looks visually:

Let's put this all together to find the area of $T_1$:

Simplify:

## Finding the area of $T_2$

Let's find the height and both of the bases:

Plug in and simplify:

## Find the area of $T_3$

## Finding the total area approximation

We find the total area by adding up the area of each of the three trapezoids:

Here's the final simplified answer:

*You should pause here and walk through the algebra to make sure you understand how we got this!*