|
|
The Trapezoidal Rule

You have likely already read our Forming Riemann Sums article, looking at how we can use them to estimate the area under the curve. As a refresher, a Riemann sum divides the area under the curve into rectangles and sums the area of each rectangle to approximate the area under the curve. But do we always have to use rectangles when approximating areas? Of course not!

Mockup Schule

Explore our app and discover over 50 million learning materials for free.

The Trapezoidal Rule

Illustration

Lerne mit deinen Freunden und bleibe auf dem richtigen Kurs mit deinen persönlichen Lernstatistiken

Jetzt kostenlos anmelden

Nie wieder prokastinieren mit unseren Lernerinnerungen.

Jetzt kostenlos anmelden
Illustration

You have likely already read our Forming Riemann Sums article, looking at how we can use them to estimate the area under the curve. As a refresher, a Riemann sum divides the area under the curve into rectangles and sums the area of each rectangle to approximate the area under the curve. But do we always have to use rectangles when approximating areas? Of course not!

The Trapezoidal Rule is a form of Riemann's sum. However, the Trapezoidal Rule uses trapezoids rather than rectangles! Interestingly enough, using trapezoidal subregions to approximate the area is usually more exact than using rectangles. In this article, we'll explore the Trapezoidal Rule derivation, formula, and error. Finally, we'll apply the Trapezoidal Rule to some examples.

The Trapezoidal Rule Definition and Formula for Area

Before we get into how this technique is used in practice, let's define what this rule is!

The Trapezoidal Rule is an integral approximation technique that divides the area under the curve into little trapezoids. The area of each trapezoid is summed to approximate the total area under the curve.

Trapezoidal Rule area under the curve trapezoidal subregions StudySmarter

The Trapezoidal Rule estimates the area under the curve by dividing the region into trapezoidal subregions - StudySmarter Original

The area of a trapezoid is defined as

12×(distance between each base)×(sum of the length of each base)

Translating this formula to the above figure, we can say that the area of the left-most trapezoid is defined as

12×(x)×(f(x0)+f(x1))=x2×fx0+fx1

Similarly, the formula for the area of the 2nd left-most trapezoid is defined as

12×x×fx1+fx2=x2×fx1+fx2

The formula for the area of each trapezoid is formulated the same way. The Trapezoidal Rule states that we can estimate the area under the curve by summing the area of each of these trapezoids. The Trapezoidal Rule is derived by factoring out x2 and adding up the length of each base, where fx1 through fxn-1 are multiplied by a factor of two because they are bases shared by other trapezoids.

Then, for approximating the definite integral of a function f(x), the Trapezoidal Rule states

abf(x)dxx2f(x0)+2f(x1)+2f(x2)+...+2f(xn-1)+f(xn)

where n is the number of trapezoids, x=b-an, and xi=a+ix.

As the number of trapezoidal subregions n approaches infinity, the right-hand side of the Trapezoidal Rule approaches the definite integral on the left side. In other words, the integral approximation gets more accurate as n gets larger.

Over and Underestimating using the Trapezoidal Rule

Look at the graph under the Trapezoidal Rule definition again. Notice how some of the trapezoidal subregions stay under the graph while other subregions stick out over the graph. When the graph is "concave up" (the graph bends upwards), the subregions tend to overestimate the area under the curve.

When the graph is "concave down" (the graph bends downwards), the subregions tend to underestimate the area under the curve. Based on a function's concavity, we can use this observation to tell whether the Trapezoidal Rule will overestimate or underestimate the area under the curve.

Below is a graphical example illustrating the difference between an overestimate and an underestimate.

Trapezoidal Rule difference between overestimate and underestimate on a graph StudySmarterNotice how the trapezoids extend above the function when there is an overestimation and sit below the function when there is an underestimation - StudySmarter Originals

The Trapezoidal Rule Error Bounds

As numerical integration techniques, like the Trapezoidal Rule, are an estimation, calculating the error of that estimation is incredibly important.

Relative error

Using common sense, we compute the relative error of a Trapezoidal Rule computation (given as a percentage) by using the relative error formula:

Relative error=approximation-actualactual×100%=Tn-abf(x)dxabf(x)dx×100%

where Tn is the Trapezoidal Rule approximation of the integral and abf(x)dx is the actual area.

We cannot always compute the integral of any function exactly! It may even be too difficult to approximate certain definite integrals (more on this in our university articles...). You can also see the deep dive in our Approximating Areas article for a sneak peek!

Absolute Error

In addition to relative error, the absolute error of our approximation using the trapezoidal rule can be calculated using the formula for absolute error:

Absolute error = approximation-actual=Tn-abf(x)dx

Error Bounds for the Trapezoidal Rule

We can use an error bound formula to tell us the maximum possible area of our approximation. For the Trapezoidal Rule, the error bound formula is

ETKb-a312n2 for f''(x)K

where ET is the exact error for the Trapezoidal Rule and f''(x) is the second derivative of f(x). Essentially, K is the maximum value of the second derivative on the interval [a, b].

The uses of the error bound will make more sense once we work through some examples.

Examples of Using the Trapezoidal Rule to Estimate the Integral

Example 1

Consider the function f(x)=1x on the closed interval [1, 3]. Use the Trapezoidal Rule to estimate the 131xdx using n = 4. Then, find n such that the error bound is 0.001 at most.

Let's graph f(x) to visualize the curve.

Trapezoidal Rule graph of 1/x with 4 subregions StudySmarterExample 1: Graph of 1/x - StudySmarter Original

Step 1: Find x

Plugging in our given interval and n subregions:

x=3-14=12

Step 2: Plug in known values to the Trapezoidal Rule Formula

