Curve sketching: convexity and concavity
Convexity and concavity describe how a function curves. The points where a convex function changes into a concave one, or the other way round, are called points of inflection.
What are convex and concave functions?
From the graph it is often obvious at a glance whether a function is concave or convex. A convex function looks like a “dip”, whereas a concave function looks like a hill. People also say you can pour coffee into a convex function. Here are three examples of functions you already know.
How to tell whether a function is convex or concave
Now we need to work out how to tell whether a function is convex or concave on a given interval. For that we need another diagram:
The quadratic function is convex on its whole domain. What do you notice when you look at all the tangents I have drawn in the diagram? For every tangent, all points of the quadratic function lie above it, except for the single point where the tangent touches the graph. We can draw a similar diagram for the opposite function −x2. There the situation is reversed and all the points lie below the tangent:
Before explaining any further, take a look at the following diagram:
The function f(x) = x2 shown here is convex. We already know that for a convex function all points of the graph lie above the tangent. That is satisfied here – we have the tangent t, and the points of the graph lie above it. Now the question is how to calculate that those points lie above the tangent.
We are given a point x0, and at the point (x0, f(x0)) we draw a tangent to the graph, the line t. In the diagram the point with coordinates (x0, f(x0)) is marked by the red point T. Next we choose some other point x on the x-axis. In the diagram it is the green point. For x it must hold that the point (x, f(x)), the green point F in the diagram, lies above the tangent t. Since the function x2 is convex on its whole domain, whichever x in the domain of f we take, (x, f(x)) must lie above the tangent.
How could we write this as a formula? In the diagram we have the tangent t. Let's imagine a linear function t(x) whose graph is precisely the tangent line t. So, for example, the value of the function at the point x0, that is t(x0), would be equal to f(x0), because the functions are equal at this point (their graphs have a common point there).
Now we can express it with formulae. How would we write that the graph of one function lies above the graph of another? Simply as f(x) > t(x). Looking at the diagram: at the point x the tangent lies below the graph, because f(x) > t(x).
Since we know the function f, we also know the values f(x0) and f(x). To find out whether f(x) > t(x), all we need is the length of the purple line segment AB. How do we find it? Well, we know the length of the line segment TA, which is |x − x0|. Unfortunately, we do not know the length of the line segment TB. However, if we work out the derivative of the function at the point x0, we find the slope of the tangent, that is, the tan of the angle the tangent makes with the positive x-axis, and this angle has the same size as the angle ATB, since they are corresponding angles.
Now we know the length of the line segment TA and the size of the angle ATB. Recall that tan is the ratio of the opposite side to the adjacent side, so:
We know
First we rearrange the equation by substituting |x − x0| for the length |TA|:
And for
That gives us the length of the line segment AB. In the diagram x > x0 and the derivative is positive, but in general we write (x − x0) instead of |x − x0| so that the sign comes out right. We can therefore say: the function f is convex at the point x0 if there is some punctured neighbourhood O of the point x0 such that for all x in this neighbourhood O the following holds:
The whole right-hand side of the inequality is in fact equal to the value t(x). If you look at the diagram, when you add the length of the line segment AB to f(x0), you get exactly t(x).
How to find points of inflection
Without proof, we state that the function f(x) is convex at the point x0 if f′′(x0)>0, and concave if f′′(x0)<0. In words, if the second derivative at a point is positive, then the function is convex at that point.
Just as a maximum or minimum separated the decreasing part of a function from the increasing part, points of inflection separate the convex and concave parts of a function. So a point of inflection is a point where the function changes from convex to concave or the other way round. Earlier we said that even if the first derivative is zero at a point, there is not necessarily a maximum or minimum there. There may be a point of inflection instead.
What must hold for a point of inflection? At that point a convex function changes into a concave one (or the other way round), so at that point neither f′′(x)>0 nor f′′(x)<0 can hold. If the function has a second derivative at the point, then f′′(x) = 0 must hold. If f′′(x) = 0 and at the same time f′′′(x) ≠ 0, then there is a point of inflection at x. Example:
Find the points of inflection of the function f(x) = x3. Graph:
We work out the first, second and third derivatives:
We see that f′(x) = 0 for x = 0, and likewise f′′(0) = 0. The second derivative of the function is zero at the point 0. The third derivative, however, is positive, and so non-zero. The function has a point of inflection at x = 0. From the graph we see that it changes from concave to convex.
Chapters: Curve sketching, Curve sketching: extrema, Curve sketching: increasing and decreasing functions, Curve sketching: convexity and concavity