5.3 Evaluating Definite Integrals

Mathematica script by Chris Parrish,

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.




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

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


1000000 + 4000 x + 5 x^2


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


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.


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



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


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





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.


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}] ;


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


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



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).



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

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

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



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



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


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…


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?


     PlotLabel -> "Electricity Consumption since 1900",
     AxesLabel -> {"yr (since 1900)","consumption (million megawatt-hours)"},
     PlotStyle -> Red,


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.


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


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.


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


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


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


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


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


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


Show[curvePlot, dotPlot] ;


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


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


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!


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


RowBox[{206489.,  , feet}]

Created by Mathematica  (April 20, 2004)