topic badge
Standard level

11.03 Approximate areas under graphs using trapezoidal rule

Lesson

When a curve forms a familiar geometric shape, it's relatively easy to determine the area enclosed between the curve and the $x$x-axis. But what if the curve we have graphed doesn't make a nice geometric shape or it isn't possible to calculate the primitive? One approach is to approximate the area between the curve and the $x$x-axis.

Under-approximating the area under a curve

Let's consider finding the area between the curve $y=x^2+1$y=x2+1 and the $x$x-axis from $x=0$x=0 to $x=1$x=1.

Methods we may have used to estimate area in our early school years involved counting the number of square centimetres inside a shape.

We'll take a similar approach, but instead of counting squares, we'll divide the area into rectangles.

In this first approach we'll under-approximate the area and to do so we'll draw a series of $5$5 rectangles that sit underneath the curve. Dividing the area into $5$5 rectangles provides a starting point.

To calculate the total area we find the area of each rectangle and add them all up.

We can see the width of each is $0.2$0.2, but what is the height? To find the height, we need to substitute the $x$x-value into the function to calculate the $y$y-value and hence the height of each rectangle.

Area $=$= $0.2\left(0^2+1\right)+0.2\left(0.2^2+1\right)+0.2\left(0.4^2+1\right)+0.2\left(0.6^2+1\right)+0.2\left(0.8^2+1\right)$0.2(02+1)+0.2(0.22+1)+0.2(0.42+1)+0.2(0.62+1)+0.2(0.82+1)
Area $=$= $0.2\left(1+1.04+1.16+1.36+1.64\right)$0.2(1+1.04+1.16+1.36+1.64)
Area $=$= $1.24$1.24 units2

 

If we wanted a better approximation and less white space between the rectangles and the curve, we could increase the number of rectangles, making the width of each smaller.

Let's try this with $10$10 rectangles.

Area $=$= $0.1\left(1+1.01+1.04+1.09+1.16+1.25+1.36+1.49+1.64+1.81\right)$0.1(1+1.01+1.04+1.09+1.16+1.25+1.36+1.49+1.64+1.81)
Area $=$= $1.285$1.285 units2

 

We could do more and more rectangles to get an even better approximation. Experiment with the applet below to see what happens to the under-approximation of the area.

Over-approximating the area under a curve

We can also choose to over-approximate instead of under-approximate our area. We will use $5$5 rectangles again. Notice the placement of the right-hand side of the rectangle so that the rectangles are drawn over the curve.

Area $=$= $0.2\left(1.04+1.16+1.36+1.64+2\right)$0.2(1.04+1.16+1.36+1.64+2)
Area $=$= $1.4325$1.4325 units2

The middle way for approximating area

We can also use a middle-way here, and draw rectangles so that the middle of the rectangle touches the curve, as shown above.

Area $=$= $0.2\left(1.01+1.09+1.25+1.47+1.81\right)$0.2(1.01+1.09+1.25+1.47+1.81)
Area $=$= $1.33$1.33 units2

Practice questions

Question 1

The interval $\left[0,8\right]$[0,8] is partitioned into four sub-intervals $\left[0,2\right]$[0,2], $\left[2,4\right]$[2,4], $\left[4,6\right]$[4,6], and $\left[6,8\right]$[6,8].

Loading Graph...

$x$x $0$0 $2$2 $4$4 $6$6 $8$8
$y$y $11$11 $5$5 $10$10 $5$5 $5$5
  1. Approximate the area $A$A using rectangles for each sub-interval whose heights are equal to the function values of the left side of the sub-intervals.

  2. Now approximate the area $A$A using rectangles for each sub-interval whose heights are equal to the function values of the right side of the sub-intervals.

Question 2

Approximate $\int_0^88xdx$808xdx by using four rectangles of equal width whose heights are the values of the function at the midpoint of each rectangle.

Approximating areas using the trapezoidal rule

A trapezium usually gives a closer approximation for the area under a curve than a rectangle as it reduces the space between the curve and the quadrilateral.

