next up previous
Next: Exercises Up: The Definite Integral - Previous: Purpose

Subsections


Background

Introduction

There are two main ways to think of the definite integral. The easiest one to understand, and the one we'll consider first, is as a means for computing areas (and volumes). The second way the definite integral is used is as a sum. That is, we use the definite integral to ``add things up''. Here are some examples.

Of course, when we use a definite integral to compute an area or a volume, we are adding up area or volume. So you might ask why make a distinction? The answer is that the notion of an integral as a means of computing an area or volume is much more concrete and is easier to understand.

We will learn in class that the definite integral is actually defined as a (complicated) limit of sums, so it makes sense that the integral should be thought of as a sum. We will also learn in class that the indefinite integral, or anti-derivative, can be used to evaluate definite integrals. Students often concentrate on techniques for evaluating integrals, and ingnore the definition of the integral as a sum. This is a mistake, for the following reasons.

1.
Many functions don't have anti-deriviatives that can be written down as formulas. Definite integrals of such function must be done using numerical techniques, which always depend on the definition of the integral as a sum.
2.
In many applications of the integral in engineering and science, you aren't given the function which is to be integrated and must derive it. The derivation always depends on the definition of the integral as a sum.

Partitions and rectangular approximations to area

Suppose f(x) is a non-negative, continuous function defined on some interval [a,b]. Then by the area under the curve y=f(x) between x=a and x=b we mean the area of the region bounded above by the graph of f(x), below by the x axis, on the left by the vertical line x=a, and on the right by the vertical line x=b.

The rectangular area approximations we will describe in this section depend on subdividing the interval [a,b] into subintervals of equal length. For example, dividing the interval [0,4] into four uniform pieces produces the subintervals [0,1], [1,2], [2,3], and [3,4]. The next step is to approximate the area above each subinterval with a rectangle, with the height of the rectangle being chosen according to some rule. In particular, we will consider the following rules:

left endpoint rule
The height of the rectangle is the value of the function f(x) at the left-hand endpoint of the subinterval.
right endpoint rule
The height of the rectangle is the value of the function f(x) at the right-hand endpoint of the subinterval.

midpoint rule
The height of the rectangle is the value of the function f(x) at the midpoint of the subinterval.

The Maple student package has commands for visualizing these three rectangular area approximations. To use them, you first must load the package via the with command. Then try the three commands given below. Make sure you understand the differences between the three different rectangular approximations. Take a moment to see that the different rules choose rectangles which in each case will either underestimate or overestimate the area. Even the midpoint rule, whose rectangles usually have heights more appropriate than those for the left endpoint and right endpoint rules, will produce an approximation which is not exact.

  > with(student):

  > rightbox(x^2,x=0..4);

  > leftbox(x^2,x=0..4);

  > middlebox(x^2,x=0..4);

There are also Maple commands leftsum, rightsum, and middlesum to sum the areas of the rectangles, see the examples below. Note the use of evalf to obtain numerical answers.

  > rightsum(x^2,x=0..4);

\begin{maplelatex}
\begin{displaymath}
{\displaystyle \sum_{{i}=1}^{4}} \,{i}^{2}\end{displaymath}\end{maplelatex}

  > evalf(rightsum(x^2,x=0..4));

\begin{maplelatex}
\begin{displaymath}
30.\end{displaymath}\end{maplelatex}

  > middlesum(x^2,x=0..4);

\begin{maplelatex}
\begin{displaymath}
{\displaystyle \sum_{{i}=0}^{3}} \, \left...
 ...
{\displaystyle \frac {1}{2}}\, \! \right) ^{2}\end{displaymath}\end{maplelatex}

  > evalf(middlesum(x^2,x=0..4));

\begin{maplelatex}
\begin{displaymath}
21.00000000\end{displaymath}\end{maplelatex}

The Maple commands above use the short-hand summation notation. Since there are only four terms in the sums above, it isn't hard to write them out explicitly, as follows.

However, if the number of terms in the sum is large, summation notation saves a lot of time and space.

It should be clear from the graphs that adding up the areas of the rectangles only approximates the area under the curve. However, by increasing the number of subintervals the accuracy of the approximation can be increased. All of the Maple commands described so far in this lab permit a third argument to specify the number of subintervals. The default is 4 subintervals. See the example below for the area under y=x from x=0 to x=2 using the rightsum command with 4, 10, 20 and 100 subintervals. (As this region describes a right triangle with height 2 and base 2, this area can be easily calculated to be exactly 2.) Try it yourself with the leftsum and middlesum commands.

  > evalf(rightsum(x,x=0..2));

\begin{maplelatex}
\begin{displaymath}
2.500000000\end{displaymath}\end{maplelatex}

  > evalf(rightsum(x,x=0..2,10));

