34 Change & accumulation
Every 10 years, starting in 1790, the US Census Bureau carries out a constitutionally mandated census: a count of the current population. The overall count as a function of year is shown in Figure 34.1. [Source]
In the 230 years spanned by the census data, the US population has grown 100-fold, from about 4 million in 1790 to about 330,000,000 in 2020.
It is tempting to look for simple patterns in such data. Perhaps the US population has been growing exponentially. A semi-log plot of the same data suggests that the growth is only very roughly exponential. A truly exponential process would present as a curve with a constant derivative, but the derivative of the function in the graph is decreasing over the centuries.
Insofar as the slope over the semi-log graph is informative, it amounts to this quantity:
This is the per-capita rate of growth, that is, the rate of change in the population divided by the population. Conventionally, this fraction is presented as a percentage: percentage growth in the population per year, as in Figure 34.2.
The dots in the graph are a direct calculation from the census data. There is a lot of fluctuation, but an overall trend stands out: the population growth rate has been declining since the mid-to late 1800s. The deviations from the trend are telling and correspond to historical events. There is a relatively low growth rate seen from 1860 to 1870: that is the effect of the US Civil War. The Great depression is seen in the very low growth from 1930 to 1940. Baby Boom: look at the growth from 1950-1960. The bump from 1990 to 2000? Not coincidentally, the 1990 Immigration Act substantially increased the yearly rate of immigration.
If the trend in the growth rate continues, the US will reach zero net growth about 2070, then continue with negative growth. Of course, negative growth is just decline. A simple prediction from Figure 34.2 is that the argmax of the US population—that is, the year that the growth rate reaches zero—will occur around 2070.
How large will the population be when it reaches its maximum?
In Block 2, we dealt with situations where we know the function
The process of figuring out
In this block we will explore the methods for calculating anti-derivatives and some of the settings in which anti-derivative problems arrive.
34.1 Accumulation
Imagine a simple setting: water flowing out of a tap into a basin or tank. The amount of water in the basin will be measured in a unit of volume, say liters. Measurement of the flow
There is a relationship between the two functions
Other examples of accumulation and change:
- velocity is the rate of change of position with respect to time. Likewise, position is the accumulation of velocity over time.
- force is the rate of energy with respect to position. Likewise energy is the accumulation of force as position changes.
- deficit is the rate of change of debt with respect to time. Likewise, debt is the accumulation of deficit over time.
34.2 Notation for anti-differentiation
For differentiation we are using the notation
- The
symbol which identifies the operation as partial differentiation. - The name of the with-respect-to input
written as a subscript to . - The function to be differentiated,
.
For anti-differentiation, our notation must also specify the three pieces of information. It might be tempting to use the same notation as differentiation but replace the
Convention has something different in store. The notation for anti-differentiation is
For those starting out with anti-differentiation, the conventional notation can be confusing, especially the
Think of the
Remember that just as
34.3 R/mosaic notation
Recall that the notation for differentiation in R/mosaic is D(f(x) ~ x)
. The R/mosaic notation for anti-differentiation is very similar:
D(f(x) ~ x)
This has the same three pieces of information as
D()
signifies differentiation whereasantiD()
signifies anti-differentiation.~ x
identifies the with-respect-to input.f(x) ~
is the function on which the operation is to be performed.
Remember that just as D(f(x) ~ x)
creates a new function out of f(x) ~ x
, so does antiD(f(x) ~ x)
.
34.4 Dimension and anti-differentiation
This entire block will be about anti-differentiation, its properties and its uses. You already know that anti-differentiation (as the name suggests) is the inverse of differentiation. There is one consequence of this that is helpful to keep in mind as we move on to other chapters. This being calculus, the functions that we construct and operate upon have inputs that are quantities and outputs that are also quantities. Every quantity has a dimension, as discussed in Chapter 16. When you are working with any quantity, you should be sure that you know its dimension and its units.
The dimension of the input to a function does not by any means have to be the same as the dimension of the output. For instance, we have been using many functions where the input has dimension time and the output is position (dimension L) or velocity (dimension L/T) or acceleration (dimension L/T
Imagine working with some function
The function
The output of the function
How about the dimension of the anti-derivative
Consequently,
To summarize:
- The dimension of derivative
will be . - The dimension of the anti-derivative
will be .
Or, more concisely:
Differentiation is like division, anti-differentiation is like multiplication.
Paying attention to the dimensions (and units!) of input and output can be a boon to the calculus student. Often students have some function
To illustrate, imagine that you have constructed
Dimension of result | Calculus operation |
---|---|
M / T | differentiate |
M T | anti-differentiate |
M | find max or min |
T | find argmax/argmin or a function zero |
M T |
anti-differentiate twice in succession |
M / T |
differentiate twice in succession |
For example, suppose the output of the accelerometer on your rocket has dimension L / T
34.5 From Calculus Made Easy
Calculus Made Easy, by Silvanus P. Thompson, is a classic, concise, and elegant textbook from 1910. It takes a common-sense approach, sometimes lampooning the traditional approach to teaching calculus.
Some calculus-tricks are quite easy. Some are enormously difficult. The fools who write the textbooks of advanced mathematics—and they are mostly clever fools—seldom take the trouble to show you how easy the easy calculations are. On the contrary, they seem to desire to impress you with their tremendous cleverness by going about it in the most difficult way. — From the preface
Thompson’s first chapter starts with the notation of accumulation, which he calls “the preliminary terror.”
The preliminary terror … can be abolished once for all by simply stating what is the meaning—in common-sense terms—of the two principal symbols that are used in calculating.
These dreadful symbols are:
which merely means “a little bit of.”
Thus
which is merely a long , and may be called (if you like) “the sum of.”
Thus
When you see an expression that begins with this terrifying symbol, you will henceforth know that it is put there merely to give you instructions that you are now to perform the operation (if you can) of totaling up all the little bits that are indicated by the symbols that follow.
The next chapter shows what it means to “total up all the little bits” of a function.
34.6 Exercises
Exercise 34.01
Part A What is the name of the with-respect-to input in
y dy x t
Part B What is the name of the with-respect-to input in
y dy x t
Part C What is the name of the with-respect-to input in
y dt x t
Exercise 34.02
Part A Which of the following functions is
Part B Which of the following functions is
Exercise 34.03
Every function has an anti-derivative. But there are many functions, for example antiD()
operator will figure out what is the anti-derivative.
For each of the following functions, use makeFun()
to implement the function as f()
. Then use antiD()
to construct the anti-derivative of f()
and give this the name F()
. Finally, use D()
to compute the derivative of F()
. For instance:
<- makeFun(x*dnorm(x) ~ x)
f <- antiD(f(x) ~ x)
F <- D(F(x) ~ x)
dF slice_plot(f(x) ~ x, bounds(x=0:10)) %>%
slice_plot(dF(x) ~ x, color="blue", size=3, alpha = 0.2)
Part A For the function
4 4.5 5 5.5 6 6.5
Part B For the function
-4 -3.5 -3 -2.5 -2
Part C For the function
35 37 39 41 43
Exercise 34.04
In the population prediction model at the start of the chapter we want to find a function
We want to figure out
Step 1: Anti-differentiate the functions on both sides of the equation. Anti-differentiation has the effect of cancelling out the
Task 1: Confirm that
Step 2: From Step 1 we have translated the relationship between population and year into this form:
Task 2: Exponentiate both sides of the newly framed relationship to get
Step 3: Let’s declare that
Task 3: Find the census estimate of the population in 2020 and use that information to estimate the parameter
Step 4: The per-capita growth rate is
Task 4: You now have numerical estimates for the parameters
# Fill in your estimates for A, a, and b.
<- makeFun(A*exp(a*y - b*(y^2)) ~ y,
P a = ____, b = ____, A = ____)
# y = 200 is year 2220.
slice_plot(P(y) ~ y, bounds(y=c(0,200)))
# At y=200, the estimate is 50 M
Exercise 34.05
The graph shows a function
One and only one is the anti-derivative of the function shown in the graph. Which one?
<- rfun(~ x, seed = 782)
F1 <- rfun(~ x, seed = 934)
F2 <- rfun(~ x, seed = 297)
F3 <- rfun(~ x, seed = 892) F4
NOTE: rfun()
is a program that generates functions, a different one for each seed
. It has been used here to generate F1()
through F4()
for you to use. Once you run those four lines in your sandbox, you can use slice_plot()
in the usual way to plot out any of the four functions over the domain
Part A Confirming graphically that a candidate
- anti-differentiate
- differentiate
- compose
with itself - multiply
times $f(x)
Part B Which one of the functions is an anti-derivative of the function graphed above? (Hint: See the next problem.)
F1()
F2()
F3()
F4()
Problem with Accumulation Exercises/frog-choose-coat.Rmd
Exercise 34.07
Part A What is the anti-derivative of Force with respect to distance?
Acceleration Work/Energy Momentum Power
Part B What is the anti-derivative of Velocity with respect to time?
Momentum Displacement Power Acceleration