AREA UNDER A CURVE Trapezoid Rule numerical methods.doc

advertisement
AREA UNDER A CURVE – NUMERICAL METHODS
Consider the curve y  x 2  2 , whose graph is given below:
22
20
18
16
14
12
10
8
6
4
2
2
2
4
6
8
10
2
Suppose we want to find the area under the curve and above the x-axis, from x  1 to
x  3 . So far, we have no tools to find an exact answer, so the best we can do is an
approximation. To do this, we need to divide the region into rectangles and find the area
of each rectangle. The area under the curve is approximately equal to the sum of the
areas of the rectangles.
To see this, let’s divide the region above into two rectangles, one from x = 1 to x = 2 and
the other from x = 2 to x = 3, where the top of each rectangle comes just under the curve.
18
16
14
12
10
8
6
4
2
2
2
2
4
6
8
Notice that the width of each rectangle is 1. The height of the left rectangle is found by
plugging 1 into the equation y  x 2  2 (yielding 3); the height of the right rectangle is
found by plugging 2 into the same equation (yielding 6). The combined area of the two
rectangles is 9, so we could say that the area under the curve is approximately 9 square
units.
This is a rough approximation that significantly underestimates the actual area. Look at
how much of the area we missed by using two rectangles. To get a better approximation,
we’ll use more, thinner rectangles.
This time, cut up the region into four rectangles, each with width of ½.
18
16
14
12
10
8
6
4
2
2
2
4
6
8
2
Now find the height of each rectangle the same way as before. Notice that the values we
use are the left endpoints of each rectangle. Calculate the heights below:
Now multiply each height by ½ and add up the areas.
This is a much better approximation of the area, but there’s still a lot of space that isn’t
accounted for. We’re still underestimating the area. The rectangles need to be thinner.
But before we do that, let’s do something else.
Notice how each of the rectangles is inscribed in the region. Suppose we used
circumscribed rectangles instead – that is, we could determine the height of each
rectangle by the higher of the two y-values, not the lower. Then the region, divided into
four rectangles would look like this:
18
16
14
12
10
8
6
4
2
2
2
4
6
8
2
To find the area, we could still use the width of ½, but the heights would change. The
heights of each rectangle are now found by plugging in the right endpoint of each
rectangle. Do that below:
Once again, multiply each height by ½ and add up the areas.
43
, while the area under
4
59
51
the curve using four right endpoint rectangles is
. Averaging the two will give
,
4
4
which is actually a better approximation of the actual area than either of the two.
The area under the curve using four left endpoint rectangles is
Now that we’ve found the area using the rectangles a few times, let’s turn the method
into a formula. Call the left endpoint of the interval a and the right endpoint of the
interval b. Suppose we divide the region into n rectangles. Then the width of each
ba
rectangle is
. The height of the first inscribed rectangle is y0 , the height of the
n
second inscribed rectangle is y1 , the height of the third is y2 , and so on, up to the last
rectangle, which has a height of yn 1 .
If we use the left endpoint of each rectangle, the area under the curve is this:
ba
A
  y0  y1  y2  y3 
 n 
 yn 1  .
If we use the right endpoint of each rectangle, the area under the curve is this:
ba
A
  y1  y2  y3 
 n 
 yn  .
To get better approximations of the area, we make more, thinner rectangles. This is done
by letting n approach infinity; that is, we create an infinite number of rectangles that are
infinitesimally thin. The formula for “left-endpoint” rectangles becomes
ba
A  lim 
  y0  y1  y2  y3 
n 
 n 
 yn 1  .
For “right-endpoint” rectangles, the formula becomes
ba
A  lim 
  y1  y2  y3 
n 
 n 
 yn  .