The trapezoidal rule is a formula that uses a trapezium to approximate the area under a curve. We can divide the curve into more than one trapezium (which we call a subinterval). For example, if we divide the area under the curve into three trapezia of equal widths, we are dividing the curve into $3$3 subintervals and we will use $3$3 applications of the trapezoidal rule.

Recall that the area of a trapezium is:

$\text{Area}=\frac{h}{2}(a+b)$Area=h2(a+b)

Remember $h$h is perpendicular to the parallel sides $a$a and $b$b.

For the area under a curve $f(x)$f(x) between $x=a$x=a and $x=b$x=b:

$A=\frac{1}{2}h\left[f(a)+f(b)\right]$A=12h[f(a)+f(b)] where $h=b-a$h=ba.

Rewriting this, gives us the following:

$A=\frac{b-a}{2}\left[f(a)+f(b)\right]$A=ba2[f(a)+f(b)]

Using the trapezoidal rule for one subinterval

For a function $f(x)$f(x), we can approximate the area under the curve in the interval bound by $[a,b]$[a,b] by drawing a chord to join $\left(a,f(a)\right)$(a,f(a)) and $\left(b,f(b)\right)$(b,f(b)) to form a trapezium resulting in:

$\int_a^b\ f(x)\ dx\ \approx\ \frac{b-a}{2}\ \left[f(a)+f(b)\right]$ba f(x) dx  ba2 [f(a)+f(b)]

Worked example

Example 1

Use the trapezoidal rule to find an approximate for $\int_1^5\frac{2dx}{x}$512dxx using:

(a) one subinterval

Think: We can write $\int_1^5\frac{2dx}{x}$512dxx as $\int_1^5\frac{2}{x}dx$512xdx

$f(x)=\frac{2}{x}$f(x)=2x, $a=1$a=1 and $b=5$b=5

$\int_a^b\ f(x)\ dx\ \approx\ \frac{b-a}{2}\ \left[f(a)+f(b)\right]$ba f(x) dx  ba2 [f(a)+f(b)]

Do: Substituting in our values:

$\int_1^5\ f(x)\ dx\approx$51 f(x) dx $\approx$ $\frac{5-1}{2}\left[f(1)+f(5)\right]$512[f(1)+f(5)]
  $=$= $2\times(2+\frac{2}{5})$2×(2+25)
  $=$= $\frac{4}{5}$45

 

(b) four subintervals

Think: Four subintervals mean four applications of the trapezoidal rule. We need to divide the area into $4$4 subintervals of equal width. In this case, the width is $1$1.

$f(x)=\frac{2}{x}$f(x)=2x and $h=5$h=5

Do:

$\int_1^5\frac{2}{x}dx$512xdx $=$= $\int_1^2\frac{2}{x}dx+\int_2^3\frac{2}{x}dx+\int_3^4\frac{2}{x}dx+\int_4^5\frac{2}{x}dx$212xdx+322xdx+432xdx+542xdx
  $\approx$ $\frac{1}{2}(2+1)+\frac{1}{2}(1+\frac{2}{3})+\frac{1}{2}(\frac{2}{3}+\frac{1}{2})+\frac{1}{2}(\frac{1}{2}+\frac{2}{5})$12(2+1)+12(1+23)+12(23+12)+12(12+25)
  $\approx$ $3\frac{11}{30}$31130

Trapezoidal rule for $n$n subintervals

We can see in the previous example that each bracketed term was multiplied by $\frac{1}{2}$12. This is equivalent to $\frac{h}{2}$h2. Also, we can notice that the $f(b)$f(b) term in the bracket is also the $f(a)$f(a) term in the next bracket. Noticing this pattern leads us to a quicker way to calculate multiple applications of the trapezoidal rule.

Trapezoidal rule using $n$n subintervals

Given $n$n subintervals under a function $f(x)$f(x) in the interval $[a,b]$[a,b]:

