Calculus

Applications of the Derivative

Applications of Derivative Logo

Convex Functions

Solved Problems

Example 7.

Determine if the function \[f\left( x \right) = \arctan x\] is convex downward or upward at the point \(x = 1?\)

Solution.

Differentiating successively, we get the second derivative:

\[f'\left( x \right) = \left( {\arctan x} \right)^\prime = \frac{1}{{1 + {x^2}}};\]
\[f^{\prime\prime}\left( x \right) = \left( {\frac{1}{{1 + {x^2}}}} \right)^\prime = \left[ {{{\left( {1 + {x^2}} \right)}^{ - 1}}} \right]^\prime = - {\left( {1 + {x^2}} \right)^{ - 2}} \cdot 2x = - \frac{{2x}}{{{{\left( {1 + {x^2}} \right)}^2}}}.\]

Calculate the value of the second derivative at \(x = 1:\)

\[f^{\prime\prime}\left( 1 \right) = - \frac{{2 \cdot 1}}{{{{\left( {1 + {1^2}} \right)}^2}}} = - \frac{1}{2} \lt 0.\]

Since the second derivative is negative, then the function at this point is convex downward.

Example 8.

Find the intervals of convexity/concavity of the function \[f\left( x \right) = \frac{1}{{1 + {x^2}}}.\]

Solution.

The function is defined and differentiable for all \(x \in \mathbb{R}.\) To determine the direction of convexity, we use the convexity test based on the second derivative. Calculate the second derivative:

\[f'\left( x \right) = \left( {\frac{1}{{1 + {x^2}}}} \right)^\prime = \left[ {{{\left( {1 + {x^2}} \right)}^{ - 1}}} \right]^\prime = - \frac{{2x}}{{{{\left( {1 + {x^2}} \right)}^2}}};\]
\[f^{\prime\prime}\left( x \right) = \left( { - \frac{{2x}}{{{{\left( {1 + {x^2}} \right)}^2}}}} \right)^\prime = \frac{{{6{x^2}} - {2}}}{{{{\left( {1 + {x^2}} \right)}^3}}}.\]

Find the intervals where the derivative has a constant sign:

\[f^{\prime\prime}\left( x \right) \gt 0,\;\;\Rightarrow \frac{{6{x^2} - 2}}{{{{\left( {1 + {x^2}} \right)}^3}}} \gt 0,\;\;\Rightarrow 6{x^2} - 2 \gt 0,\;\;\Rightarrow {x^2} \gt {\frac{1}{3}},\;\;\Rightarrow x \in \left( { - \infty , - {\frac{1}{{\sqrt 3 }}}} \right) \cup \left( {{\frac{1}{{\sqrt 3 }}},\infty } \right);\]
\[f^{\prime\prime}\left( x \right) \lt 0,\;\;\Rightarrow {\frac{{6{x^2} - 2}}{{{{\left( {1 + {x^2}} \right)}^3}}}} \lt 0,\;\;\Rightarrow 6{x^2} - 2 \lt 0,\;\;\Rightarrow {x^2} \lt {\frac{1}{3}},\;\;\Rightarrow x \in \left( { - {\frac{1}{{\sqrt 3 }}}, {\frac{1}{{\sqrt 3 }}}} \right).\]

Here in solving the inequalities, we have used the fact that the denominator in the expression for the second derivative is always positive: \({\left( {1 + {x^2}} \right)^3} \gt 0.\)

Thus, based on the sign of the second derivative, we establish that the given function is

Example 9.

Find the intervals on which the function \[f\left( x \right) = x + \frac{1}{x}\] is convex upward and convex downward.

Solution.

Sign chart for the second derivative of f(x)=x+1/x.
Figure 6.

First we find \(f^\prime\left( x \right):\)

\[f^\prime\left( x \right) = \left( {x + \frac{1}{x}} \right)^\prime = 1 - \frac{1}{{{x^2}}}.\]

Differentiating once again:

\[f^{\prime\prime}\left( x \right) = \left( {1 - \frac{1}{{{x^2}}}} \right)^\prime = 0 - \left( { - 2} \right){x^{ - 2}} = \frac{2}{{{x^3}}}.\]

If we try to solve the equation \(f^{\prime\prime}\left( x \right) = 0,\) we find that it has no solutions. But \(f^{\prime\prime}\left( x \right)\) is undefined at \(x = 0,\) so we plot this point on the sign chart to investigate the sign of the second derivative.

This tells us that the function is convex upward on \(\left( { -\infty, 0} \right)\) and convex downward on \(\left( {0, +\infty} \right).\)

Example 10.

Find the intervals of convexity/concavity of the function \[f\left( x \right) = x - \cos x.\]

Solution.

Differentiating successively, we calculate the second derivative:

\[f'\left( x \right) = \left( {x - \cos x} \right)^\prime = 1 + \sin x,\]
\[f^{\prime\prime}\left( x \right) = \left( {1 + \sin x} \right)^\prime = \cos x.\]

Determine the intervals where the second derivative is positive and negative. The problem is reduced to the solution of the simple trigonometric inequality:

\[f^{\prime\prime}\left( x \right) \gt 0,\;\; \Rightarrow \cos x \gt 0,\;\; \Rightarrow x \in \left( { - \frac{\pi }{2} + 2\pi n,\frac{\pi }{2} + 2\pi n} \right),\;n \in \mathbb{Z};\]
\[f^{\prime\prime}\left( x \right) \lt 0,\;\; \Rightarrow \cos x \lt 0,\;\; \Rightarrow x \in \left( { \frac{\pi }{2} + 2\pi k,\frac{3\pi }{2} + 2\pi k} \right),\;k \in \mathbb{Z}.\]

Hence, the function is strictly convex downward for

\[x \in \left( - {\frac{\pi }{2}} + 2\pi n, {\frac{\pi }{2}} + 2\pi n \right), n \in \mathbb{Z},\]

and strictly convex upward for

\[x \in \left( {\frac{\pi }{2}} + 2\pi k, {\frac{3\pi }{2}} + 2\pi k \right), k \in \mathbb{Z}.\]

Note that the linear term \(x\) in the expression for the function does not affect the direction of convexity.

Example 11.

Find the intervals of convexity/concavity of the \(4\)th order polynomial function: \[f\left( x \right) = {x^4} + 2{x^3} - 36{x^2} + 2x + 1.\]

Solution.

Differentiating successively, we find the second derivative:

\[f'\left( x \right) = \left( {{x^4} + 2{x^3} - 36{x^2} + 2x + 1} \right)^\prime = 4{x^3} + 6{x^2} - 72x + 2;\]
\[f^{\prime\prime}\left( x \right) = \left( {4{x^3} + 6{x^2} - 72x + 2} \right)^\prime = 12{x^2} + 12x - 72 = 12\left( {{x^2} + x - 6} \right).\]

We solve the equation \(f^{\prime\prime}\left( x \right) = 0\) and determine the sign of the second derivative in the corresponding intervals (Figure \(7\)):

\[f^{\prime\prime}\left( x \right) = 0,\;\; \Rightarrow 12\left( {{x^2} + x - 6} \right) = 0,\;\; \Rightarrow D = 1 + 4 \cdot \left( { - 6} \right) = 25,\;\; \Rightarrow {x_{1,2}} = \frac{{ - 1 \pm 5}}{2} = - 3;2.\]
Intervals of convexity/concavity of a quadric function.
Figure 7.

Consequently, this function (as well as its curve) is strictly convex downward in the intervals \(\left( { - \infty , - 3} \right)\) and \(\left( {2, + \infty } \right)\) and is strictly convex upward in the interval \(\left( {-3, 2} \right).\)

Example 12.

Determine where the function \[f\left( x \right) = {x^4} - 2{x^3} - 12{x^2} + 1\] is convex upward and convex downward?

Solution.

We use the Convexity/Concavity Test. Find the second derivative:

\[f^\prime\left( x \right) = \left( {{x^4} - 2{x^3} - 12{x^2} + 1} \right)^\prime = 4{x^3} - 6{x^2} - 24x,\]
\[f^{\prime\prime}\left( x \right) = \left( {4{x^3} - 6{x^2} - 24x} \right)^\prime = 12{x^2} - 12x - 24 = 12\left( {{x^2} - x - 2} \right).\]

Solve the equation \(f^{\prime\prime}\left( x \right) = 0\) to determine where the second derivative is changing its sign:

\[f^{\prime\prime}\left( x \right) = 0,\;\; \Rightarrow 12\left( {{x^2} - x - 2} \right) = 0,\;\; \Rightarrow 12\left( {x + 1} \right)\left( {x - 2} \right) = 0,\;\; \Rightarrow {x_1} = - 1,\;{x_2} = 2.\]
Sign chart for the second derivative of f(x)=x^4-2x^3-12x^2+1.
Figure 8.

It follows from the sign chart that \(f\left( x \right)\) is convex downward on the intervals \(\left( { - \infty , - 1} \right)\) and \(\left( {2, + \infty } \right)\) and convex upward on the interval \(\left( { - 1, 2} \right).\)

Example 13.

Find the intervals on which the function \[f\left( x \right) = {x^4} - 6{x^2} - 6x + 1\] is convex upward and convex downward.

Solution.

Sign chart for the second derivative of f(x)=x^4-6x^2-6x+1.
Figure 9.

Take the \(1\)st and \(2\)nd derivatives:

\[f^\prime\left( x \right) = \left( {{x^4} - 6{x^2} - 6x + 1} \right)^\prime = 4{x^3} - 12x - 6,\]
\[f^{\prime\prime}\left( x \right) = \left( {4{x^3} - 12x - 6} \right)^\prime = 12{x^2} - 12.\]

Solve the equation \(f^{\prime\prime}\left( x \right) = 0\) and draw a sign diagram for \(f^{\prime\prime}\left( x \right).\)

\[f^{\prime\prime}\left( x \right) = 0,\;\; \Rightarrow 12{x^2} - 12 = 0,\;\; \Rightarrow 12\left( {x - 1} \right)\left( {x + 1} \right) = 0,\;\; \Rightarrow {x_1} = - 1,\;{x_2} = 1.\]

Hence, the function is convex downward on \(\left( { - \infty , - 1} \right)\) and \(\left( { 1, +\infty} \right)\) and convex upward on \(\left( { -1, - 1} \right).\)

Example 14.

Find the intervals of convexity/concavity of the function \[f\left( x \right) = \frac{{{x^3}}}{{1 + {x^2}}}.\]

Solution.

Obviously, this function is defined and differentiable for all \(x.\) Find successively the first and second derivative:

\[f'\left( x \right) = \left( {\frac{{{x^3}}}{{1 + {x^2}}}} \right)^\prime = \frac{{{{\left( {{x^3}} \right)}^\prime }\left( {1 + {x^2}} \right) - {x^3}{{\left( {1 + {x^2}} \right)}^\prime }}}{{{{\left( {1 + {x^2}} \right)}^2}}} = \frac{{3{x^2}\left( {1 + {x^2}} \right) - {x^3} \cdot 2x}}{{{{\left( {1 + {x^2}} \right)}^2}}} = \frac{{\color{blue}{3{x^2}} + \color{red}{3{x^4}} - \color{red}{2{x^4}}}}{{{{\left( {1 + {x^2}} \right)}^2}}} = \frac{{\color{blue}{3{x^2}} + \color{red}{x^4}}}{{{{\left( {1 + {x^2}} \right)}^2}}};\]
\[f^{\prime\prime}\left( x \right) = {\left( {\frac{{3{x^2} + {x^4}}}{{{{\left( {1 + {x^2}} \right)}^2}}}} \right)^\prime } = \frac{{{6x} - {2{x^3}}}}{{{{\left( {1 + {x^2}} \right)}^3}}}.\]

Determine the intervals where the second derivative has a constant sign. It has zeros at the following points:

\[ f^{\prime\prime}\left( x \right) = 0,\;\; \Rightarrow \frac{{6x - 2{x^3}}}{{{{\left( {1 + {x^2}} \right)}^3}}} = 0,\;\; \Rightarrow \left\{ {\begin{array}{*{20}{l}} {6x - 2{x^3} = 0}\\ {{{\left( {1 + {x^2}} \right)}^3} \ne 0} \end{array}} \right.,\;\; \Rightarrow 2x\left( {3 - {x^2}} \right) = 0,\;\; \Rightarrow {x_1} = 0,\;{x_{2,3}} = \pm \sqrt 3 .\]

It follows from Figure \(10\) that the second derivative is positive in the intervals \(\left( { - \infty , - \sqrt 3 } \right)\) and \(\left( {0, \sqrt 3 } \right).\) Hence, the function is strictly convex downward here. In the other two intervals − at \(x \in \left( {-\sqrt 3, 0} \right)\) and at \(x \in \left( {\sqrt 3, +\infty} \right)\) − the function is strictly convex upward as shown schematically in Figure \(10.\)

Intervals of convexity/concavity of the function f(x)=f^3/(1+x^2).
Figure 10.

Example 15.

Determine the intervals on which the function \[f\left( x \right) = {e^{\sqrt x }}\] is convex upward and convex downward.

Solution.

Sign chart for the second derivative of f(x)=exp(sqrt(x)).
Figure 11.

Find \(f^\prime\) and \(f^{\prime\prime}:\)

\[f^\prime\left( x \right) = \left( {{e^{\sqrt x }}} \right)^\prime = {e^{\sqrt x }} \cdot \left( {\sqrt x } \right)^\prime = \frac{{{e^{\sqrt x }}}}{{2\sqrt x }};\]
\[f^{\prime\prime}\left( x \right) = \left( {\frac{{{e^{\sqrt x }}}}{{2\sqrt x }}} \right)^\prime = \frac{{\left( {{e^{\sqrt x }}} \right)^\prime \cdot \sqrt x - {e^{\sqrt x }} \cdot \left( {\sqrt x } \right)^\prime}}{{{{\left( {\sqrt x } \right)}^2}}} = \frac{{\frac{{{e^{\sqrt x }}}}{{2\sqrt x }} \cdot \sqrt x - {e^{\sqrt x }} \cdot \frac{1}{{2\sqrt x }}}}{x} = \frac{{\frac{{{e^{\sqrt x }}}}{{2\sqrt x }}\left( {\sqrt x - 1} \right)}}{x} = \frac{{{e^{\sqrt x }}\left( {\sqrt x - 1} \right)}}{{2\sqrt {{x^3}} }}.\]

We see that \(f^{\prime\prime}\left( x \right)\) does not exist at \(x = 0\) and it is equal to zero at \(x = 1\) (which is a point of inflection).

As it follows from the sign chart (see above), the function is convex downward on \(\left( {1, + \infty } \right)\) and convex upward on \(\left( {0, 1} \right).\)

Example 16.

Find the intervals on which the function \[f\left( x \right) = {e^{ - {x^3}}}\] is convex upward and convex downward.

Solution.

Sign chart for the second derivative of f(x)=exp(-x^3).
Figure 12.
Schematic view of the function f(x)=exp(-x^3).
Figure 13.

Take the first derivative using the chain rule:

\[f^\prime\left( x \right) = \left( {{e^{ - {x^3}}}} \right)^\prime = {e^{ - {x^3}}} \cdot \left( { - {x^3}} \right)^\prime = - 3{x^2}{e^{ - {x^3}}}.\]

Differentiate once more using the product rule and the chain rule:

\[f^{\prime\prime}\left( x \right) = \left( { - 3{x^2}{e^{ - {x^3}}}} \right)^\prime = - 6x{e^{ - {x^3}}} + 9{x^4}{e^{ - {x^3}}} = 3x{e^{ - {x^3}}}\left( {3{x^3} - 2} \right).\]

Solve the equation \(f^{\prime\prime}\left( x \right) = 0:\)

\[f^{\prime\prime}\left( x \right) = 0,\;\; \Rightarrow 3x{e^{ - {x^3}}}\left( {3{x^3} - 2} \right) = 0,\;\; \Rightarrow {x_1} = 0,\;{x_2} = \sqrt[3]{{\frac{2}{3}}}.\]

As you can see from the sign chart, the function is convex downward on the intervals \(\left( { - \infty ,0} \right)\) and \(\left( { \sqrt[3]{{\frac{2}{3}}}, +\infty} \right).\) Respectively, the function is convex upward on \(\left( { 0, \sqrt[3]{{\frac{2}{3}}}} \right).\)

The graph of the function is schematically given above.

Example 17.

Find the intervals on which the function \[f\left( x \right) = {e^{\frac{1}{x}}}\] is convex upward and convex downward.

Solution.

Sign chart for the second derivative of f(x)=exp(1/x).
Figure 14.

First we take the derivatives:

\[f^\prime\left( x \right) = \left( {{e^{\frac{1}{x}}}} \right)^\prime = {e^{\frac{1}{x}}} \cdot \left( { - \frac{1}{{{x^2}}}} \right) = - \frac{{{e^{\frac{1}{x}}}}}{{{x^2}}};\]
\[f^{\prime\prime}\left( x \right) = \left( { - \frac{{{e^{\frac{1}{x}}}}}{{{x^2}}}} \right)^\prime = - \frac{{\left( {{e^{\frac{1}{x}}}} \right)^\prime \cdot {x^2} - {e^{\frac{1}{x}}} \cdot \left( {{x^2}} \right)^\prime}}{{{x^4}}} = - \frac{{{e^{\frac{1}{x}}} \cdot \left( { - \frac{1}{{{x^2}}}} \right) \cdot {x^2} - 2x{e^{\frac{1}{x}}}}}{{{x^4}}} = \frac{{{e^{\frac{1}{x}}}\left( {1 + 2x} \right)}}{{{x^4}}}.\]

Solve the equation \(f^{\prime\prime}\left( x \right) = 0\) and draw a sign chart for \(f^{\prime\prime}\left( x \right).\)

\[f^{\prime\prime}\left( x \right) = 0,\;\; \Rightarrow \frac{{{e^{\frac{1}{x}}}\left( {1 + 2x} \right)}}{{{x^4}}} = 0,\;\; \Rightarrow x = - \frac{1}{2}.\]

Note that the function and its derivatives do not exist at \(x = 0,\) so we also indicate this point on the sign chart.

Thus, the function is convex downward on \(\left( {-\frac{1}{2}, 0} \right)\) and \(\left( { 0, +\infty} \right)\) and convex upward on \(\left( { -\infty, -\frac{1}{2}} \right).\)

Example 18.

Investigate the direction of convexity of the curve defined by the parametric equations \[x = a\left( {t - \sin t} \right), y = a\left( {1 - \cos t} \right),\] where \(a \gt 0.\)

Solution.

This curve is a cycloid. Calculate the first derivative:

\[{x'_t} = {\left[ {a\left( {t - \sin t} \right)} \right]^\prime } = a\left( {1 - \cos t} \right),\;\;{y'_t} = {\left[ {a\left( {1 - \cos t} \right)} \right]^\prime } = a\sin t,\;\; \Rightarrow {y'_x} = \frac{{{y'_t}}}{{{x'_t}}} = \frac{{\cancel{a}\sin t}}{{\cancel{a}\left( {1 - \cos t} \right)}} = \frac{{\sin t}}{{1 - \cos t}}.\]

The second order derivative is given by the formula:

\[y^{\prime\prime}_{xx} = \frac{{{{\left( {{y'_x}} \right)}'_t}}}{{{x'_t}}},\]

where

\[{\left( {{y'_x}} \right)'_t} = {\left( {\frac{{\sin t}}{{1 - \cos t}}} \right)^\prime } = \frac{{\cos t\left( {1 - \cos t} \right) - \sin t\sin t}}{{{{\left( {1 - \cos t} \right)}^2}}} = \frac{{\cos t - \left( {{{\cos }^2}t + {{\sin }^2}t} \right)}}{{{{\left( {1 - \cos t} \right)}^2}}} = - \frac{\cancel{1 - \cos t}}{{{{\left( {1 - \cos t} \right)}^\cancel{2}}}} = - \frac{1}{{1 - \cos t}}.\]

Consequently, the second derivative has the form:

\[{y^{\prime\prime}_{xx}} = \frac{{{{\left( {{y'_x}} \right)}'_t}}}{{{x'_t}}} = \frac{{\left( { - \frac{1}{{1 - \cos t}}} \right)}}{{1 - \cos t}} = - \frac{1}{{{{\left( {1 - \cos t} \right)}^2}}}.\]

As seen, the derivative \(y^{\prime\prime}\) is negative everywhere except at the points \(t = 2\pi n,\) \(n \in \mathbb{Z}.\) For these points, the \(x\)-coordinate is

\[x\left( {t = 2\pi n} \right) = a\left[ {2\pi n - \sin \left( {2\pi n} \right)} \right] = 2a\pi n,\;n \in \mathbb{Z}.\]

The portion of the cycloid is shown schematically in Figure \(15.\)

Convexity of a cycloid curve.
Figure 15.

Example 19.

Explore the direction of convexity of the curve defined implicitly by the equation \[x + y = {e^{x - y}}.\]

Solution.

Differentiating both sides of the equation with respect to \(x,\) we find the first derivative:

\[\left( {x + y} \right)^\prime = \left( {{e^{x - y}}} \right)^\prime,\;\; \Rightarrow 1 + y' = {e^{x - y}}\left( {1 - y'} \right),\;\; \Rightarrow 1 + y' = {e^{x - y}} - {e^{x - y}}y',\;\; \Rightarrow y'\left( {{e^{x - y}} + 1} \right) = {e^{x - y}} - 1,\;\; \Rightarrow y' = \frac{{{e^{x - y}} - 1}}{{{e^{x - y}} + 1}}.\]

Similarly, we define the second derivative:

\[y'\left( {{e^{x - y}} + 1} \right) = {e^{x - y}} - 1,\;\; \Rightarrow \left( {y'\left( {{e^{x - y}} + 1} \right)} \right)^\prime = \left( {{e^{x - y}} - 1} \right)^\prime,\;\; \Rightarrow y^{\prime\prime}\left( {{e^{x - y}} + 1} \right) + y'{e^{x - y}}\left( {1 - y'} \right) = {e^{x - y}}\left( {1 - y'} \right),\;\; \Rightarrow y^{\prime\prime}\left( {{e^{x - y}} + 1} \right) = {e^{x - y}}\left( {1 - y'} \right) - {e^{x - y}}\left( {1 - y'} \right)y',\;\; \Rightarrow y^{\prime\prime}\left( {{e^{x - y}} + 1} \right) = {e^{x - y}}{\left( {1 - y'} \right)^2},\;\; \Rightarrow y^{\prime\prime} = \frac{{{e^{x - y}}{{\left( {1 - y'} \right)}^2}}}{{{e^{x - y}} + 1}}.\]

Substitute the first derivative \(y'\) into the last expression:

\[y^{\prime\prime} = \frac{{{e^{x - y}}{{\left( {1 - y'} \right)}^2}}}{{{e^{x - y}} + 1}} = \frac{{{e^{x - y}}{{\left( {1 - \frac{{{e^{x - y}} - 1}}{{{e^{x - y}} + 1}}} \right)}^2}}}{{{e^{x - y}} + 1}} = \frac{{{e^{x - y}}{{\left( {\frac{{\cancel{e^{x - y}} + 1 - \cancel{e^{x - y}} + 1}}{{{e^{x - y}} + 1}}} \right)}^2}}}{{{e^{x - y}} + 1}} = \frac{{4{e^{x - y}}}}{{{{\left( {{e^{x - y}} + 1} \right)}^3}}}.\]

Since the exponential function is always positive, the second derivative is also positive for all \(x \in \mathbb{R}.\) Consequently, the given curve is everywhere strictly convex downward.

Page 1 Page 2