Note: sometimes these are called “inscribed” and “circumscribed” rectangles.
We could also find the area using the midpoint of each interval. Let’s stick with the same
example, dividing the region into four rectangles. However, let’s make the height of each
rectangle touch the curve at the midpoint of each rectangle. (I’ve “stretched” the graph to
make the visual easier to work with.)
16
14
12
10
8
6
4
2
1
0.5
0.5
1
1.5
2
2.5
3
2
4
To find the height of each rectangle, we would still use the width of ½, but the heights
would now be found by plugging the midpoint of each interval into the equation. I’ve
done the arithmetic for you:
2
2
2
2
81  9 
113  11 
57  7 
153
5
,   2 ,   2
,   2
  2
16  4 
16
16  4 
16
4
4
Multiply each height by ½ to get the area of each such rectangle, and add them up:
 1 57   1 81   1 113   1 153  404 101

 12.625 .





8
 2 16   2 16   2 16   2 16  32
The general formula for approximating the area under a curve using midpoints is

 b  a 
A
  y1  y 3  y 5   y 2 n1  . Note the fractional subscript. It means to
 n  2
2
2
2 
evaluate the function at the number halfway between each integral pair of values of n.
3.5
The Trapezoidal Rule
Another method that’s even better than the rectangle method is the trapezoidal method.
Basically, all you do is divide the region into trapezoids instead of rectangles. We’ll use
the same problem and apply the trapezoidal rule.
Remember from geometry that the area of a trapezoid is
A
1
 b1  b2  h .
2
Remember also that b1 and b2 are the two bases of the trapezoid. Finally, remember that
the bases of a trapezoid are considered the two sides which are parallel.
14
12
10
8
6
4
2
2
2
4
6
8
2
Using one trapezoid, we can see that b1  f 1  1  2  3 , b2  f  3   3  2  11 ,
2
and h  3 1  2 , so the area under the curve is approximately
1
1
h  b1  b2    2  3  11  14 square units.
2
2
2
To get a better approximation, we divide the region into four trapezoids. Each shape is a
trapezoid on its side. Therefore, the height of each trapezoid is the length of each
interval, ½, and the bases are the y-values that correspond to each x-value. They are, in
17
33
, 11 .
order, 3, , 6,
4
4
Find the area of each trapezoid and add them up:
1

2
 17  1   1
3    
4  2 2

 17
 1 1
  6   
 4
 2 2
33  1   1

6   
4  2 2

 33
 1  51
  11    12.75 .
 4
 2 4
14
12
10
8
6
4
2
1.5
1
0.5
0.5
1
1.5
2
2.5
3
3.5
2
Recall that the “midpoint” value of the area is
101
 12.625 . The Trapezoid Rule gives a
8
similar approximation.
Notice how each trapezoid shares a base with the trapezoid before it, except for the end
ones. This enables us to simplify the formula for the Trapezoid Rule. Each trapezoid has
a height equal to the length of the interval, divided by the number of trapezoids we use.
If the interval is from x = a to x = b, and the number of trapezoids is n, then the height of
ba
each trapezoid is
, and our formula becomes:
n
1ba
A 
  y0  2 y1  2 y2  2 y3 
2 n 
 2 yn 1  yn  .
Example
Approximate the area under the curve y  x 3 from x  2 to x  3 using each of the
following:
a)
b)
c)
d)
four left-endpoint rectangles.
four right-endpoint rectangles.
four midpoint rectangles.
four inscribed trapezoids.
Solution:
DRAW A PRICTURE TO HELP VISUALIZE!
35
30
25
20
15
10
5
1
2
3
4
5
5
a)
The width of each rectangle is
 2
3
3
1
. The heights of the rectangles are:
4
3
3
 9  729  5  125
 11  1331
 8,   
,   
, and   
8
64
64
2
4
4
Therefore, the area is approximately:
1
1 729
1 125
1 1331  893
 13.953
8        

4
4  64  4  8  4  64  64
b)
The width of each rectangle is still
3
3
1
. However, the heights of the rectangles are:
4
3
 9  729  5  125  11  1331
,   
,   
, and
  
8
64
64
2
4
4
 3
3
 27
