`> `
**restart;**

`> `

**Applications of the Definite Integral**

**Areas. Volumes. Arc Length. Total Mass**

In this section we study applications of the definite integral to calculating areas, volumes, arc length, the total mass given its density, etc. As you know, very often the main difficulty in such applications is setting up an appropriate integral. Maple will not help you in this respect. But it may be helpful in many other ways, as illustrated by the examples below.

**Example 1. **
Consider the region R bounded by the graphs of the functions
and
.

(a) Find the area of the region R.

(b) Find the perimeter of R.

(c) Find the volume of the solid obtained by revolving the region R about the x axis.

The units on each of the axes are centimeters.

`> `

As you know, the first step in problems similar to Example 1 usually consists of plotting the region under consideration. It wouldn't be easy in this case without Maple's help. Let's define and plot the functions involved.

`> `
**f:=x->exp(-x^2)*cos(x);**

`> `
**g:=x->x^2;**

Now we plot the functions, say, for x between -5 and 5, to start somewhere.

`> `
**plot([f(x),g(x)],x=-5..5,color=[red,blue]);**

`> `

Now we see where the region R is. The picture will be much clearer in a smaller range for x. Since units on both axes have physical meaning and happen to be the same, let's use the command " scaling=constrained " that tells Maple to use the same scale on both axes.

`> `
**plot([f(x),g(x)],x=-1..1,color=[red,blue],scaling=constrained, title="REGION R");**

`> `

Obviously, to answer any of the questions (a)-(c), we have to find the points of intersection of the two graphs. The equations involved are much too difficult to handle by hand, or by using the " solve " command that attempts to find exact solutions. We shall use the " fsolve " command that works numerically, and allows us to specify the range in which we want a solution. Let's label the points of intersection by " a " and " b ", respectively.

`> `
**a:=fsolve(f(x)=g(x),x,-1..0);**

`> `
**b:=fsolve(f(x)=g(x),x,0..1);**

`> `

Not surprisingly, a=-b. Observe that and are both even. Hence, region R is symmetric with respect to the y axis. With the points of intersection found, we are prepared to set up the definite integral that represents the area of the region. We label the area " A ".

`> `
**A:=Int(f(x)-g(x),x=a..b);**

Most of integrals in this worksheet cannot be found using the Fundamental Theorem. Hence, we shall use the " evalf " command that, whenever applied, provides a numerical approximation.

`> `
**evalf(A);**

`> `

The area of our region is approximately .889 .

To find the perimeter P of the region we have to add the arc length of the two pieces. We use the familiar formula for the arc length to set up the appropriate integrals.Recall that " D " stands for the derivative function.

`> `
**P1:=Int(sqrt(1+D(f)(x)^2),x=a..b);**

`> `
**P2:=Int(sqrt(1+D(g)(x)^2),x=a..b);**

Now we can find the numerical value of the perimeter P by evaluating both integrals.

`> `
**P:=evalf(P1)+evalf(P2);**

The perimeter is approximately equal to 3.521 cm.

`> `

To find the volume of revolution, we slice the solid perpendicularly to the x axis. The approximate volume of each "washer" slab is . The corresponding volume of the solid is then given by the integral

`> `
**V:=Int(Pi*(f(x)^2-g(x)^2),x=a..b);**

`> `
**evalf(V);**

`> `

The volume is approximately 2.712 .

`> `

**Example 2**
. Suppose that region R has varying mass density given by
grams per
, so, as you see, the density of the region increases as you move away from the y axis and is constant along vertical lines. Find the total mass of the region.

This problem is very easy. We slice the region into thin vertical strips of width corresponding to values of in the interval [a,b]. The area of a vertical strip corresponding to a given is approximately , and the density is approximately constant, with value m(x). Hence, the mass of this strip is approximately . We add all the masses and pass to the limit as approaches 0. The resulting integral that gives the total mass is

`> `
**M:=Int(25*x^2*(f(x)-g(x)),x=a..b);**

Its numerical value, in grams, is

`> `
**evalf(M);**

The next problem, where the density is constant along horizontal lines, is much more challenging.

`> `

**Example 3. **
Suppose now that our same region R has varying mass density given by
, so that now the density increases as you move away from the
*x axis*
and is constant along
*horizontal*
lines. Find the total mass of the region.

This time we have to slice the region into horizontal strips as the density is constant along horizontal lines. The situation in the lower part of the region bounded by differs from the situation in the upper part of the region bounded by . Shortly speaking, we have to divide the region in two by the horizontal line . Recall that a and b are the x coordinates of the intersections of the two graphs, which we found above. (Clearly, from the definition of a and b, and the symmetry of R, we have = .) Define

