Second derivative¶
Part 4 · Derivatives · Chapter 7 · lecture notes by Fabio Furini · Chapter PDF
1. Second derivative and second derivative function¶
- We can now ask whether the function \(f' (x)\) is in turn differentiable (at a point or on an interval).
Definition 1: second derivative
Let \(f: (a, b) \rr \R\), \(x_0 \in (a, b)\) and \(f':(x_0-\delta, x_0+\delta) \rr \R\) with \(\delta >0\); \(f\) is said to be twice differentiable at \(x_0\) if the following limit exists and is finite
this limit is called the second derivative of \(f\) at \(x_0\).
-
To denote the second derivative function the following notations are used:
\[ \underbrace{f''(x_0)}_{{\rm Lagrange's~notation}} \qquad \underbrace{\ddot{f}(x_0)}_{{\rm Newton's~notation}} \qquad \underbrace{\frac{d^2f}{dx^2}\bigg\vert _{x=x_0} {\rm~~~~and~~~~~~} \frac{d^2y}{dx^2}\bigg\vert _{x=x_0}}_{{\rm Leibniz's~notation}} \]
Definition 2: second derivative function
If a derivative function \(f'\) is differentiable at every point of the interval \((a, b)\), the function
is called the second derivative function of \(f\).
-
To denote the second derivative function the following notations are used:
\[ \underbrace{f''(x)}_{{\rm Lagrange's~notation}} \qquad \underbrace{\ddot{f}(x)}_{{\rm Newton's~notation}} \qquad \underbrace{ \frac{d^2f}{dx^2} {\rm~~~~,~~~~~~} \frac{d^2f(x)}{dx^2} {\rm~~~~and~~~~~~} \frac{d^2y}{dx^2}}_{{\rm Leibniz's~notation}} \]
1.1 Derivative function of order \(n\)¶
-
In a completely analogous way one defines the derivative of order \(n\), or \(n\)-th derivative, and the \(n\)-th derivative function, which are denoted by the symbols:
\[ \underbrace{f^{(n)}(x_0),~~~~f^{(n)}(x)}_{{\rm Lagrange's~notation}} \qquad \underbrace{\frac{d^nf}{dx^n}\bigg\vert _{x=x_0} {\rm~~and~~~~} \frac{d^ny}{dx^n}\bigg\vert _{x=x_0},~~~~ \frac{d^nf}{dx^n} {\rm~~~~,~~~~~~} \frac{d^nf(x)}{dx^n} {\rm~~and~~~~} \frac{d^ny}{dx^n}}_{{\rm Leibniz's~notation}} \]
1.2 Geometric meaning of the second derivative¶
While the first derivative has, as its geometric meaning, the slope of the graph, the second derivative represents the rate of change of this slope and therefore is a measure of the degree to which the graph deviates from a straight line.
-
We start by considering the family of functions that satisfy the conditions:
\[ f (0) = f' (0) = 0,~~ f'' (0) \ge 0 \]and the family of semicircles with center on the \(y\)-axis, tangent to the graph of \(f\) at the origin
\[ c_r(x) = r - \sqrt{r^2 - x^2},\qquad {\rm where~~} {r > 0} {\rm ~~is~the~radius} \]For every \(r \in \R_+\), we have:
\[ c'_r(0)=c_r(0)=0 {\rm ~~since~~} c'_r(x) = \frac{x}{\sqrt{r^2 - x^2}} \]For example, the function \(f(x)= 1 -\cos x\) with \(f(0)=f'(0)=0\) and the circles with radii \(r \in \{0.5,1,1.5\}\) are:
-
Among these semicircles we want to select the one that not only has the same tangent at \(x =0\) but also the same rate of change of the slope at \(x = 0\). That is, we want to choose \(r\) so that:
\[\begin{equation} \label{XX} c_r''(0) = f''(0) \end{equation}\]We have:
\[ c_r'(x) = \frac{x}{\sqrt{r^2 - x^2}} {\rm ~~~~and~~~~} c_r''(x) = \frac{r^2}{\left(r^2 - x^2\right)^{3/2}} \]hence, if we want \(\eqref{XX}\) to be satisfied, we need to choose \(r\) so that:
\[\begin{equation} \label{YY} \underbrace{\frac{1}{r}}_{=c_r''(0)} = f''(0) \end{equation}\]Equation \(\eqref{YY}\) expresses the geometric meaning of the second derivative at \(x=0\) for the family of functions that satisfy the conditions \(f (0) = f' (0) = 0,~~ f'' (0) \ge 0\). That is, \(f'' (0)\) represents the reciprocal of the radius of the semicircle that best approximates \(f\) at \(x = 0\).
-
Let us go back to the function \(f(x)= 1 -\cos x\); we have
\[ f'(x)=\sin x {\rm ~~~and~~~} f''(x)=\cos x \]hence
\[ f''(0)=1 {\rm ~~~and~~~} \frac{1}{r}=1 {\rm ~~hence~~} r=1 \]
Repeating an analogous construction at a generic point \(\big(x,f(x)\big)\) of the graph of \(f\) (without assuming a priori \(f(x) = f'(x) =0\)) one finds that the circle that best approximates the graph of the function at the point has radius \(r(x)\) given by:
The value \(\frac{1}{r(x)}\) is called the curvature (of the graph) of \(f\) at \(x\) and the value \(r(x)\) is the radius of curvature.
Example 1: radius of curvature and curvature
Consider the (parametric) parabola:
and the following curvature:
Note that the curvature is maximum at \(x =0\), i.e., at the vertex.
Let us now consider the parabola
and compute the radius \(r(x)\) of the circle that best approximates the graph at the points with abscissa \(x=0\) and \(x=\frac{1}{2}\). We have:
2. Second derivative, concavity and convexity¶
- We will now see how to make this idea of curvature of the graph more precise, qualitatively and quantitatively, through the concept of convexity.
2.1 Convex sets¶
Definition 3: convex set
A set \(F \subseteq \R^2\) (a portion of the Euclidean space) is convex if for every pair of points \(P_a,P_b \in F\) the segment joining \(P_a\) to \(P_b\) (called a chord) is entirely contained in \(F\).
Given two points \(P_a\) and \(P_b\) and a value \(\lambda\) between 0 and 1, i.e., \(0\le \lambda \le 1\), the point:
is called a convex (linear) combination of the points \(P_a\) and \(P_b\). As \(\lambda\) varies, the points \(P_c\) move along the segment joining \(P_a\) to \(P_b\).
Definition 4: convex set – equivalent definition
A set \(F \subseteq \R^2\) is convex if:
Example 2: convex set
Consider, for example, the following convex set given by the intersection of 4 half-planes:
| \(F = \big\{ ~~(x,y) \in \R^2:\) | \(x\) | + | \(y\) | \(\ge\) | 3, | \(x\) | + | \(y\) | \(\le\) | 9, |
| - \(x\) | + | \(y\) | \(\le\) | 3, | - \(x\) | + | \(y\) | \(\ge\) | -3 \(\big\}\) |
Example 3: non-convex set
Let us now consider the following set:
The set is not convex since, for example, the convex combination of the points \((5,3)\) and \((3,5)\) with \(\lambda=\frac{1}{2}\), that is, the point:
does not belong to the set.
2.2 Convex/concave functions¶
Definition 5: epigraph
Consider a function \(f: I \rr \R\). The epigraph of \(f\) is the set:
Example 4: epigraph
Definition 6: convex (concave) function
A function \(f: I \rr \R\) is convex on \(I\) if its epigraph is a convex set. A function is concave on \(I\) if \(-f\) is convex on \(I\).
Example 5: convex function
Example 6: concave function
Definition 7: convex (concave) function – equivalent definition
A function \(f: I \rr \R\) is convex (concave) on \(I\) if for every pair of points \(x_1,x_2 \in I\) the segment (“chord”) with endpoints \(\big(x_1, f (x_1)\big)\), \(\big(x_2, f (x_2)\big)\) has no points below (above) the graph of \(f\).
The definition of convex function translates into the analytic inequality:
-
If in the previous inequality the strict \(<\) always holds (with \(\lambda \neq 0,1\)), the function is called strictly convex. For concave (or strictly concave) functions an analogous inequality holds with the sign \(\ge\) (or > ).
-
Observe that as \(0\le \lambda \le 1\) varies: the point \(\lambda \; x_1 + (1-\lambda)\; x_2\) runs along the segment \([x_1,x_2]\) on the \(x\)-axis; the point \(\lambda \; f(x_1) + (1-\lambda)\; f(x_2)\) runs along the segment \([f(x_1),f(x_2)]\) on the \(y\)-axis; the point:
\[ \bigg(\lambda \; x_1 + (1-\lambda)\; x_2,~ f\big(\lambda \; x_1 + (1-\lambda)\; x_2\big) \bigg) \]runs along the graph of the function; the point:
\[ \big(\lambda \; x_1 + (1-\lambda)\; x_2,~ \lambda \; f(x_1) + (1-\lambda)\; f(x_2)\big) \]runs along the segment with endpoints \(\big(x_1,f(x_1)\big)\) and \(\big(x_2,f(x_2)\big)\).
Example 7: graph of a convex function
Consider the convex function \(f(x) = (x-2)^2+1\) with domain \(\left[\frac{1}{2},3\right]\) and take, for example, \(x_1=1\) and \(x_2=\frac{5}{2}\) and \(\lambda= \frac{1}{3}\). We have the following convex (linear) combination:
- Note that the definition of convex function does not require a priori that the function be continuous or differentiable on an interval.
Theorem 1
A convex (or concave) function on an interval \(I\) is continuous on \(I\), except possibly at the endpoints of the interval. Moreover, it has a right and a left derivative at every interior point of the interval.
Proof
Omitted □
- Corner points inside the interval and points of discontinuity at the endpoints of the interval are the only irregular behaviors allowed for a convex or concave function, as shown by the following examples:
3. Convexity and derivatives¶
- If we know a priori that the function is differentiable once or twice on the interval considered, then convexity is related to the first and second derivative of the function.
Theorem 2
Let \(f: (a, b) \rr \R\).
-
If \(f\) is differentiable in \((a,b)\), then \(f\) is convex (concave) on \((a, b)\) if and only if \(f'\) is increasing (decreasing) on \((a, b)\).
-
If \(f\) is twice differentiable in \((a,b)\), then \(f\) is convex (concave) on \((a, b)\) if and only if:
\[ f'' (x) \ge 0~~ (\le 0), ~~~\forall x \in (a, b) \]
- The theorem is modified in the obvious way for strictly convex or concave functions.
Proof
We do not prove part (a). Part (b) follows from (a) by the monotonicity test applied to \(f'\). □
As a consequence of this theorem, the study of the sign of the second derivative allows us to decide on the convexity or concavity of a function (check).
Example 8: convexity of exponential functions
The exponential functions
are convex on \(\R\), for any base \(a >0, a \neq 1\), since:
Example 9: convexity/concavity of logarithmic functions
The logarithmic functions
are concave on \((0,\ip)\) if \(a >1\) and convex on \((0,\ip)\) if \(0 < a < 1\), since:
Example 10: convexity/concavity of power functions
The power functions with real exponent \(\alpha\):
are convex on \((0,\ip)\) if \(\alpha >1\) or \(\alpha < 0\), and concave on \((0,\ip)\) if \(0 < \alpha < 1\), since:
which has, for every \(x >0\), the sign of \(\alpha \; (\alpha-1)\).
4. Convexity and tangent lines¶
- A useful geometric characterization of convexity involves the tangent lines to the graph of the function
Theorem 3
A function \(f: (a, b) \rr \R\), differentiable in \((a, b)\), is convex (concave) on \((a, b)\) if and only if, for any choice of a point \(x_0 \in (a, b)\), the graph of \(f\) lies on the whole of \((a, b)\) above (below) the graph of its tangent line at \(\big(x_0, f(x_0)\big)\).
Proof
Omitted □
Example 11: tangent lines and graphs of convex functions
Consider the function:
The tangent line to the graph of \(f\), for example at \(x = 0\), that is, at the point \((0,1)\), is:
The tangent line to the graph of \(f\), for example at \(x = 1\), that is, at the point \((1,e)\), is:
A (differentiable) convex function lies above its tangent lines and, at the same time, below its chords (definition of convexity).
- This allows us to conclude that, given any two points on the graph of a convex function, the graph between those two points lies entirely in the triangle whose sides are the chord joining them and the tangent lines to the graph at the two points.
Example 12: tangent lines/chords and graphs of convex functions
Consider the function:
The tangent lines to the graph of \(f\), for example at the points \(x_1 = -0.5\) and \(x_2 = 1\), are:
5. Inflection points¶
- The direction of concavity of a function (that is, whether it is convex or concave) can change within its domain; this leads us to the concept of inflection point.
Definition 8: inflection point
Let \(f : (a, b) \rr \R\) be a function and let \(x_0 \in (a, b)\) be a point of differentiability for \(f\), or let \(f' (x_0) = \pm \infty\). The point \(x_0\) is called an inflection point of \(f\) if there exist a right neighborhood \((x_0, x_0 + h)\), \(h > 0\), in which \(f\) is convex (concave) and a left neighborhood \((x_0 - h, x_0)\), \(h > 0\), in which \(f\) is concave (convex).
- When crossing an inflection point, the second derivative of \(f\) (if it exists) changes sign. We then expect \(f''\) to vanish at this point.
Theorem 4
Let \(x_0\) be an inflection point of \(f\); if \(f'' ( x_0)\) exists, then \(f'' ( x_0) = 0\).
Proof
Note that, if we knew that \(f''\) exists in a neighborhood of \(x_0\) and is continuous at \(x_0\), then the thesis of the theorem would follow from the intermediate value theorem for continuous functions (applied to \(f''\)). The theorem can also be proved without these additional hypotheses (omitted). □
The converse of the implication stated by the theorem is not true: a point where the second derivative vanishes may not be an inflection point.
Example 13: points with zero second derivative that are not inflection points
Consider the function:
Since \(f' (x) >0\) for \(x > 0\), the function is increasing for \(x > 0\), decreasing for \(x < 0\) and has a minimum point at \(x = 0\). We have \(f''(0)=0\), but the function is convex on all of \(\R\), hence \(x=0\) is not an inflection point.
- The geometric meaning of inflection points is clarified by the following theorem.
Theorem 5
If \(f : (a, b) \rr \R\) is differentiable in \((a, b)\) and \(x_0 \in (a, b)\) is an inflection point, then the graph of \(f (x)\) crosses its tangent line at \(\big(x_0, f (x_0)\big)\).
Proof
Let us draw the tangent line to the graph of \(f(x)\) at the point with abscissa \(x_0\). If \(f\) is (for example) concave on \((a, x_0)\), since \(f\) is differentiable, the graph of \(f\) lies below the line on \((a, x_0)\); on the other hand \(f\) is convex on \((x_0, b)\), so its graph lies above the line on \(( x_0, b)\). Consequently, at \(x_0\) the graph crosses the tangent line. □
Example 14: inflection points (with horizontal tangent)
Consider the function:
Since \(f' (x) >0\) for \(x \neq 0\), the function is increasing on all of \(\R\). It has a stationary point at \(x = 0\), which, however, is not a maximum or minimum point, because the function is always increasing.
We have \(f''(0)=0\). Moreover, \(f''(x)<0\) for \(x < 0\), hence it is concave for \(x < 0\), and \(f''(x)>0\) for \(x > 0\), hence it is convex for \(x > 0\). Consequently, the point \(x_0\) is an inflection point with horizontal tangent, and the graph of the function crosses its tangent line at \(\big(0, 0\big)\), that is, the line \(y =0\).
Example 15: inflection points
Consider the function:
We have \(f' (x) > 0\) for \(x < 0\), hence the function increases for \(x \le 0\); and \(f' (x) < 0\) for \(x > 0\), hence it decreases for \(x \ge 0\), and moreover \(f' (0) = 0\). Therefore it has a relative maximum point at \(x = 0\).
We have:
The function is convex for these values, and concave for \(-\frac{1}{\sqrt{2}} \le x \le \frac{1}{\sqrt{2}}\). Hence it has inflection points at \(x = \pm \frac{1}{\sqrt{2}}\), with tangent line of slope:
The tangent lines are:
Example 16: inflection points (with vertical tangent)
Consider the function:
For \(x_0=0\), we have seen that \(f'(0)= \ip\). In this case, however, \(f''(0)\) does not exist and the function has an inflection point with vertical tangent.
Example 17: inflection points (with horizontal tangent)
Consider the function:
f'(x)=\left\{\begin{array}{lr} 2\;x, &x>0 \\
\\
-2\;x, & x< 0 \end{array}\right.
Hence, for \(x>0\) the function is convex and for \(x<0\) it is concave, and \(f'(0)=0\); therefore \(x_0\) is an inflection point (but \(f''(0)\) does not exist).
Try it — the interactive graph below shows what you have just read: move the sliders.