5.3 Evaluating Definite Integrals

Mathematica script by Chris Parrish,
   cparrish@sewanee.edu

Sources and references for some of these problems include
    James Stewart, "Calculus: Concepts and Contexts," Second Edition, Brooks/Cole, 2001
    Deborah Hughes-Hallett, Andrew M. Gleason, et. al., "Calculus," Second Edition, John Wiley & Sons, 1998
    Robert Fraga, ed., "Calculus Problems for a New Century," The Mathematical Association of America, 1993

Cost of Saudi Oil Well

Hughes-Hallett, Gleason, et al, Exercise 7.1.56, page 347

One of the principal corollaries of the Fundamental Theorem of Calculus is the Total Change Theorem:
    "The integral of a rate of change is the total change."
Here we apply the Total Change Theorem to the problem of calculating the cost of a Saudi oil well.
See HHG, exercise 7.1.56, page 347, for more details.
Note the role of the indefinite integral in this solution.

In[358]:=

<<Graphics`Colors`

In[359]:=

fixedCost = 1000000             (* riyals *);
marginalCost[x] := 4000 + 10x   (* riyals/m *);

totalCost[x_] = fixedCost + Integrate[marginalCost[x],x]

Out[361]=

1000000 + 4000 x + 5 x^2

In[362]:=

Plot[totalCost[x],{x,0,7000},
     PlotLabel -> "Cost of Saudi Oil Well",
     AxesLabel -> {"x (m)","total cost (riyals)"},
     PlotStyle -> Red];

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_3.gif]

Sioux Lake and the EPA

Hughes-Hallett, Gleason, et al, Exercise 7.1.57, page 347

As another application of the Total Change Theorem,
    "The integral of a rate of change is the total change,"
let's follow the EPA's lead in studying the polution levels at Sioux Lake.
See HHG, exercise 7.1.57, page 347, for more details.

In[363]:=

initialRate = 16  (*yds^3/yr*) ; <br /> rate[t_] := initialRate/;t≤3 rate[t_]  ... abel {"t (yrs)", "rate (cu yds/yr)"}, PlotStyleRed] ;

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_5.gif]

In[367]:=

Solve[ t^2 - 14t + 490, t]

Out[367]=

{{t7}, {t7}}

In[368]:=

NIntegrate[rate[t],{t,0,7}]

Out[368]=

69.3165

Lorenz Curves and the Distribution of Income:
The Coefficient of Inequality

Stewart, Exercise 5.3.61, page 378-379

Let's calculate the coefficient of inequality for a country that has as its Lorenz curve the polynomial
lorenz[x_] = 5/12 x^2+7/12 x.
See Sewart, exercise 5.3.61 for details.

In[369]:=

Clear[f, x] ; <br /> lorenz[x_] := 5/12 x^2 + 7/12 x ; diagonal[x_] := x ; <br /> Plot[{lorenz[x], diagonal[x]}, {x, 0, 1}, PlotStyle {Orchid, Red}] ;

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_10.gif]

The coefficient of inequality is twice the area between the graphs of diagonal[x] and lorenz[x] over the interval [0,1].

In[373]:=

coefficientOfInequality = 2 ∫_0^1 (diagonal[x] - lorenz[x]) x

Out[373]=

5/36

US Energy Consumption

Hughes-Hallett, Gleason, et al, First Edition, Exercise 7.2.44, page 354
Hughes-Hallett, Gleason, et al, Second Edition, Exercise 7.1.44, page 327

To find the average energy consumption in the USA over the course of the twentieth century, integrate the energy consumption function over that 100 year period, and then devide by the total elapsed time (100 years).

In[374]:=

Clear[electricityConsumption,yr]

energyIn1900   = 1.4        (* million megawatt-hours *);
continuousRate = 0.07       (* % per yr *);

electricityConsumption[yr_] := energyIn1900 Exp[continuousRate yr]

Plot[electricityConsumption[yr],{yr,0,100},
     PlotLabel -> "Electricity Consumption since 1900",
     AxesLabel -> {"yr (since 1900)","consumption (million megawatt-hours)"},
     PlotStyle -> Red];

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_13.gif]

In[379]:=

averageConsumption = Integrate[electricityConsumption[yr],{yr,0,100}] / 100

Out[379]=

219.127

