
Since very early history, man has been able to find areas by using classical Greek geometry. These areas were restricted, however, to shapes that had boundaries of straight line segments and circles. The problem of finding areas under curves, such as those described by continuous functions, could not accurately be solved until calculus was discovered late in the 17th century.
There are two methods in calculus that are used to solve these problems. The first is to find the limit of the areas of inscribed rectangles under a curve. This is defined as the definite integral, as a limit of Riemann Sums. The second comes from one of the most important theorems in all of mathematics: The Fundamental Theorem of Calculus. The concept that is the basis for this theorem was discovered in the 1600's by Newton and Leibniz and describes the incredible relationship between the derivative and the integral.
A Riemann Sum is a numerical approximation by which the area beneath a curve is determined by summing many inscribed rectangles. It is a general term used to describe several different methods of summation and is named after the man who formalized the technique back in the mid 1800's. The definite integral using the method of approximating sums is used today by computer programs to solve, what is commonly referred to as, the area problem. In fact, LiveMath uses a type of numerical approximation to solve integration problems when calculating Definite Integrals.
The challenge is to find the area between a positive function and the x-axis, from a point a to a second point b. By inscribing rectangles within this area you can approximate the area by using polygons (in other words, areas bounded by straight lines). The accuracy is dependent upon the number of rectangles that you use; therefore, the problem becomes one of limits. The graphic below demonstrates how, by the summing of thinner and thinner rectangles, the accuracy of the approximation becomes better and better.
The three graphs below show an Upper Approximating Sum because the rectangle height, which is defined as the y-axis dimension, is the maximum y-value within each interval. A Lower Sum would use the minimum value within the interval. The terms Right Sum and Left Sum are also used to take into account negatively sloping curves. Indeed, the computational methods studied in this section are more properly termed right and left sums. Click here for more on Riemann Sums.


Eventually, as the x-axis dimension (
)
of each rectangle approaches zero, the aggreate area between the
function line at the top of the sub-intervals, and the top of
the rectangles become smaller and smaller, making the area of
the rectangles a better and better approximation of the area under
the function. The following slide-show demonstrates the concept.
As you tab through the four frames, notice the tan portion (representing
the area under the rectangles) getting larger and larger. The
slide-show demonstrates a lower sum (or left, in this case).
The practical importance of this can be related in a mind experiment. Say you are looking at the graph of velocity (y-axis) vs. time (x-axis). Recall, this graph represents the derivative function of the distance formula. The distance traveled by an object with a constant velocity (horizontal line) for a given time interval (x) is just the velocity (y-axis value) times the time interval (x). For example, if you are going 40 mph (y-axis value) for one hour (the change in the x-axis value) you have traveled 40 miles. This is merely the area of the rectangle!! In other words, the area under the velocity curve gives the distance! (In the next section on the Fundamental Theorem, you will study this concept in depth).
By making x-interval smaller and smaller (shorten the time interval) the top of the rectangle comes closer and closer to the function. Therefore, the area of the rectangle becomes a better and better approximation to the actual area beneath the curve.
Each time the interval decreases, more and more rectangles fit under the curve (see the slide-show above). Sum all of these rectangles up, and you will have a good approximation for the area under the total curve!
This sounds like a great idea, but who wants to add up the areas of hundreds or thousands rectangles to get a good approximation? I'm sure you don't, but you have LiveMath to do all the work for you. Before you can do this however, you need to do a little mathematical modeling. The following discussion introduces a new LiveMath Op, the Summation Op, and explains how you can use it to add up thousands of these little rectangles.
Using y = x^2 again as the function, the following graphic has been divided into four partitions. The interval is from x = a to x = b or from 2 to 4. Each partition has a width determined by dividing the total interval (b - a) by the number of partitions:

The first rectangle has an area of the value of y at a (the height of the rectangle) times delta-x (the width of the rectangle).
The first rectangle would have the following area:
The second rectangle would have an area based on the following formula....and so on:
Below is a list of all four rectangles:

Summing all of them gives a total area under the curve from 2 to 4, of 15.75 sq. units (the actural area under the curve is 18.667 units).
This was easy, but what if you want to increase n to 10 or to 100? You need a formula to do this. Here is where LiveMath can help. If you can put the expression into a general formula, then the Summation Op in LiveMath will sum all the rectangles for you. Below is the general formula that you will use.

The k is a counter variable (an integer) that goes up by one after each iteration (in the example above, there were 4 iterations).
The Summation Op will take the first
, and add it to
the second
, and
so on until k = n (k = 0 . . . n).
You know that delta-x doesn't change, but how are you going to have the computer change the value for x each time it goes through the process? The answer is one of defining x at each point using the counter variable k. Each x would be the previous x incremented by a delta-x.
Using the example above as a guide, take one point and use this formula.
Look at x_3
This is good for points within the interval, but what about the first point. You want the first x to equal a. And the subsequent x's to be incremented by delta-x. To solve this, you use k in the following fashion:
Since the first iteration will have k = 0, you will be left with x = a. In iteration #2 k =1 so x would equal a + delta-x. In the example, the following would hold true:

