• No results found

Using second-order derivatives

In document Calculus (Page 118-122)

One-variable optimisation

4.3 Using second-order derivatives

as 10− p > 0 since 0 ≤ p ≤ 10. This means that demand is elastic if p > 5 and, in particular, if we have 5 < p ≤ 10 a small increase in price will lead to a decrease in revenue.

For (b), similar reasoning shows us that demand is inelastic if p < 5 and, in

particular, if we have 0≤ p < 5 a small increase in price will lead to an increase in revenue.

4.3 Using second-order derivatives

The second-order derivative of a function can allow us to infer useful information about the shape of a function. For instance, they can allow us to infer whether a stationary point is a local maximum or a local minimum and, more generally, whether the function is convex or concave. Indeed, once we understand convexity and concavity, we will be in a position to extend our understanding of what we mean by a point of inflection.

4.3.1 Second-derivatives and stationary points

The key to understanding the link between the shape of a function and its

second-derivative is the second-order Taylor approximation to f (x) around x = a, i.e.

f (x) = f (a) + (x− a)f0(a) +(x− a)2 2 f00(a),

and we know that this is a good approximation as long as x− a is small. Now, to start with, let’s suppose that f (x) has a stationary point at x = a, i.e. f0(a) = 0, so that our second-order Taylor approximation becomes

f (x) = f (a) +(x− a)2

2 f00(a) =⇒ f (x)− f(a) = (x− a)2 2 f00(a).

Here, for all x near the stationary point, the sign of f (x)− f(a) on the left-hand-side, i.e. the relative magnitude of f (x) and f (a), is determined by the sign of f00(a) on the right-hand-side. That is, the sign of f (x)− f(a) for x near the stationary point is determined by the value of the second-order derivative at the stationary point. Indeed, we see that:

If f00(a) > 0, then f (x) > f (a) for all x near to a and so the function always lies above the horizontal tangent line at x = a. This means that the stationary point is a local minimum as in Figure 4.5(c).

If f00(a) < 0, then f (x) < f (a) for all x near to a and so the function always lies below the horizontal tangent line at x = a. This means that the stationary point is a local maximum as in Figure 4.5(b).

Thus, the sign of the second-order derivative at a stationary point allows us to infer whether the stationary point is a local maximum or a local minimum. When we classify stationary points in this way, we call it the second-order derivative test. However, observe that if f00(a) = 0, then the second-order Taylor approximation tells us nothing useful about the shape of the function as it reduces to f (x) = f (a).

4

4.3. Using second-order derivatives

Example 4.4 Use the second-order derivative test to classify the stationary points of the function in Example 4.1.

We saw in Example 4.1 that the first-order derivative of f is f0(x) = 3x2− 4x − 15,

and, in Example 4.2, we saw that its stationary points occur when x =−5/3 and x = 3. To use the second-order derivative test, we note that

f00(x) = 6x− 4, and then use the fact that

when x = −5/3, f00(x) =−14 < 0 and so this is a local maximum, when x = 3, f00(x) = 14 > 0 and so this is a local minimum, in agreement with what we found in Example 4.2.

4.3.2 Convex and concave functions

More generally, the sign of the second-order derivative of a function tells us whether a function is convex or concave. Indeed, we find that:

If f00(x) > 0 on some interval, we say that f is convex on that interval.

If f00(x) < 0 on some interval, we say that f is concave on that interval.

To get an idea of what this means, consider that a convex function on an interval, I, has f00(x) > 0 for all x∈ I. So, if we take any particular point, say a ∈ I, the tangent line to f at x = a has an equation given by

y = f (a) + (x− a)f0(a),

and so, our second-order Taylor approximation can be written as f (x) = y + (x− a)2

2 f00(a).

Now, as f00(a) > 0 (recall that a∈ I too), we see that f(x) > y for all x ∈ I where x6= a, i.e. these values of f always lie above the values from the tangent line to f at x = a, as illustrated in Figure 4.6(a). But, of course, we can use any a∈ I when we run this argument and so a convex function is one which lies above all of its tangent lines, as illustrated in Figure 4.6(b). In particular, a function must be convex in the

neighbourhood of a local minimum.

A similar argument can be given to show that a concave function always lies below all of its tangent lines so that, in particular, a function must be concave in the

neighbourhood of a local maximum.

4

O x

y = f (x) y

x a

f (x) y

