Given an integrable rate function for some quantity, the definite integral allows us to create a function that could describe the accumulation of that quantity at any point in time in the domain over which the rate function is integrable.
The definite integral notation gives us a way to write a “formula” for the accumulation function
In each of the values of
examined in
Example 6.4.1, the lower bound of integration was our fixed starting time
and the upper bound of integration was the new ending time for the time interval over which we wished to measure the accumulation. This ending time is our
independent variable for the function
However, we have a notational problem — we are also using
as the input variable of our rate function. The
in
in the definite integral
represents a variable time
between and
and the
represents a miniscule time period duration, so the
in
and
in the integral notation are serving much different purposes than the
in
To separate these roles, we’ll choose a different letter for the independent variable in the rate function when we choose to have a variable upper bound of integration.
Also, we used the subscript
on the function
in
Example 6.4.1 to we indicate that all of the accumulations that we calculated were over a time period beginning at
However, there will be instances where we want to measure accumulation from a different starting time other than
in which case we can just change that subscript.
As a “formula” for an accumulation function, a definite integral is not very convenient — computing a definite integral requires examining patterns of upper and lower sums, which is not so easy if the upper bound of integration is a variable. Luckily Sage can also handle this for us.
Example 6.4.3. Using Sage to compute an accumulation function formula.
Let’s return once again to the example of some quantity whose variation is modelled by the rate function
as in
Example 6.2.2 and
Example 6.3.10. Swapping
for
in our rate function so that
can act as the variable upper bound of integration, our accumulation function (with fixed starting time
) becomes
Recall that the Sage integration command format is
integrate(integrand, variable, start, end)
. In this format,
variable
means the letter being used as the integrand function’s independent variable, so here we use
u
in that spot. But our
end
value is also variable, so we’ll have the letter
there instead of a number like before.
Our lower and upper sum calculations in
Example 6.2.2 hinted that
was likely to be
Our Sage calculation in
Example 6.3.10 confirmed the value of
to be
and substituting
into the formula returned by Sage above gives the same result.
Finally, we will do one example of using Riemann sums to calculate an actual formula for an accumulation function, though in practice we will not often return to “first principles” to carry out calculations.
Example 6.4.6. Using Riemann sums to compute an accumulation function formula.
Let’s return to the rate function
from
Example 6.2.2 over a time domain beginning at
but this time we will leave the upper bound on this time domain as a variable, in order to obtain an accumulation function in terms of this domain end point instead of just a single accumulation value. Because we want to be able to mimic the calculations from
Example 6.2.2, instead of changing the letter for the independent variable in the rate function
instead we will use the letter
for the variable endpoint of the domain.
Again, the graph of this rate function always goes up as you move to the right, so a left Riemann sum will compute the lower sum and a right Riemann sum will compute the upper sum. Our analysis here is almost identical to that from
Example 6.2.2, except that our subdomain widths are dependent on
(where we are still using
as the start of the time domain). Just as before, beginning at the left-most subdomain boundary,
each subsequent subdomain boundary should be
past the previous one, so that the pattern of boundaries is
Recall that
is the first left-endpoint and
is the first right-endpoint. So similar to
Example 6.2.2, the pattern of left- and right-endpoints is as follows.
We can now set up our upper and lower Riemann sums:
The sage cell below is set up to compute both the lower and upper sums, with the number of steps
left as a parameter you can change. (The
polynomial(RR)
part tells Sage to interpret the result as a polynomial with
Real coefficients.) Increase
a few times, an order of magnitude at a time, until you can see a pattern emerging, with subsequent lower and upper sum results “squeezing” to a formula for the accumulation function (with independent variable
instead of
).