Therefore, the area is approximately:
1  729  1  125  1  1331  1
1197
 18.703

 
 
   27  
4  64  4  8  4  64  4
64
c)
The width of each rectangle is still
3
3
3
1
. However, the heights of the rectangles are:
4
 17 
 19   21 
 23 
  ,   ,   , and  
 8 
 8 
 8   8 
3
The area is now:
3
3
3
3
1  17  1  19  1  21  1  23  2075
 16.211
           
4 8  4 8  4 8  4 8 
128
d)
First, find the height of each trapezoid by using
ba
3 2 1
 .
. The height is
4
4
n
Using the formula, we approximate the area:
3
3
3
 1045
1  1  3
9
5
 11 
A     2  2    2    2    33  
 16.328 .

2  4  
64
4
2
4

HOMEWORK
1.
Approximate the area under the curve y  4  x 2 from x  2 to x  3 using leftendpoint rectangles.
2.
Repeat problem 1 using four right-endpoint rectangles.
3.
Repeat problem 1 using four midpoint rectangles.
4.
Approximate the area under the curve y  4  x 2 from x  1 to x  1 with n  4
inscribed rectangles.
5.
Approximate the area under the curve y  4  x 2 from x  1 to x  1 with n  4
circumscribed rectangles.
6.
Approximate the area under the curve y  4  x 2 from x  1 to x  1 using the
Trapezoid Rule with n  4 .
7.
Approximate the area under the curve y  4  x 2 from x  1 to x  1 using the
Midpoint Formula with n  4 .
8.
Approximate the area under the curve y  2 x  x 2 from x  1 to x  1 with
n  4 inscribed rectangles.
9.
Approximate the area under the curve y  2 x  x 2 from x  1 to x  1 with
n  4 circumscribed rectangles.
10.
Approximate the area under the curve y  2 x  x 2 from x  1 to x  1 using the
Trapezoid Rule with n  4 .
11.
Approximate the area under the curve y  2 x  x 2 from x  1 to x  1 using the
Midpoint Formula with n  4 .
Answers:
For #1 and #2, use the following:
b  a 3 2 1


n
4
4
y  4  x2
x2
y  4  22  0
x2
1 9

4 4
17
9
y  4  
16
4
x2
1 5

2 2
9
5
y  4  
4
2
x2
3 11

4 4
57
 11 
y  4  
16
4
2
y  4  3  5
x3
1.
2
2
2
Area using left-endpoint rectangles:
1
17 9 57  1  110  110
55
A  0



 1.71875
 

4
16
4
16  4  16 
64
32
2.
Area using right-endpoint rectangles:
1  17 9 57
95
 1  190  190
A 


 5   

 2.96875

4  16
4
16
64
32
 4  16 
For #3 use the following:
b  a 3 2 1


n
4
4
y  4  x2
3.
x
17
8
33
 17 
y  4  
64
 8 
x
19
8
105
 19 
y  4  
64
 8 
x
21
8
185
 21 
y  4  
64
 8 
x
23
8
273
 23 
y  4  
64
 8 
2
2
2
2
Area using midpoint rectangles:
1  33 105 185 273  1  596  596
149
A 




 2.328125
 

4  64
64
64
64  4  64  256
64
Here’s the picture for #4.
4.
4.5
4
3.5
3
2.5
2
1.5
1
0.5
2
1.5
1
0.5
0.5
0.5
1
1.5
2
2.5
For #4 use the following:
b  a 1   1 2 1

 
n
4
4 2
y  4  x2
x  1
x
1
2
y  4   1  3
2
2
 1  15
y  4  
4
 2
1
2
 1  15
y  4  
4
2
x 1
y  4   1  3
x
2
2
Area using inscribed rectangles:
A
1  15 15
 27
 13.5
 3    3 
2
4 4
 2