\begin{maplelatex}
\begin{displaymath}
2.200000000\end{displaymath}\end{maplelatex}

  > evalf(rightsum(x,x=0..2,20));

\begin{maplelatex}
\begin{displaymath}
2.100000000\end{displaymath}\end{maplelatex}

  > evalf(rightsum(x,x=0..2,100));

\begin{maplelatex}
\begin{displaymath}
2.020000000\end{displaymath}\end{maplelatex}

Since, in this trivial example, we knew that the area is exactly 2, it appears that, as the number of subintervals increases, the rectangular approximation becomes more accurate.

Computing areas as definite integrals with Maple

In the example in the previous section, we saw that increasing the number of subintervals gave a better approximation to the area. In such a case, it seems reasonable that taking a limit as the number of subintervals goes to infinity should give the exact answer. This is exactly the idea in defining the definite integral. Of course, the actual definition of the definite integral involves more general sums than the ones we have been talking about, but the idea is the same.

When this limit as the number of subintervals goes to infinity exists, we have special notation for this limit and write it as

\begin{displaymath}
\int_{a}^{b} f(x) \, dx \end{displaymath}

We will learn later on that if the function f(x) is continuous on the interval [a,b], then this limit always exists and we can write

\begin{displaymath}
A = \int_{a}^{b} f(x) \, dx \end{displaymath}

where A is the area under the curve y=f(x) between x=a and x=b.

The Fundamental Theorem of Calculus (FTOC) provides a connection between the definite integral and the indefinite integral we studied earlier. That is, the FTOC provides a way to evaluate definite integrals if an anti-derivative can be found for f(x). We'll spend a lot of time later in the course developing ways to do this, but for now we'll let Maple do the work and won't worry too much about how it is done.

The basic maple command for performing definite and indefinite integrals is the int command. The syntax is very similar to that of the leftsum and rightsum commands, except you don't need to specify the number of subintervals. This should make sense, if you recall that the definite integral is defined as a limit of a rectangular sum as the number of subintervals goes to infinity. In the section on rectangular approximations, we used two examples. The first was the function y=x2 on the interval [0,4] and the second was the function y=x on the interval [0,2]. We would express the areas under these two curves with our integral notation as

\begin{displaymath}
\int_{0}^{4} x^2 \, dx \end{displaymath}

and

\begin{displaymath}
\int_{0}^{2} x \, dx \end{displaymath}

Using Maple, we would compute these two definite integrals as shown below.

  > int(x^2,x=0..4);

\begin{maplelatex}
\begin{displaymath}
{\displaystyle \frac {64}{3}}\end{displaymath}\end{maplelatex}
  > int(x,x=0..2);

\begin{maplelatex}
\begin{displaymath}
2\end{displaymath}\end{maplelatex}
Notice that Maple gives an exact answer, as a fraction. If you want a decimal approximation to an integral, you just put an evalf command around the int command, as shown below.
  > evalf(int(x^2,x=0..4));

\begin{maplelatex}
\begin{displaymath}
21.33333333\end{displaymath}\end{maplelatex}

In the exercises, we'll ask you to compare rectangular approximations to integrals. In doing so, you'll need to apply several commands to the same function. To save typing and prevent errors, you can define the function as a function or an expression in Maple first and then use it in subsequent int, leftsum, etc. commands. For example, suppose you were given the function $f(x)=x \sin(x)$ on the interval $[0,\pi]$. Then you can define this function in Maple with the command

  > f := x -> x*sin(x);

\begin{maplelatex}
\begin{displaymath}
{f} := {x} \rightarrow {x}\,{\rm sin}(\,{x}\,)\end{displaymath}\end{maplelatex}
and then use this definition to save typing as shown below.
  > int(f(x),x=0..Pi);

\begin{maplelatex}
\begin{displaymath}
{ \pi}\end{displaymath}\end{maplelatex}
  > evalf(leftsum(f(x),x=0..Pi,4));

\begin{maplelatex}
\begin{displaymath}
2.978416600\end{displaymath}\end{maplelatex}

You can also simply give the expression corresponding to f(x) a label in Maple, and then use that label in subsequent commands as shown below. However, notice the difference between the two methods. You are urged you to choose one or the other, so you don't mix the syntax up.

  > p := x*sin(x);

\begin{maplelatex}
\begin{displaymath}
{p} := {x}\,{\rm sin}(\,{x}\,)\end{displaymath}\end{maplelatex}
  > int(p,x=0..Pi);

\begin{maplelatex}
\begin{displaymath}
{ \pi}\end{displaymath}\end{maplelatex}

next up previous
Next: Exercises Up: The Definite Integral - Previous: Purpose

William W. Farr
1/9/1998