This is exactly what you want! You have x defined which you can then apply to the function y=x^2. As x changes for each iteration, y will change accordingly.
You are presented with one more problem though. If you go from k = 0 to k = n (where n=4) you will have one too many iterations (0,1,2,3,4 = 5 iterations). In the example above, you would have 5 rather than 4 rectangles and the sum would be one value too many (you have defined n=4 remember). To solve this, all you do is define the upper limit as n - 1 rather than n, making your formula:

NOTE: Remember, you are looking at an increasing function within the domain. Therefore the term Lower is appropriate because the left point on each interval gives you a rectangle that is underneith the curve. If the function had a negative slope, however, the left point on the interval would give a rectangle that was above the function.
In the graphic below, all of the partitions are determined by the left endpoint of the interval. The ones in green are Upper Sums because their areas are over the function, whereas the orange partitions, also being determined by the left endpoint of the interval, are Lower Sums.

It's time to use LiveMath to do all the work for you.



As stated above, the actual answer is 18.667, so it looks like 100 iterations gives a pretty good estimation.
Since all the rectangles are underneath the function, the approximation is going to be low. The solution is to solve the Upper Sums. The formula is going to be the same except to change the starting value of k and make the upper limit n rather than n - 1. This, in effect, starts the summation from the right side of the first rectangle for an increasing function and ends at the very end of the interval, (k = 4 in the original example).
The graphic below shows the last partition when measured as an upper sum (right). Notice that 4 is used this time rather than 3.5 to determine the height of the rectangle.

The following is the Upper (Right) Area formula:

The next example uses the Upper Area formula to determine the area under the curve.

As you can see, the upper sum over-estimates the area for the increasing function used here.
The obvious solution is to perform both the Lower and the Upper and take the average. The new formula finds the diagonal, in effect, it finds the area of a trapezoid. See the next graphic:

The next example is the easiest way to use LiveMath to find the area using the Trapezoidal rule.
As you can see, the final answer here is very close to the true answer of 18.667. To achieve the accuracy of the true answer, you would have to use n = 3500. That's a lot of rectangles to total up by hand!
The graph that follows is a sine function. For illustrative purposes, the partition shown is large (from 0.5 to 1.50). Rather than take the left or right sum, there is a way of approximation that uses the mid-point of the interval, as shown below.

The mathematics you will use in LiveMath does not differ much from the summaton equation used for the Lower (Left) Sum you used above. As you can see in the formula below, inside the function f you are merely adding one half of delta-x to the leftpoint of each partition obtained in the Left Sum equation.

Using the same graph shown above (just before example #6.1), but this time using the Mid-Point method, you can see how much more accurate this method seems to be; particularly when the function increases and decreases within the domain.

When you compare this result to the others you have done above, notice how close to the Trapezoidal Method's number this is. There is a reason for this using a simple tennent of geometry; that of similar triangles.
If you look at the tangent line at the point defined as the mid-point of the interval, notice how it intersects the top of the rectangle and the approximating figure it creates within the interval. It is a trapezoid! Because of the similar triangles (one added and one subtracted from the area) this trapezoid has the exact same area as the rectangle determined by using the Mid-Point method. For this reason, this method is sometimes called the Tangent Line Approximation.

The trapezoid formed by the tangent line above is not the same as the one created using the Trapezoidal Method. Below is a graph showing that trapezoid.

The approximation associated with the Mid-Point (aka; Tangent Line Approximation) looks like it does a better job of approximating the area under the curve. Indeed, the area associated with this approximation will generally be closer to the true value of the area under curves.
Simpson's Rule for approximating the area under a curve uses quadratic polynomials rather than linear polynomials. You approximate the graph of the given function with parabolic arcs instead of line segments.
In the following graphic, the function (black line) is approximated with the parobolic arc (red line). The interval is defined by the intersection of the arc with the function (see the three points).

The equation for the parabola in the above graphic is:

The generic parabola shown above is used for the derivation of the rule. Since the curve pases through the following three points....
the following equations apply:

Solving the system and placing in terms of y_0, y_1 and y_2 gives the following Area equation:
Simpson's Rule follows when you partition [a,b] into an even number of subintervals of equal length, apply the formula to sucessive interval pairs, and add up all of the results. Using LiveMath's Summation Op with function notation, the formula for Simpson's Rule is:
Click here for the full derivation of Simpson's Rule in the form of a LiveMath notebook.
The Definite Integral Op in LiveMath uses a numerical method like the ones discussed in the previous section to calculate the area problem. Summation notation is also used to define the Definite Integral. Although most calculus texts will use a more rigorous definition, this book uses notation consistent with the discussion above.
With this in mind, the definite integral is defined as:

or

The parts of the definite integral are shown below. To put it
in very simple words; the Definite Integral does the following.
You are taking the sum from a to b of the Function
times delta-x (labeled dx), where (dx) is some small incremental
value.
Below, graphically stated, is the definite integral:

The integral sign was chosen because Leibniz felt that it resembled the S in the German word for summation.