1
1.5
2
2.5
3
Here’s the picture for #5.
5.
4.5
4
3.5
3
2.5
2
1.5
1
0.5
2
1.5
1
0.5
0.5
1
0.5
1
1.5
2
2.5
For #5 use the following:
b  a 1   1 2 1

 
n
4
4 2
y  4  x2
x
1
2
x0
x
1
2
2
 1  15
y  4  
4
 2
y  4  0  4
2
2
 1  15
y  4  
4
2
Area using circumscribed rectangles:
A
1  15
15  31
 15.5
 44  
2 4
4 2
1.5
2
2.5
3
6.
For #6 use the following:
b  a 1   1 2 1

 
2n
8
8 4
y  4  x2
x  1
x
1
2
x0
x
1
2
x 1
y0  4   1  3
2
2
 1  15
y1  4     
4
 2
y2  4   0   4
2
2
 1  15
y3  4    
4
2
y4  4  1  3
2
1
 15 
 15   1
A   3  2    2  4   2    3    29   7.25
4
 4
 4  4
Here’s the picture for #7:
7.
4.5
4
3.5
3
2.5
2
1.5
1
0.5
1
0.5
0.5
0.5
1
For #7 use the following:
b  a 1   1 2 1

 
n
4
4 2
y  4  x2
x
3
4
55
 3
y  4  
 4  16
x
1
4
63
 1
y  4  
 4  16
2
2
x
1
4
63
1
y  4  
 4  16
x
3
4
55
3
y  4  
 4  16
A
2
2
1  55 63 63 55  1  59  59
 7.375
      
2  16 16 16 16  2  4  8
Here’s the picture for #8.
8.
2.5
2
1.5
1
0.5
2
1.5
1
0.5
0.5
0.5
1
1.5
2
2.5
3
3.5
1
1.5
2
For #8 use the following:
b  a 1   1 2 1

 
n
4
4 2
y  2x  x2
x
1
2
2
5
 1  1
y  2        
4
 2  2
x0
x
y  2 0  0  0
2
1
2
2
3
1 1
y  2     
4
2 2
1 5
3 1 2
1
A     0          0.25
2 4
4 2 4
4
Here’s the picture for #9.
9.
2.5
2
1.5
1
0.5
2
1.5
1
0.5
0.5
0.5
1
1.5
2
2.5
3
3.5
1
1.5
2
For #9 use the following:
b  a 1   1 2 1

 
n
4
4 2
y  2x  x2
x  1
x
x
y  2  1   1  3
2
1
2
2
5
 1  1
y  2        
4
 2  2
1
2
2
3
1 1
y  2     
4
2 2
x 1
y  2 1  1  1
2
1
5
 5 3  1 5
A   3       1        1.25
2
4
 4 4  2 2
Here’s the picture for #10.
10.
2
1.5
1
0.5
2
1.5
1
0.5
0.5
0.5
1
1.5
2
2.5
3
3.5
4
1
1.5
2
For #10:
b  a 1   1 2 1

 
2n
8
8 4
y  2x  x2
x  1
x
y0  2  1   1  3
2
1
2
2
5
 1  1
y1  2         
4
 2  2
x0
x
y2  2  0    0   0
2
1
2
2
3
1 1
y3  2      
4
2 2
x 1
y4  2 1  1  1
2
1
3
 5
3  1
A   3  2     2  0   2    1   3    0.75
4
4
 4
4  4
Here’s the picture for #11:
11.
2
1.5
1
0.5
2
1.5
1
0.5
0.5
0.5
1
1.5
2
2.5
3
3.5
4
1
1.5
2
For #11:
b  a 1   1 2 1

 
n
4
4 2
y  2x  x2
x
3
4
33
 3  3
y  2        
16
 4  4
x
1
4
9
 1  1
y  2        
16
 4  4
2
2
x
1
4
7
1 1
y  2     
 4   4  16
x
3
4
 3   3  15
y  2     
 4   4  16
2
2
1   33   9  7 15  1  5 
5
A                    0.625
2   16   16  16 16  2  4 
8
Download