$\int_a^b\ f(x)\ dx\ \approx\ \frac{h}{2}\left[f(a)+f(b)+2\left(f(x_1)+f(x_2)+\dots+f(x_{n-1})\right)\right]$ba f(x) dx  h2[f(a)+f(b)+2(f(x1)+f(x2)++f(xn1))]

where $a=x_0$a=x0, $b=x_n$b=xn and the values of $x_1$x1, $x_2$x2, $\dots$, $x_{n-1}$xn1 are found by dividing the interval $[a,b]$[a,b] into $n$n equal subinterval of width $h=\frac{b-a}{n}$h=ban.

The formula could also be rewritten as:

$\int_a^b\ f(x)\ dx\ \approx\ \frac{b-a}{2n}\left[f(a)+f(b)+2\left(f(x_1)+f(x_2)+\dots+f(x_{n-1})\right)\right]$ba f(x) dx  ba2n[f(a)+f(b)+2(f(x1)+f(x2)++f(xn1))]

Note: the formula looks complicated but it is quite straightforward as long as:

  • the subintervals are all the same width, $h$h.
  • we use a table of values, or similar, to work from.

Worked example

Example 2

Use the trapezoidal rule with $5$5 subintervals to find an approximation for $\int_2^7\frac{3}{x-1}dx$723x1dx.

Think: $a=2$a=2 and $b=7$b=7. The width of each subinterval is $h=\frac{b-a}{n}=\frac{7-2}{5}=1$h=ban=725=1

Do:

Using a table of values to find the function values:

$x$x $2$2 $3$3 $4$4 $5$5 $6$6 $7$7
$f(x)$f(x) $3$3 $\frac{3}{2}$32 $1$1 $\frac{3}{4}$34 $\frac{3}{5}$35 $\frac{1}{2}$12

Substituting the values into the formula:

$\int_2^7\ \frac{3}{x-1}\ dx$72 3x1 dx $\approx$ $\frac{1}{2}\left[f(2)+f(7)+2\lbrace f(3)+f(4)+f(5)+f(6)\rbrace\right]$12[f(2)+f(7)+2{f(3)+f(4)+f(5)+f(6)}]
  $\approx$ $\frac{1}{2}\left[3+\frac{1}{2}+2(\frac{3}{2}+1+\frac{3}{4}+\frac{3}{5})\right]$12[3+12+2(32+1+34+35)]
  $\approx$ $5\frac{3}{5}$535

Practice questions

Question 3

The function $y=3\ln x$y=3lnx has been graphed.

Loading Graph...

  1. Solve for the $x$x-intercept of the curve.

  2. Use two applications of the trapezoidal rule to approximate the area bound by the curve, the $x$x-axis and and $x=6$x=6.

    Give your answer to one decimal place.

Question 4

Use three applications of the trapezoidal rule to approximate $\int_0^9e^{-x^2}dx$90ex2dx to one decimal place.

Using the trapezoidal rule to find irregular areas

The trapezoidal rule can also be used to find the area of irregular shapes. This is particularly useful when we need to find the area of a block of land as they are often irregular in shape.

Worked example

Example 3

Use the trapezoidal rule to approximate the area of the block of land shown below:

Think: We can see that there are $3$3 subintervals and $f(a)=410$f(a)=410 and $f(b)=360$f(b)=360.

The width of each subinterval is $h=\frac{1020}{3}=340$h=10203=340.

Do: Substituting these into the formula:

Area $\approx$ $\frac{340}{2}\left[410+360+2(310+450)\right]$3402[410+360+2(310+450)]
  $\approx$ $389300$389300 m2

Practice question

Question 5

A surveyor provided the following diagram with measurements for a property she was mapping out.

  1. Find the approximate total area of the property by using three applications of the trapezoidal rule.

    Give your answer in square metres.

  2. The average weekly rainfall is $34$34 mm. Calculate the total volume of water that falls on the land in cubic metres.

    Round your answer to two decimal places.

What is Mathspace

About Mathspace