21 Concavity and curvature
It is an easy visual task to discern the slope of a line segment. A glance shows whether the slope at that point is positive or negative. Comparing the slopes at two locales is also an automatic visual task: most people have little difficulty saying which slope is steeper. One consequence of this visual ability: it is easy to recognize whether a line that touches the graph at a point is tangent to the graph.
There are other aspects of functions, introduced in Section 6.2, that are also readily discerned from a glance at the function graph.
- Concavity: We can tell within each locale whether the function is concave down, concave up, or not concave.
- Curvature: Generalizing the tangent line capability a bit, we can do a pretty good job of eyeballing the tangent circle or recognizing whether any given circle has too large or too small a radius.
- Smoothness: We can often distinguish smooth-looking functions from non-smooth ones. However, the trained eye can discern some kinds of mathematical smoothness but not others.
21.1 Quantifying concavity and curvature
It often happens in building models that the modeler (you!) knows something about the concavity or the curvature of a function. For example, concavity is essential in classical economics; the curve for supply as a function of price is concave down while the curve for demand as a function of price is concave up. For a train, car, or plane, sideways forces depend on the curvature of the track, road, or trajectory. Road designers need to calculate the curvature to know if the road is safe at the indicated speed.
It turns out that quantifying these properties of functions or shapes is naturally done by calculating derivatives.
Remember that
We will frame the calculations in terms of a function
21.2 Concavity
Recall that to find the slope of a function
Now we want to show how differentiation can quantify the concavity of a function. First, remember that when we speak of the “derivative” of a function, we mean the first derivative of the function. That full name naturally suggests that there will be a second derivative, a third derivative, and higher-order derivatives.
Figure 21.1 shows a simple function that is concave down.
Notice that the concavity is not about the slope. The curve in Figure 21.1 is concave down everywhere in the domain
As introduced in Chapter ?sec-fun-describing, the concavity of a function describes not the slope but the change in the slope. Figure 21.2 adds some annotations on top of the graph in Figure 21.1. In the subdomain marked A, the function slope is positive, while in the subdomain B, the function slope is negative. This transition from the slope at A to the slope at B corresponds to the concavity of the function between A and B.
Similarly, the function’s concavity in the interval B to C reflects the transition in the instantaneous slope at B to the different instantaneous slope at C.
Let’s look at this using symbolic notation. Keep in mind that the function graphed is
Such a double differentiation of a function
Look carefully to see the difference between the first derivative
Computing the second derivative is merely a matter of computing the first derivative
<- D( f(x) ~ x) # First deriv. of f()
dx_f <- D(dx_f(x) ~ x) # Second deriv. of f() dxx_f
A notation shortcut for the two-step process above: double up on the x
on the right-hand side of the tilde: dxx_f <- D(f(x) ~ x & x)
21.3 Curvature
As you see from Section 21.2, it is easy to quantify the concavity of a function
To illustrate, consider the square function,
The square function is concave up. Now a test: Looking at the graph of the square function, where is the concavity the largest? Don’t read on until you’ve pointed where you think the concavity is largest.
With the answer to the test question in mind, we can calculate the concavity of the square function using derivatives.
$$f(x) x^2
x f(x) = 2 x {xx} f(x) = 2$$
The second derivative of
The concavity-related property that the human eye reads from the function graph is not the concavity itself but the curvature of the function. The curvature of
Figure 21.4 illustrates the changing curvature of
Black dots along the graph at the points indicate where the function graph is tangent to the inscribed circle. The visual sign of tangency is that the function graph goes right down the circle’s center.
The inscribed circle at
The curvature
Mathematically, the curvature
21.4 Exercises
Exercise 21.01
Part A Glance at the graph. In which boxes is the slope negative?
A, B, C B, C, D A, C, D
Exercise 21.02
Part A Consider the slope of the function in the domains marked by the boxes. What is the order of boxes from least steep to steepest?
A, B, C C, A, B A, C, B none of these
Exercise 21.03
Part A Which of the line segments is tangent to the curve at the point marked with a dot?
A B C all of them none of them
Exercise 21.04
Part A Which of the line segments is tangent to the curve at the point marked with a dot?
A B C all of them none of them
Exercise 21.05
Part A In which of the boxes is the function concave up?
A and E B and D C and D
Exercise 21.06
Part A In which boxes is the function smooth?
A and B B and C A and C none of them all of them
Part B In which boxes is the function smooth?
A and B B and C A and C none of them all of them
Part C In which boxes is the function smooth?
A B neither of them both of them
Exercise 21.07
We introduced concavity graphically and used the terms “concave up” and “concave down.” Now we can compute the concavity quantitatively using the second derivative.
In a sandbox, create this function and plot it. (Note: rfun()
generates random functions in the same way you might by moving a pencil smoothly on a piece of paper. The seed = 8427
effectively chooses which one of infinitely many functions is being generated. Different seeds give different functions. )
<- rfun( ~ z, seed = 8427)
f slice_plot(f(x) ~ x, bounds(x=c(-5,5)))
You can see that in the region near
In your sandbox, compute the second derivative of
<- D(f(x) ~ x & x)
dxx_f dxx_f(-1)
dxx_f(2.5)
Using these results, and perhaps experimenting a little with different values of
Part A Which of these is a correct statement of “concave up” in terms of the value of
- A function is concave-up at input
when - A function is concave-up at input
when - A function is concave-up at input
when and - A function is concave-up at input
when and
Recall that an inflection point is a value for the input
Part B From reading the graph of
Part C How many inflection points are there for
1 2 3 4 5
Exercise 21.08
The graph of the function
<- makeFun(sqrt(R^2 - x^2) ~ x, R=2)
g slice_plot(g(x) ~ x, bounds(x=-2:2), npts=300)
Intuition suggests that the radius of an enscribed circle for
Using your R-console, create a function to calculate the curvature of
<- makeFun(sqrt(R^2 - x^2) ~ x, R = 2) # define g()
g <- D(g(x) ~ x) # first derivative of g()
dg <- D(g(x) ~ x & x) # second derivative of g()
ddg <- makeFun(abs(ddg(x)) / abs(__fill_in_the_formula__)^(3/2) ~ x)
curvature slice_plot(curvature(x) ~ x, bounds(x=-2:2))
We set the default value of the parameter
Part A What is the curvature of
0 0.5 1 1.5 2
Exercise 21.09
Here is a graph of
You’re task is to calculate the curvature
Part A What is the curvature
-1 0 0.5 1 2
Part B What is the curvature
-1 0 0.5 1 2
Part C What is the curvature
-1 0 0.5 1 2
Part D What is the curvature
0 0.5 1 2
Exercise 21.10
The function road(x)
has been constructed to correspond to a curved road of gradually tighter radius from left to right
<- makeFun(3 - x/2 ~ x)
R <- makeFun(sqrt(R(x)^2 - x^2) ~ x)
road slice_plot(road(x) ~ x, bounds(x=c(-2, 2)), npts=500)
Using your R console, calculate the curvature of this road for each value of
Part A What is the curvature of the road at
0.22 0.24 0.27 0.31 0.35
Part B What is the curvature of the road at
0.22 0.24 0.27 0.31 0.35
Part C What is the curvature of the road at
0.22 0.24 0.27 0.31 0.35
Exercise 21.11
The picture shows an instantaneous position of the ball. However, such a snapshot does not show the instantaneous velocity of the ball. If you had a few frames of a movie, your intuition would tell you if the ball is likely to go through the hoop. From a movie, you could even calculate a good finite-difference approximation to the instantaneous velocity of the ball.
Assume for the purposes of the following question that the boy, the center of the ball, and the center of the hoop are all in the same plane, as required for a swish shot. Assume as well that when the ball left the boy’s hands it was in the position now occupied by the boy’s head and that there was no spin on the ball. Now the question:
Will the ball swish through the basket?
Use calculus concepts to make a good argument about whether the answer should be “impossible” or “possible.”
Think of the path of the ball as a function
, where is position along the floor and gives the corresponding height of the ball. Draw some intuitively plausible paths. That is, draw graphs of possible functions consistent with the picture and with the assumption that the launch point is marked by the current position of the boy’s head.From the picture you can easily find the line connecting the ball’s current position with the launch point. The slope of this line is the average rate of change of ball height with respect to
.The physics of ball flight (with no spin) requires the function
to be concave down. How does this restrict the set of possible paths?