Next: About this document ... Up: Labs and Projects for Previous: Labs and Projects for
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.
You have learned 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. You have also learned 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.
The command to use is shown below.
To compute an indefinite integral with Maple, you just leave out the range for the limits of integration, as shown below.
You can also use the Maple int command with functions or expressions you have defined in Maple. For example, suppose you wanted to find area under the curve of the function on the interval . Then you can define this function in Maple with the command
> f := x -> x*sin(x);
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);
you could use the following Maple command.
Sometimes you need to compute a definite integral involving a piecewise-defined function. For example, suppose you have a function f(x) defined as follows
and you needed to compute the definite integral
The best way to do this in Maple is to split it up into two integrals and use the appropriate formula, as shown below. How you split the integral up is determined by where the formula defining the function changes.
Note that the average value is just a number. Note furthermore that we can rearrange the definition to give
If on [a,b], then the average value has the following geometrical interpretation: is the height of a rectangle of width b-a such that the area of this rectangle is equal to the area under the graph of f from a to b. The following example shows you how to compute an average. The last plot command shows the function and the top of this rectangle.
> f :=x -> x*sin(x) ;
> f_ave := int(f(x),x=0..Pi)/Pi;
(Hint - first compute the integral using a as your upper limit, and then use the fsolve command.)
Compute the following integral.
Find the average value of v(t) on the following time intervals.
Jane E Bouchard