Presentation on theme: "D MANCHE 2013. Finding the area under curves: There are many mathematical applications which require finding the area under a curve. The area “under”"— Presentation transcript:
Finding the area under curves: There are many mathematical applications which require finding the area under a curve. The area “under” a curve is defined as the area between the curve and the x-axis. This area can be: estimated by using “numerical methods” or calculated using “calculus methods”.
Example to consider: Find the area under the curve between and
Exact area: It can be shown, using calculus, that the exact area under the curve as shown is 12 square units. (We will see how later.)
Numerical Methods v Calculus: We will consider several numerical methods which can be used to give a good approximation of the area under a curve. Calculus, specifically definite integrals, can be used to find the exact area under a curve. We will consider this method later.
Numerical Methods of Integration While definite integrals lead to the exact area under the curve, numerical methods of integration give an approximation of this area. These numerical methods for finding area under a curve are particularly useful - if the function is not known if the function cannot be integrated algebraically if the function is difficult to integrate algebraically.
Numerical methods: Rectangle Method Midpoint Method Trapezoidal Method Simpson’s Rule Monte Carlo Method
Rectangle Method a b x 0 x 1 x 2 x 3 The interval from x=a to x=b is first divided into n intervals. Each interval has a width of Since there are n intervals there will be n +1 x-values. The first one is x 0 =a and the last one is x n = b. To keep this example simple, n = 3.
Rectangle Method (cont.) n rectangles are then drawn. The width is the same for each rectangle and the height is given by the appropriate f(x) value. The area of each rectangle is found in the usual way (Area = width x height). The sum of the areas of these rectangles approximates the area under the curve. These rectangles can be constructed in several ways.
Rectangle Method Upper rectanglesLower rectangles Left rectanglesRight rectangles
Rectangle Method (cont.) Shaded area [The exact area is actually 12 square units. So, in this instance, the rectangle method underestimates the area under the curve.] Calculations using Left Rectangles
Rectangle method (cont.) The Rectangle method is the simplest method to use, but it is usually the most inaccurate. Its accuracy can be improved by increasing the number of intervals (n). As n gets larger, the closer the approximation gets to the real area under the curve. n=3 n=30n=12 n=6
Midpoint Method All of the rectangle methods use f(x 0 ), f(x 1 ), f(x 2 ) or f(x 3 ) as the height of the rectangles, ie. the heights already drawn in the first graph below. The midpoint method locates the midpoint of each interval eg (x 0 +x 1 )/2, and uses the height f [(x 0 +x 1 )/2] as the height of the rectangle. The area of this rectangle is generally a better approximation than that obtained by using either the left or right rectangles or upper or lower rectangles. The process is continued for the remaining intervals and areas added. Midpoint of interval
Midpoint Method (cont.) Shaded area Note that this is a better approximation than that obtained using the rectangle method.
Trapezoidal Method Instead of using rectangles, the trapezoidal method (not surprisingly) uses trapeziums to approximate the area under the curve. The trapeziums are formed by joining the points on the curve with straight lines. Compared to the rectangle method, the trapezoidal method gives a better approximation for the real area, as obvious in the graph below.
Trapezoidal Method (cont.) Recall that the area of a trapezium with parallel sides of length a and b and with perpendicular height h is given by: Area a b h Area = average of parallel sides x perpendicular distance between them
Trapezoidal Method (cont.) Shaded area a=x 0 x 1 x 2 x 3 =b where w = width of each strip E = sum of end ordinates M = sum of middle ordinates Note that all of the terms, except the first and last, appear twice in this expression.
Trapezoidal Method (cont.) a=x 0 x 1 x 2 x 3 =b Area Area [Remember that the real area under the curve is 12 square units.]
Trapezoidal Method (cont.) The Trapezoidal Method is an improvement over the Rectangle Method because the points at the top of each strip are joined by an oblique line rather than a horizontal line from either the left or the right. This leads to a better approximation of the area under the curve. Rectangle Method (left) Trapezoidal Method
Simpson’s Rule Simpson’s Rule improves on the Trapezoidal method by placing a parabola (red) rather than an oblique line (green) between points on the curve (blue). Simpson’s rule considers 2 strips at a time so n must be even.
Simpson’s Rule (cont.) Area The proof for Simpson’s rule is beyond the scope of this course, but if interested see http://pages.pacificcoast.net/~cazelais/187/simpson.pdf
Simpson’s Rule (cont.) Simpson’s Rule requires an even number of intervals, so in this example we will use n=6.
Simpson’s Rule (cont.) Area Area Because the function here is that of a parabola, Simpson’s Rule gives the exact area. This will not be the case when the function is not a quadratic.
Monte Carlo Method The Monte Carlo method involves determining the proportion of the area of a suitably positioned rectangle that includes the area that lies under a given curve (see diagram below). 3 7 Area of rectangle = 21 sq units
Monte Carlo Method (cont.) By positioning a series of randomly chosen points inside this rectangle and counting the number of these points that fall on or inside the required area, this proportion can be determined. Then the required area (shaded) can be found by multiplying this proportion by the area of the rectangle. 12 points out of 20
Monte Carlo Method (cont.) So in this case: 12 out of 20 points fell in the shaded area The area of the rectangle was 21 square units Therefore: Area ≈ (12/20) x 21 = 12.6 square units Generally, the more random points chosen, the better the approximation.
Summary of Numerical Integration Methods used to find an approximation for the area under a curve used when the function is unknown or cannot be integrated Rectangle, Midpoint, Trapezoidal methods and Simpson’s rule generally improve as the number of intervals increases Monte Carlo Method generally improves as number of random points increases because repetitive calculations are involved, these methods lend themselves well to spreadsheets
Using Calculus to find area: Since the area lies above the x-axis :
So the exact area under the curve is 12 square units.