`> `
**c:=f(a);**

`> `
**plot([f(x),g(x),c],x=-1..1,color=[red,blue,green]);**

`> `

Finding the total mass of the lower region is easy. We slice the lower region into horizontal strips of width corresponding to values of from the interval [0,c]. The length of a strip corresponding to a given in the interval is and the density is approximately constant with value . Hence, the mass of each such strip is . The resulting integral that gives the total mass of the lower region and thus the numerical value of the mass, in grams, is as follows:

`> `
**M1:=Int(30*y^2*2*sqrt(y),y=0..c); evalf(M1);**

`> `

Observe that we were able to set up the integral because we could find the inverse function
(
*y *
) =
for
. (More precisely, for
restricted to nonnegative
.) The value of the inverse multiplied by 2 gave us the length of a horizontal strip. We cannot do the same for the upper region. We can see from the graph that the inverse
(
) for the function
(restricted to nonnegative
) is defined for any
in the interval [c,1]. Indeed, for any
in this interval the corresponding horizontal line intersects the graph of
over the positive half-line at exactly one point. The problem is that we can't find the formula for the inverse as no formula for
in terms of
for a solution to
can be found. The mass of the upper region is equal to the integral from c to 1 of the function
(
). We can't, however, find a formula for
(
). Is there anything that we can do at this point? Yes, there is. We can't find the formula for
in terms of
, but for any given
we can find the solution to
using the
fsolve
command. Hence, we can set up left or right Riemann sums for the integral from c to 1 of the function
(
). Indeed, Riemann sums require values of the integrand at a finite number of points only. And having Maple to perform calculations, we can set up Riemann sums for a large number of divisions, which will give us a good approximation of the desired integral. This is what we do below. Actually, we are calculating the left Riemann sum for fifty divisions. (It should be noted that one could find the total mass of the region using so called multiple integrals, which we shall learn in MTH 243.)

In physical terms, we shall divide the interval [c,1] into fifty subintervals, calculate the length of each horizontal strip by "fsolving" the corresponding equation, calculate the mass of each strip and add those masses up. Since the number of subintervals is large, we shall obtain a reasonably good approximation of the mass of the top region. Let's try to do it "by hand" using lists , which we introduced in the previous worksheet and Maple's " sum " and " seq " commands. Let's take the division of the interval [c,1] into 50 subintervals. Denote the width of each strip by

`> `
**h:=(1-c)/50;**

`> `

Take the list of the corresponding lower endpoints of subintervals in [c,1].

`> `
**PL:=[seq(c+(i-1)*h,i=1..50)];**

`> `

Let's find the corresponding length of each horizontal strip.

`> `
**LL:=[seq(2*fsolve(f(x)=PL[i],x,0..1),i=1..50)];**

Now we shall make a list of masses of each of the fifty horizontal strips.

`> `
**ML:=[seq(30*PL[i]^2*LL[i]*h,i=1..50)];**

`> `

Finally, let's sum up the masses of strips and obtain an approximate value of the mass of the upper region, in grams.

`> `
**M2:=sum(ML[j],j=1..50);**

`> `

Of course, one can easily program a procedure that would calculate the approximate mass of the upper region for any number of divisions n. Could you do it yourself after seeing a few simple examples of procedures in the previous worksheet? If you are curious, such a procedure is defined below.

`> `
**AM2:= proc(n) local h,L,i,k; global f,c; h:=(1-c)/n; L:=[seq(fsolve(f(x)=c+(i-1)*h,x,0..1),i=1..n)]; sum(30*(c+(k-1)*h)^2*2*L[k]*h,k=1..n); end:**

`> `

Let's check our procedure for n=50 to see if it works.

`> `
**AM2(50);**

`> `

Our procedure works. We can calculate now the mass of the upper region for, say, 70 divisions of the interval [c,1] and obtain a better approximation, and so on.

`> `
**AM2(70);**

`> `

What else could we do to calculate the mass of the upper region? Instead of slicing into horizontal strips, we could slice the region into vertical strips whose length is easy to find and compensate for the fact that the density is not nearly constant along each strip by dividing each vertical strip horizontally into small rectangles. On each rectangle the density would be nearly constant, so we could calculate the mass of each rectangle, add them up, and so on. This sort of procedure would lead us directly to the notion of the Riemann integral over an area and multiple integrals. We shall study this notion next semester.

`> `

**Parametric Curves**

`> `

