Consider the function f defined below.
> f:=x->1/72*x^9-3/14*x^8+53/42*x^7-10/3*x^6+51/20*x^5+19/3*x^4-35/2*x^3+18*x^2;
Let us plot the function on some reasonable window.
> plot(f,-1.5..4.7);
From this window, it appears that there are inflection points near
and
. How can we find these inflection points exactly? The solution is to look at the second derivative of
f.
> d2:=(D@@2)(f)(x);
Notice that this is a seventh degree polynomial, so we expect that it should have seven zeros. Of course, some of the zeros could be complex, and some zeros may have a multiplicity larger than 1, so knowing the degree of the polynomial is not enough to determine how many inflection points there are. Let us solve for the zeros of the second derivative. Factoring is one way to find them, but is not always successful. Because we cooked this problem up to illustrate some interesting features, factoring does work in this case.
> factor(d2);
The zeros of the second derivative are
,
,
, and
. Notice that there are more zeros of the second derivative than those corresponding to the inflection points we could see by eye. Actually, the
behavior of the function does look a little unclear between
and
. So how do we discover what the real answer is? The method is to
look at the second derivative near the zeros, and use the definition of a
point of inflection
. This definition says that a point
P
on a curve is a point of inflection if the concavity switches at that point. The concavity is up when the second derivative is positive, and down when the second derivative is negative. So let us plot the second derivative to see where the concavity switches.
> plot(d2,x=-1.1..4.2);
The sign of the second derivative switches at
,
, and at
. If you look closely at the graph, you will see that the concavity switches from down to up at this value of
x
. Note that the concavity does not switch at
, even though it is a zero of the second derivative. Thus you really have to graph the second derivative, or make a sign chart for it, to see whether a zero of the second derivative is an inflection point of the function.
Submission:
Consider the function
.
(a) Use the graph of f to give a rough estimate of the intervals of concavity and the coordinates of the points of inflection.
(b) Use the graph of the second derivative of f to get even better estimates.
Submission worksheet:
2. Concavity and Points of Inflection.
Consider the function
. To find possible points of inflection, we find the values of the independent variable
, where the second derivative is equal to zero. In this example, we can proceed as follows:
> f:=x->x^3-3*x+1;
> D(D(f))(x);
> solve( D(D(f))(x)=0,x );
We can see from the second derivative,
, that it will be negative for negative values of
x
, and positive for positive values of
x
. Hence it will be concave down on (
) and concave up on (
).
We can now get a good visual illustration of the intervals of concavity by the following commands:
> g1:=plot(f(x),x=-2..0,style=line,color=green,thickness=2):
> g2:=plot(f(x),x=0..2,style=point,color=red):
>
with(plots):
display(g1,g2);
Warning, the name arrow has been redefined
Submission:
Produce similar graphs for the following functions. Also, show your work in solving for the inflection points.
(a)
(b)
Submission worksheet:
3. Using the Second Derivative to compute Intervals of Concavity.
For this activity consider the function
Submission:
Plot the second derivative of this function and use the plot to estimate its zeros to within one decimal place. ( It may help you to note that if you click on the graph, and then click on a point on the graph, the approximate coordinates of the point are displayed in the upper left hand corner of the screen .) From these estimates, do a graph of the function in the same style as in problem 2, using style, thickness and color to emphasize the different concavity (the line style is important when we print out your lab). Also write a couple of sentences explaining why we need to settle for estimates, instead of exact, symbolic answers.
Submission worksheet:
4. The Second Derivative, Inflection Points and Local extrema.
Consider the function given by
> f:=x->4*x^3+21*x^2+36*x-20;
Let us first plot the function to see what the shape of its graph suggests.
> plot(f);
It is very hard to see what is happening when f(x) is small, because the scale is so large. It does appear that the function does not have any local extrema outside of the interval from -4..2, where we can't really see what is going on. Let us plot the function over this smaller domain.
> plot(f,-4..2);
Still, it is hard to determine if there are any local extrema from the graph. Why don't we see where the first derivative vanishes to find the critical values.
> D(f)(x);
> solve(D(f)(x)=0);
Now there are 2 critical values, and we can easily determine whether they are local maxima or minima by using the Second Derivative Test for Local Extrema.
> (D@@2)(f)(x);
> (D@@2)(f)(-2); (D@@2)(f)(-3/2);
Since the second derivative is negative at
,
f
has a local maximum there. Since the second derivative is positive at
,
f
has a local maximum there. Let us also determine where there is an inflection point.
> solve((D@@2)(f)(x)=0);
From this information, we know that there may be an inflection point at
. To determine for sure, we need to check to see if the concavity changes at this point. But
, when
, and
, when
, so the curve switches from concave down to concave up, and the possible point of inflection really is a point of inflection.
> plot(f,-4..2);
> D(f)(x);
> solve(D(f)(x)=0);
> (D@@2)(f)(x);
We can also study the derivative a bit more to determine when the function is increasing and decreasing. Since the derivative is a quadratic vanishing at
and
, it is negative in the open interval (
), which means the function is decreasing in this interval, and is positive in the intervals (
) and (
), so that the function is increasing on these intervals. To get a better picture which shows the point of inflection and the extrema, let us plot the function over a small domain including the interval (
).
> plot(f,-2.1..-1.4);
At this scale, we see the behavior of the function much better in the important region.
Submission:
Graph the following functions and determine the intervals on which the function is:
(a) increasing
(b) decreasing
(c) concave up
(d) concave down
then locaer and identify any
(e) local extreme values
(f) inflection points
1.
2.
5. More on First and Second derivatives and the graph of a function.
Consider the function
> f:=x->x^4-4*x^3+10;
Let us see what we can tell about the graph based on information about its first and second derivatives. First, from the first derivative
> D(f);
we can find the critical values easily by factoring.
> factor(D(f)(x));
The critical values are at
and
. From the factored form of the derivative, it is clear that
only when
. Thus we see immediately that the function is decreasing on the intervals (
) and (
), which means by the first derivative test, that
is not a relative extreme of the function, but
corresponds to a local minimum of the function.
Next, we look at the second derivative.
> (D@@2)(f)(x);
> factor(%);
There are zeros of the second derivative at
and
. Because the multiplicity of these zeros is one, it is easy to see that the concavity does switch at each of these points. In fact, the second derivative is negative only on the interval (
), so the concavity is up in the interval (
), down in the interval (
) and up in the interval (
). Thus both
and
correspond to inflection points. We could also have used the second derivative test to determine whether the critical values for the function correspond to local extrema.
> (D@@2)(f)(0);(D@@2)(f)(3);
Since the second derivative is zero at
, the second derivative test fails, and we have to use the first derivative test to determine if it is a local extremum. Since the second derivative is positive at
, this means there is a local minimum there. Let us graph the function and its first and second derivatives..
> plot([f,D(f),(D@@2)(f)],-2..4,color=[red,blue,green]);
From the graph alone, we can determine roughly where the derivative and second derivative vanish, and their signs as well. Although much of the information seems to be visible in the graph of f alone, it is easier to determine the inflection points by looking at the graph of the second derivative, and we saw in the previous activity that sometimes the graph of f may have extrema which are not so easy to spot.
Submission:
Graph the function
and its first two derivatives on the same axes. Comment on the behavior of
in relations to the signs and values of
''.
6. Again, more on First and Second derivatives and the graph of a function.
Let's consider the function
,
where
k
is a constant, on the domain [
]. By plotting the function determined by various values of
k
, we will get an impression of how changing the value affects the shape of the graph. Then by studying the discriminant of the second derivative, we will determine exactly how the shape of the graph is related to the value of
k.
Submission:
(a) On the same set of axes graph the function
over the interval [
] , and for
, and some nearby balues of
. How does the value of
seem to affect the shape of the graph?
(b) Find
f
''(
). As you will see,
f
''(
) is a quadratic function of
. What is the discriminant of this quadratic? Fsor what values of
is the discriminant positive? Zero? Negative? For what values of
does
f
''(
) have two zeros? one or no zeros? Now explain what the value of
has to do with the shape of the graph of
f
.
Submission worksheet:
>
7. Relating the derivative to the second derivative .
Suppose that the
derivative
of a function
is the function
given below.
> g:=x->x^3-abs(x^2-3*x+1);
Let us plot the function over a reasonable domain, and determine what we can say about the original function f and its second derivative.
> plot(g,-1..1.25,-.3..0.2);
First note that the function is decreasing from
till around
, where it has a local minimum. Then the function increases, with the slope reaching a maximum near
, and then the function reaches a local maximum at around
, after which it decreases, with the greatest rate of descent around
, and the function has a local minimum near
, after which the function is increasing. Note that the derivative is increasing from
till about
. so the graph is concave up until then, and since the derivative is decreasing from
till around
, the graph is concave down on this interval, and there is an inflection point near
. There is also an inflection point near
, since the concavity switches from concave down to concave up, because the derivative is increasing from near
to the limit of our graph.
Note that the inflection point near
is a point at which the second derivative fails to exist, so we can not solve for it by simply setting
. However, this point is where the absolute value is zero, so we can still find it as follows.
> solve(x^2-3*x+1);
> evalf(3/2+1/2*sqrt(5)),evalf(3/2-1/2*sqrt(5));
The value
is approximately equal to
, so this is the x-coordinate of the first inflection point in our picture. Note that the second value is outside our picture, but suggests that we should plot the derivative near that value as well to see the whole picture for the function. Let us plot the derivative near this value, to see what is going on.
> plot(g,2.618033989-.01..2.618033989+0.01);
Notice that the derivative does have a cusp at the point in question, so the second derivative does not exist there, but the derivative does not switch from increasing to decreasing, so the concavity does not change at
. This is not a point of inflection.
Next, we can find the other inflection point by setting the second derivative equal to zero.
> solve(D(g)(x));
> evalf(-1/3+1/3*sqrt(10));
This is the other x -coordinate of an inflection point.
In conclusion, we have found two inflection points, and three local extrema for our function, and all of this information can be read directly from the graph of the derivative of the function.
Submission:
Suppose that you know that the derivative
of a function
f
is given by
. Analyze the graph of the derivative to determine all relative extrema, intervals of concavity, and inflection points for the function
f
.
Submission worksheet:
>
>
>