T

O x

y = f (x) y

(a) f lies above the tangent at a∈ I (b) f lies above all its tangent lines Figure 4.6: The relationship between a convex function and its tangent lines. (a) When changing the value of x, we can see that the values of f (x) are greater than the corresponding values of y from the tangent line to f at a, i.e. f lies above this tangent line. (b) By changing the value of a, we can see that f lies above all of its tangent lines.

Activity 4.1 Using an argument similar to the one above, explain why a concave function always lies below all of its tangent lines.

This gives us another, more visual, way of deciding whether a function is convex or concave, namely:

A function is convex on some interval if it lies above all of its tangent lines in that interval.

A function is concave on some interval if it lies below all of its tangent lines in that interval.

And, we can see how this all works by continuing with our example.

Example 4.5 Determine the intervals on which the function in Example 4.1 is (a) convex and (b) concave.

In Example 4.3 we saw that the second-order derivative of the function from Example 4.1 is given by

f00(x) = 6x− 4, so we find that

f00(x) > 0 when 6x− 4 > 0 which means that x > 2/3, and f00(x) < 0 when 6x− 4 < 0 which means that x < 2/3.

This means that the function is convex on the interval x > 2/3 where f00(x) > 0 and concave on the interval x < 2/3 where f00(x) < 0 as illustrated in Figure 4.2(b).

Indeed, when looking at this figure, observe that when x > 2/3 the function lies above all of its tangent lines in that interval and that when x < 2/3 the function lies below all of its tangent lines in that interval.

4

4.3. Using second-order derivatives

4.3.3 Points of inflection

Not all points of inflection are stationary points like the ones we saw in Section 4.2.2.

More generally, a point of inflection is a point where a function changes from being convex to concave (or vice versa) in a certain well-defined way. Technically, we say that:

If f00(a) = 0 and f00(x) changes sign at x = a, then f has a point of inflection at a.

As such, we can see that the points indicated in Figure 4.7 as well as the ones we saw earlier in Figure 4.5(a) and (d) are points of inflection although, of course, only the ones in Figure 4.5(a) and (d) are stationary points as well.

O a x

y

y = f (x) T

O a x

y

T

y = f (x)

(a) (b)

Figure 4.7:A point of inflection where f changes from (a) convex to concave at a and (b) concave to convex at a. In particular, observe that neither of these points of inflection is a stationary point because neither of them have a horizontal tangent line, i.e. f0(a) 6= 0 in both cases.

Example 4.6 Find any points of inflection of the function in Example 4.1.

We saw in Example 4.4 that the second-order derivative changes sign when x = 2/3 and, furthermore, we can see that f00(2/3) = 0. This means that the function in Example 4.1 has a point of inflection when x = 2/3.

Indeed, looking at Figure 4.2(b), we can see that when x = 2/3, the function changes from being concave to convex as we should expect from a point of inflection.

However, this point of inflection is not a stationary point because f0(x)6= 0 when x = 2/3.

It is, perhaps, worth stressing that the condition f00(a) = 0 on its own is not enough to guarantee that we have a point of inflection. For instance, the two functions illustrated in Figure 4.8 both have f00(0) = 0, but in neither case does the second derivative change sign and so we do not have a point of inflection.

Activity 4.2 Show that f00(0) = 0 for both of the functions illustrated in Figure 4.8. How can we infer that they have those shapes by looking at (a) the first-order derivative and (b) the second-order derivative of the function?

4

(a) f (x) = x4− 1 (b) f (x) = 1− x4

Figure 4.8: Both of these functions have f00(0) = 0 but neither of them have a point of inflection. (a) This is convex on both sides of x = 0 and the function has a local minimum at that point. (b) This is concave on both sides of x = 0 and the function has a local maximum at that point. (The dashed curves in these figures represent the curves y = x2− 1 in (a) and y = 1 − x2 in (b) for comparison).

It is also worth noting that the condition that f00(x) changes sign at x = a on its own is not enough to guarantee that we have a point of inflection either. Of course, if f00(x) is changing sign at x = a and f00(a) exists, we must have f00(a) = 0. But, although we do not dwell on it here, sometimes we may encounter functions where f00(a) does not exist even though f00(x) changes sign at x = a. We will briefly consider what happens in these cases when we look at cusps and asymptotes in Section 4.4.3.

In document Calculus (Page 118-122)