When was the energy consumption in the USA equal to that 100 year average?

In[380]:=

Solve[electricityConsumption[yr] == averageConsumption, yr]

Solve :: ifun : Inverse functions are being used by Solve, so some solutions may not be found; use Reduce for complete solution information.  More…

Out[380]=

RowBox[{{, RowBox[{{, RowBox[{yr, , 72.1883}], }}], }}]

Lets plot that time (as a green dot) on the energy consumption curve.
If the region under the graph of the red function were a laminar sheet of ice in a thin aquarium, and all that ice were to melt, would the resulting melt water come up to the level of the green dot?

In[381]:=

Plot[electricityConsumption[yr],{yr,0,100},
     PlotLabel -> "Electricity Consumption since 1900",
     AxesLabel -> {"yr (since 1900)","consumption (million megawatt-hours)"},
     PlotStyle -> Red,
     Epilog->{PointSize[0.025],Green,
              Point[{72.18,electricityConsumption[72.18]}]}];

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_17.gif]

Launch of the Space Shuttle Endeavour

Stewart, Exercise 5.3.62, page 379

First of all, recall the discussion dealing with the launch of the Space Shuttle Endeavour from Stewart, Section 4.2, and our associated Mathematica notebook.
We will plot the velocity data for the first 125 seconds of that launch, find an interpolating function which fits the velocity data, and then integrate the velocity of the shuttle, as represented by that interpolating function, to find the position of the shuttle at the end of its 125 second burn.

We are keeping track of the timing of certain specific events that occur during the first 125 seconds of a launch of the Space Shuttle Endeavour.
The table shown below records the timing of those events, and the corresponding velocities of the Space Shuttle Endeavour for a specific launch.
See Stewart, Exercise 4.2.54, for details.

In[382]:=

Clear[vs, ts, data, dots, dotPlot, interp, approximation, y, curvePlot]  vs = {0, 185, ... p;  TableHeadings {{"t (sec)", "velocity (ft/sec)"}, None}]

Out[386]//TableForm=

t (sec) 0 10 15 20 32 59 62 125
velocity (ft/sec) 0 185 319 447 742 1325 1445 4151

Let's plot those points.

In[387]:=

dots = Transpose[data] ;  RowBox[{RowBox[{dotPlot,  , =,  , RowBox[{ListPlot, [, RowBo ... bsp; , AxesLabel  {"t (sec)", "velocity (ft/sec)"}}], ]}]}], ;}]

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_20.gif]

Now construct a cubic polynomial to approximate that data ...

In[389]:=

interp = Fit[dots, {1, x, x^2, x^3}, x]

Out[389]=

RowBox[{RowBox[{-, 21.2687}], +, RowBox[{24.9817,  , x}], -, RowBox[{0.115534,  , x^2}], +, RowBox[{0.00146137,  , x^3}]}]

In[390]:=

approximation[y_] := (interp /. x  y)  curvePlot = Plot[approximation[y], {y,  ... nbsp;   AxesLabel  {"t (sec)", "velocity (ft/sec)"}] ;

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_24.gif]

... and graph the polynomial and the data to verify that we have a reasonable correspondence.

In[392]:=

Show[curvePlot, dotPlot] ;

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_26.gif]

Now let's use the approximating poynomial to find a model for the acceleration of the shuttle.

In[393]:=

                                                                                               ...      AxesLabel  {"t (sec)", acceleration (ft/ sec )}] ;

[Graphics:HTMLFiles/5.3_evaluatingIntegrals_28.gif]

Use this picture to estimate the maximum and minimum values of the acceleration during the first 125 seconds of the launch.

We can estimate the height of the Shuttle Endeavour 125 seconds after liftoff by integrating its velocity function from 0 to 125 (seconds).
Actually, we are estimating the arclength of the shuttle's trajectory up to that point. If the shuttle were climbing directly upwards for the entire 125 seconds, we would have calculated its height. But the data indicate that the shuttle completed its roll maneuver 15 seconds after launch, and it separated from its solid rocket booster at 125 seconds. If the shuttle were still directly over Cape Canaveral, the people down below would have to watch out for a falling solid rocket booster!

In[394]:=

height = Integrate[approximation[y], {y, 0, 125}] feet

Out[394]=

RowBox[{206489.,  , feet}]


Created by Mathematica  (April 20, 2004)