**Example 4. **
Satellites in orbit around a central mass have elliptical orbits. For instance, the orbits of the planets around the sun are elliptical (though nearly circular) while the orbits of artificial satellites around the earth are often very elliptical. This example concerns a motion along an elliptical path. As you know, motion is best described using parametric representations of curves.

Consider a point moving in the plane so that its x and y coordinates are functions of time t given as follows:

`> `
**x:=2*cos(t); y:=3*sin(t);**

`> `

The point (x,y) will describe an ellipse as t goes from 0 to . We plot the elliptical path below. Note the syntax appropriate for parametric plots, especially the location of square brackets. In order to see clearly the elliptical shape of the path, we use the "scaling=constrained " option.

`> `
**plot([x,y,t=0..2*Pi],scaling=constrained);**

`> `

Suppose that your position at time t is given by the above parametric equations.

(a) What is your position and speed at t=3.5?

(b) How far along the ellipse do you move between time t=0 and t=3.5?

(c) Given that you started at (2,0) when t=0, at what time will you have traveled exactly 4 units of length along the ellipse?

`> `

To answer (a), observe that the position at 3.5 is (x(3.5), y(3,5)), and by the familiar formula, the speed at time t is . Hence, we obtain

`> `
**evalf(subs(t=3.5,x)); evalf(subs(t=3.5,y));**

`> `

Our position at t=3.5 is, approximately, (-1.873, -1.052). (We had to use the command " evalf " before " subs " in order to obtain a numerical value. Try to see what happens if you use " subs " without " evalf ".) Let's set up the expression for the speed v:

`> `
**v:=sqrt((diff(x,t))^2+(diff(y,t))^2);**

The speed at t=3.5 is then

`> `
**evalf(subs(t=3.5,v));**

`> `

To answer (b) we need the formula that says that the arc length of a parametric curve is the integral of the speed. We use it below to calculate the distance traveled between t=0 and t=3.5.

`> `
**AL:=Int(v,t=0..3.5); evalf(AL);**

`> `

We have traveled almost 9 units of length. To answer (c) we have to set up an equation and solve it numerically. The length traveled up to time T is given by:

`> `
**ALT:=Int(v,t=0..T);**

We want ALT to be equal to 4, so we have to solve numerically for T the equation ALT=4. Since ALT is strictly increasing there is only one solution to this equation and we do not have to worry about specifying the range for a solution.

`> `
**fsolve(ALT=4,T);**

`> `

At t equal approximately to 1.588 units of time, we have traveled 4 units of distance.

IMPORTANT! Since we defined x and y in terms of t in the example above we must restore x and y to be simply letters, otherwise we will have difficulties with plotting functions of x or y and with many other commands. You may have to do this in other situations as well, for example, after working on Problem 3 below .

This is how you restore x and y to be simply letters:

`> `
**x:='x'; y:='y';**

IMPORTANT! Re-execute the last command line otherwise you may get some strange error messages!

**Homework Problems**

**Problem 1. **
Consider the region G bounded by the graphs of
and
. Units on both axes are inches.

(a) Plot the region.

(b) Express in terms of definite integrals and find the numerical value of the perimeter of G.

(c) Express in terms of definite integrals (or one integral) and find the numerical value of the area of G.

(d) Express in terms of definite integrals and find the numerical value of the volume of the solid obtained by revolving region G about the x axis.

**Problem 2. **
(a)
** **
Suppose that region G defined in Problem 1 has varying mass density given by
grams per inch square. Express in terms of definite integrals and find the numerical value for the total mass of the region.

(b) Suppose that region G has mass density grams per inch square. Express in terms of definite integrals and find the numerical value for the total mass of G.

HINT:
Both
functions that bound the region G have inverses (when restricted to appropriate intervals). Formulas for the inverses can be easily found for
both
functions. You do not have to use lists, Riemann sums etc. as in Example 3 of this worksheet. Maple's syntax for the inverse cosine function is
"
arccos(
*variable*
)
".

**Problem 3. **
Suppose you are traveling along the path on the xy plane given by the parametric equations

, ,

where t is time.

(a) Plot the path.

(b) What is your position and speed at t=4.1?

(c) During a single orbit, how many times will your speed be the same as at t=4.1?

(d) What is the length of the whole orbit?

(e) What was your initial position? After what time have you traveled exactly 3 units of length from the initial position?

(See the note before Problem 1.)

`> `

*MTH 142 Maple Worksheets written by B.Kaskosz and L. Pakula, Copyright 1999.*

*Last modified August 1999.*

`> `