If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

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)=3ln(x) on the interval [2,8].
Here's how that looks in a diagram when we call the first trapezoid T1, the second trapezoid T2, and the third trapezoid T3:
Recall that the area of a trapezoid is h(b1+b22) where h is the height and b1 and b2 are the bases.

Finding the area of T1

We need to think about the trapezoid as if it's lying sideways.
The height h is the 2 at the bottom of T1 that spans x=2 to x=4.
The first base b1 is the value of 3ln(x) at x=2, which is 3ln(2).
The second base b2 is the value of 3ln(x) at x=4, which is 3ln(4).
Here's how all of this looks visually:
Let's put this all together to find the area of T1:
T1=h(b1+b22)
T1=2(3ln(2)+3ln(4)2)
Simplify:
T1=3(ln(2)+ln(4))

Finding the area of T2

Let's find the height and both of the bases:
h=2
b1=3ln(4)
b2=3ln(6)
Plug in and simplify:
T2=3(ln(4)+ln(6))

Find the area of T3

T3=
Choose 1 answer:

Finding the total area approximation

We find the total area by adding up the area of each of the three trapezoids:
Total area=T1+T2+T3
Here's the final simplified answer:
Total area=3(ln2+2ln4+2ln6+ln8)
You should pause here and walk through the algebra to make sure you understand how we got this!

Practice problem

Choose the expression that uses four trapezoids to approximate the area under the function f(x)=2ln(x) on the interval [2,8].
Choose 1 answer:

Challenge problem

Choose the expression that uses three trapezoids to approximate the area under the function f on the interval [1,5].
Choose 1 answer:

Want to join the conversation?

  • blobby green style avatar for user Chris Benjamin
    In the answers for every problem why is everything but the first and last term times 2? Why isn't everything times 2?
    (20 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user stevenking450
      The first and last terms are the outer bases of the trapezoids on each end of the graph, whereas the inner terms are the bases of the two trapezoids either side of the term. So when you sum the areas of all the trapezoids you can simplify by saying 2 times the inner terms, rather than adding them twice.
      (63 votes)
  • blobby green style avatar for user Bashir Alam
    Is there any formula to find the error? like the trapezoid method gives us approximate area, so can we have some solutions to find the range for this approximation?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • duskpin ultimate style avatar for user kathrynjade777
    So I'm learning Numerical Integration. It is part of numerical integration? Is the Trapezoid Rule a derivation of Riemann's Sums?
    (0 votes)
    Default Khan Academy avatar avatar for user
  • leafers seedling style avatar for user colinhill
    I'm a little bit confused, not on how to answer these problems, but on why we are deciding to learn trapezoidal approximation.

    I understand learning rectangular summation because that is what integrals are based on, but why trapezoidal? Couldn't we just learn to integrate and get an even better answer? I think that I'm probably just missing something.
    (1 vote)
    Default Khan Academy avatar avatar for user
    • male robot donald style avatar for user Venkata
      Thing is, we won't always know the equation of the curve to just integrate it. There are cases where we model data, get a graph and it doesn't resemble any of your "special curves". In such cases, approximations are the best way to find the area, and the better the approximation, the closer you are to the true value.
      (6 votes)
  • aqualine tree style avatar for user Rafael Nadal
    Where is he getting the ln(x) from?
    (0 votes)
    Default Khan Academy avatar avatar for user
  • orange juice squid orange style avatar for user Quasar
    It looks like there might be an error in the solution for the second last problem. In the working out for T3 it shows:

    T3 = (1/2)(2ln(5)+2ln(6.5))*(3/2) = (3/2)(ln(5)+3ln(6.5))

    But that 3 in front of the ln(6.5) on the RHS of the equation shouldn't be there, should it?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user lizloveslife
    the last question I don't understand how its plus two on each interval and where that came from? also, why is it only on the first and second intervals where we add the two and not the last two?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • female robot grace style avatar for user $160,000,000
    Isn't the trapezoidal sum the same as the average of right and left Riemann sums?
    (2 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user gunank312
    Is the question, or it’s working correct?

    We want to find 3 trapezoidal sums total from 0 to 6 of function (x-3)^2 , answer is 22 in the practice questions, my doubt is why did we add rectangle in the middle from 2 to 4, as they are distinct shapes?

    Thanks
    (1 vote)
    Default Khan Academy avatar avatar for user
  • duskpin ultimate style avatar for user Rishabh
    From the different Riemann sum methods (Left, Right, Midpoint, Trapezoid), would the Trapezoidal sums be the most accurate?
    It seems like they would be, unless there are other methods that I'm not aware of?
    (1 vote)
    Default Khan Academy avatar avatar for user