From here, all we need to do is plug our known values into the Trapezoidal Rule formula. Since our interval is [1, 3] and the problem asks us to use n = 4, xi=1+i12 meaning each trapezoid has a width of 12 units.

131xdx122f(1)+2f(1.5)+2f(2)+2f(2.5)+f(3)=1411+21.5+22+22.5+13=146715=6760 units2

Step 3: Consider if our estimate is an over or underestimate

Looking at the graph of f, we can see that on the interval [1, 3] the graph is concave up, so our estimate is likely an overestimate.

Step 4: Consider the maximum error bound

Let's use our error-bound formula to see exactly how much of an overestimate our approximation is.

In the error-bound formula ET, our only unknown value is K. However, we can use the second derivative of f(x) to find K.

Since f(x)=1x, f'(x)=-1x2, f''(x)=2x3 using the Power Rule.

To find K, we have to consider where f''(x)=2x3 will be the largest on the interval [1, 3]. We know that minimizing x will maximize f''(x). So f''(x) is largest when x = 1.

f''(1)=213=2=K

Now that all the values of ET are known, we can simply plug in to find our bound.

ET2(3-1)312(4)2=16192=0.083

At most, the error of our estimation is 0.083.

Step 5: Find a minimum n such that the error is at most 0.001

To find the minimum n to ensure that the error is below 0.001, we let n be our unknown.

1612n20.00140003n236.5n

So, to ensure that our error is at most 0.001, we must use at least 37 trapezoidal subregions.

Example 2

Use the Trapezoidal Rule to approximate the area under the curve of f(x), which you should assume to be differentiable on [-3, 3], given in the table below with n = 6.

x-3-2-10123
f(x)0259142027

Step 1: Find x

Plugging in our given interval and n subregions:

x=3-(-3)6=1

Step 2: Plug in known values to the Trapezoidal Rule

From here, all we need to do is plug our known values into the Trapezoidal Rule formula. Since our interval is [-3, 3] and the problem asks us to use n = 6, xi=1+i meaning each trapezoid has a width of 1 unit.

-33f(x)dx12f(-3)+2f(-2)+2f(-1)+2f(0)+2f(1)+2f(2)+f(3)=120+2(2)+2(5)+2(9)+2(14)+2(20)+27=12127=63.5 units2

Step 3: Consider if our estimate is an over or underestimate

Though we don't have a graph of our function, close your eyes and try to visualize what this function might look like given the table of values. Given that all the values of the table are increasing over the domain and the rate at which the values are increasing is also increasing, we can assume that f(x) is concave up. Thus, we can make an informed guess that our approximation is likely an overestimate.

Without the function f(x), we cannot check the maximum error bound as we cannot take the 2nd derivative of a table of values.

Trapezoidal Rule vs. Simpson's Rule

Estimating areas using trapezoids and rectangles use straight lines on top of the shape. When reading the article on Simpson's Rule, you'll discover that we replace the straight lines in the trapezoids and rectangles with a curve (more specifically, a parabolic curve). More on this in the Simpson's Rule article!

The Trapezoidal Rule - Key takeaways

  • The Trapezoidal Rule is an integral approximation technique that divides the area under the curve into little trapezoids and sums the area of each trapezoid together to approximate the total area under the curve
  • For approximating the definite integral of a function f(x), the Trapezoidal Rule states
    abf(x)dxx2f(x0)+2f(x1)+2f(x2)+...+2f(xn-1)+f(xn)

    where n is the number of trapezoids, x=b-an, and xi=a+ix

  • When using the Trapezoidal Rule on a concave up function, the subregions tend to overestimate the area under the curve

  • When using the Trapezoidal Rule on a concave down function, the subregions tend to underestimate the area under the curve

  • We can use an error-bound formula to tell us the maximum possible error of our approximation

    • For the Trapezoidal Rule, the error bound formula is

      ETKb-a312n2 for f''(x)K

      where ET is the exact error for the Trapezoidal Rule and f''(x) is the second derivative of f(x)

Frequently Asked Questions about The Trapezoidal Rule

The Trapezoidal Rule states that for the integral of a function f(x) on the interval [a, b], the integral can be approximated with (2(b - a)/n)(f(x0) + 2f(x1) + 2f(x2) + ... + 2f(xn-1) + f(xn)) where is the number of trapezoidal subregions. 

The Trapezoidal Rule is an integral approximation technique that divides the area under the curve into little trapezoids. The area of each trapezoid is summed to approximate the total area under the curve.

The Trapezoidal Rule is a first-order numerical integration method. This means that straight line is used to approximate along the curve and the error of the estimate is proportional to the interval size.

The Trapezoidal Rule can be proved using the formula for the area of a trapezoid. Each trapezoidal sum region is then summed to approximate the total area under the curve.

Treat the first table entry as x0  and each following entry as x1, x2, ... with the last entry as xn. The number of trapezoidal subregions should be one less than the number of entries in the table.

Join over 22 million students in learning with our StudySmarter App

The first learning app that truly has everything you need to ace your exams in one place

  • Flashcards & Quizzes
  • AI Study Assistant
  • Study Planner
  • Mock-Exams
  • Smart Note-Taking
Join over 22 million students in learning with our StudySmarter App Join over 22 million students in learning with our StudySmarter App

Sign up to highlight and take notes. It’s 100% free.

Entdecke Lernmaterial in der StudySmarter-App

Google Popup

Join over 22 million students in learning with our StudySmarter App

Join over 22 million students in learning with our StudySmarter App

The first learning app that truly has everything you need to ace your exams in one place

  • Flashcards & Quizzes
  • AI Study Assistant
  • Study Planner
  • Mock-Exams
  • Smart Note-Taking
Join over 22 million students in learning with our StudySmarter App