Chapter 6.4 Shape and Change
\[ \definecolor{ucrblue}{rgb}{0.0627,0.3843,0.6039} \definecolor{ucrgold}{rgb}{0.9686,0.6941,0.2824} \definecolor{ucrred}{rgb}{0.8941,0,0.1686} \definecolor{ucrgreen}{rgb}{0.4706,0.7451,0.1255} \definecolor{ucraccent}{rgb}{1.0000,0.9569,0.8392} \DeclareMathOperator*{\LO}{O} \DeclareMathOperator*{\Lo}{o} \DeclareMathOperator*{\abs}{abs} \DeclareMathOperator{\pow}{pow} \]
In this section, we discuss how the first derivative and second derivative enables us to create more detailed sketches of a function. In particular, where a function is monotonic is related to the first derivative while the shape of a function is related to the second derivative.
Sketching and Optimization with First Order Information
The mean value theorem connects the local and global behavior of a differentiable function.
It is one of the most important theorems in our subject.
The statement below is a consequence of the mean value theorem that connects information about the sign of the derivative of a function in an interval to the way the function changes in the interval.
Derivative Sign and Increasing and Decreasing
For any interval \([a,b]\) and any function \(f\) that is differentiable on \((a,b)\) and continuous on \([a,b]\), if \(f^\prime(z)\) is positive (negative) for any \(z\) in \((a,b)\), then \(f\) is strictly increasing (decreasing) on \([a,b]\).
Here is why it is true:
Take \(I\) to be either \((a,b)\) or \([a,b]\) and adjust assumptions accordingly.
For any \(x\) and \(y\) in \(I\), if \(y\) is greater than \(x\) and \(f^\prime\) is positive on \(I\), then the mean value theorem implies that there is a \(c\) in \((x,y)\) so that \[f(y) - f(x) = f^\prime(c)(y-x) > 0\quad \text{and so}\quad f(y) > f(x).\]
The inequalities will be reversed if \(f^\prime\) is negative on \(I\).
Example 1
For each function \(f\) given below, compute the derivative of \(f\) to show that \(f\) is decreasing on the given interval \(I\):
- \(f(x) = \frac{1}{x}\) and \(I = (0, \infty)\);
- \(f(x) = x^4 - 4x^3 +4x^2 +5\) and \(I = [1, 2]\).
- The derivative is \(f'(x)=-\frac{1}{x^2}\). This function is always negative. Since the derivative is always negative on \((0,\infty)\), then \(f\) is decreasing on \((0,\infty)\)
- The derivative is \(f'(x)=4x^3-12x^2+8x=x(4x^2-12x+8)=x(4x-4)(x-2)\). This function is negative on \((1,2).\) Thus \(f\) is decreasing on \([1,2].\)
In this example, use the sketch of the derivative to identify where a function is increasing and decreasing.
Example 2
The function \(f\) is differentiable on \([-6, 6]\) and \(f^\prime\) is sketched below:
- Determine all maximal intervals on which \(f\) is increasing.
- Determine all maximal intervals on which \(f\) is decreasing.
- The function is increasing where the derivative is positive; \((-5,-3)\),\((-1,1)\), \((5,6)\)
- The function is decreasing where the negative; \((-6,-5)\),\((-3,-1)\), \((1,5)\)
Local maximum and local minimum are easily identifiable by looking at sign changes of the derivative.
First Derivative Test
First Derivative Test For any differentiable function \(f\) on \([a,b]\), and for any \(x_0\) in \((a,b)\) with \(f^\prime(x_0) = 0\),
- if \(f^\prime\) is positive on \((a, x_0)\) and negative on \((x_0, b)\), then \(f\) has a local maximum at \(x_0\);
- if \(f^\prime\) is negative on \((a, x_0)\) and positive on \((x_0, b)\), then \(f\) has a local minimum at \(x_0\).
Here is why it is true:
Since \(f\) is strictly increasing on \([a, x_0]\) and strictly decreasing on \([x_0, b]\), \(f(x_0)\) is maximal.
Since \(f\) is strictly decreasing on \([a, x_0]\) and strictly increasing on \([x_0, b]\), \(f(x_0)\) is minimal.
In this example, use the graph of the derivative to identify extremal values of the original function.
Example 3
Take \(f\) to be a differentiable function on \([-4, 8]\). Given this sketch of \(f^\prime\) below, find and classify all extremal points of \(f\) in \((-4, 8)\).
For local max look at where \(f'\) changes from positive to negative; \(x=-2\) ,\(x=2.\) For local min look at where \(f'\) changes from negative to positive: \(x=0\), \(x=6.\)
In this next example, sketch the derivative to identify the sign of the derivative in order to determine local maximum and local minimum.
Example 4
For each function \(f\) with \(f^\prime(x)\) given below, determine all points in \(\mathbb R\) where \(f\) has a local maximum or minimum:
- \(f^\prime(x) = (x+3)(x+2)^2(x-1)(x-4)^3\);
- \(f^\prime(x) = |x-1| -2\).
- Graph the function. To find the local min, determine where \(f'\) changes from negative to positive. This happens at \(x=-3,x=4\). To find local max, determine where \(f'\) changes from positive to negative. This happens at \(x=1\).
- Graph the function. To find the local min, determine where \(f'\) changes from negative to positive. This happens at \(x=3\). To find local max, determine where \(f'\) changes from positive to negative. This happens at \(x=-1\).
Determine the first order information of the given fuction to identify extremal points in this next example.
Example 5
Find and classify all extremal points for each function \(f\) given below on the given intervals:
\(f(x)=\left(x+3\right)\left(x-2\right)\left(x+4\right)\), on \([-5,3]\);
\(f(x) = x{\rm e}^{-x^2}\), on \(\mathbb R\);
\(f(x) = \frac{x^{2}}{4x+3}\), on \([-5,5]\).
- Take the derivative of \(f\). The derivative is \(f'(x)=(x-2)(x+4)+(x+3)(x+4)+(x+3)(x-2)\) or \(f'(x)=3x^2+10x-2\). Rewrite the derivative: \(f'(x)=3(x+\tfrac{5}{3})^2-\tfrac{31}{3}.\) The derivative is a quadratic function that opens up with vertex at \((-\tfrac{5}{3},-\tfrac{31}{3})\), and \(x\)-intercepts at \((\tfrac{\sqrt{31}}{3}-\tfrac{5}{3},0)\) and \((-\tfrac{\sqrt{31}}{3}-\tfrac{5}{3},0).\) Since the derivative of the function changes from positive to negative at \(x=-\tfrac{\sqrt{31}}{3}-\tfrac{5}{3}\), this is where the local max is at. Since the derivative of the function changes from negative to positive at \(x=\tfrac{\sqrt{31}}{3}-\tfrac{5}{3}\), this is where the local min is at. To find the global extremal, determine which of the following is the largest and smallest y-value \[f(-5)=-14,\quad f\left(-\tfrac{\sqrt{31}}{3}-\tfrac{5}{3}\right)\approx1.3778,\quad f\left(\tfrac{\sqrt{31}}{3}-\tfrac{5}{3}\right)\approx-24.1926,\quad f(3)=42.\] The global minimum is at \(\tfrac{\sqrt{31}}{3}-\tfrac{5}{3}\) and the global maximum is at \(x=3\) on \([-5,3]\).
- Take the derivative of \(f\). The derivative \(f'(x)=e^{-x^2}-2x^2e^{-x^2}\) or \(f'(x)=(1-2x^2)e^{-x^2}\). The derivative is zero at \(x=\pm\tfrac{1}{\sqrt{2}}\). Since the derivative of the function changes from positive to negative at \(x=\frac{1}{\sqrt{2}}\), this is where the local max is at. Since the derivative of the function changes from negative to positive at \(x=-\frac{1}{\sqrt{2}}\), this is where the local min is at. This is also where the function will have a global minimum. Since the derivative of the function changes from positive to negative at \(x=\frac{1}{\sqrt{2}}\), this is where the local max is at. This is also where the function will have a global maximum.
- The derivative is \(f'(x)=\frac{2x\cdot(4x+3)-4x^2}{(4x+3)^2}=\frac{4x^2+6x}{(4x+3)^2.}\) The derivative is undefined at \(x=-\tfrac{3}{4}\) and the derivative is zero when the numerator \(4x^2+6x\) is zero, which is when \(x=0\) or \(x=-\tfrac{3}{2}\). The derivative changes from negative to positive at \(x=0\), so the local min occurs there. The derivative goes from positive to negative at \(x=-\frac{3}{2}\), so the local max occurs there.
In the case of paths, we can determine when a particle moves fastest and slowest by studying its velocity vector.
Example 6
A particle moves along an ellipse during the time interval \([0, \pi]\). At time \(t\), its position is \(c(t)\), where [c(t) = (5(2t), 2(2t)).] Determine when the particle moves the fastest and when is the particle moves the slowest.
The velocity vector is given by
\[c^\prime(t)=\langle -10\sin(2t),4\sin(2t) \rangle\]
so that
\[\begin{align*} \|c^\prime(t)\| &=\sqrt{100\sin^2(2t)+16\cos^2(2t)}\\ &=\sqrt{84\sin^2(2t)+16} \end{align*}\]
where \(\cos^2(2t)=1-\sin^2(2t)\).
The particle’s speed \(s(t)\) at time \(t\) is given by
\[\begin{align*} s(t) &=\sqrt{84\sin^2(2t)+16}\\ &=2\sqrt{21\sin^2(2t)+4}. \end{align*}\]
So,
\[s^\prime(t)=\frac{1}{\sqrt{21\sin^2(2t)+4}}\cdot (84\sin(2t)\cos(2t))=\frac{84\sin(2t)\cos(2t)}{\sqrt{21\sin^2(2t)+4}}.\]
The derivative \(s^\prime\) is zero if and only if
\[\sin(2t)=0\quad\text{and}\quad \cos(2t)=0.\]
The zeros for \(\sin(2t)\) are \(\left\{0,\tfrac{\pi}{2},\pi\right\}\) and zeros for \(\cos(2t)\) are \(\left\{\tfrac{\pi}{4},\tfrac{3\pi}{4}\right\}.\)
So the speed is minimal at \(\left\{0,\tfrac{\pi}{2},\pi \right\}\) and speed is maximal at \(\left\{\tfrac{\pi}{4},\tfrac{3\pi}{4}\right\}.\)
Functions describe the measurable quantities associated to an experiment.
To optimize a measurable quantity means to find the local extrema of the function that models the measurable quantity.
Example 7
Cut small congruent squares from the corners of a 12 inch by 12 inch sheet of cardboard paper and bend up the sides to create a box. Determine the size of the squares cut from the corners so that the box holds as much as possible.
Take \(V\) be the volume of the box. The formula for the volume is \(V=\ell\cdot w\cdot h.\)
Take \(x\) be the amount cut from the box.
The formula for volume is \(V(x)=(12-2x)(12-x)x\) or \(V(x)=4x^3-48x^2+144x\). To maximize \(V\), find the derivative: \(V'(x)=12x^2-96x+144.\)
Find where the \(V'=0\) to identify possible the maximum. The derivative is zero at \(x=6\) and \(x=2\). So the function may have a max at \(2\) or \(6\).
Calculate \(V\) at each of these values to conclude that \(V(2)=128\) is the largest \(y\)-value. This is the maximum volume, so cut \(x=2\) inches from each corner.
Here is another example of optimization.
Example 8
A cylindrical soda can has the property that the top and bottom are thicker than the sides, and so are \(K\) times more expensive to make, where \(K\) is in \([1, \infty)\). The can must hold a volume of \(V\). Determine the height and radius of the can that minimizes the cost of the materials.
The volume of the soda car is
\[V=\pi r^2h\]
where \(r\) is the radius of the base and \(h\) is the height. Solve for \(h\) to get that
\[h=\frac{V}{\pi r^2}.\]
The cost of the sides for a given radius \(r\) is given by \[2\pi rh=2\pi r\cdot \frac{V}{\pi r^2}\] while the cost of the top and bottom for a given radius \(r\) and given that it is \(K\) times more expensive to make is given by
\[2K\pi r^2=2K\cdot \pi r^2.\]
The total cost of the material is given by
\[\begin{align*} \mathrm{Cost}(r) &=2\pi r\cdot \frac{V}{\pi r^2}+ 2K\cdot \pi r^2\\ &=2\left(\frac{V}{r}+ K\pi r^2\right), \end{align*}\]
and so
\[\begin{align*} \mathrm{Cost}^\prime(r) &=2\left(-\frac{V}{r^2}+ 2K\pi r\right)\\ &=2\left(\frac{2K\pi r^3-V}{r^2}\right). \end{align*}\]
The derivative is zero as long as
\[\frac{2K\pi r^3-V}{r^2}=0\quad\text{which is equivalent to}\quad r=\left(\frac{V}{2\pi K}\right)^\frac{1}{3}.\]
The radius and height is given by
\[r_0=\left(\frac{V}{2\pi K}\right)^\frac{1}{3}\quad\text{and}\quad h_0=\frac{V}{2\pi r_0^2}=\frac{V}{2\pi (\frac{V}{2\pi K})^{\frac{2}{3}}}=V^\frac{1}{3}(2\pi)^{-\frac{1}{3}}K^{\frac{2}{3}}.\]
The radius \(r_0\) minimizes the cost because if \(x<r_0\) then \(\mathrm{cost}^\prime (x)<0\) and if \(x>r_0\) then \(\mathrm{cost}^\prime(x)>0\).
The Second Derivative
To obtain more information about a function, we need to discuss the second derivative.
Twice Differentiable
For any function \(f\) that is defined on an interval \(I\), if \(f\) is differentiable on \(I\) then the function \(f^\prime\) is also a function on \(I\).
If \(f^\prime\) is itself differentiable at a point \(x_0\) in \(I\), then \(f\) is twice differentiable at \(x_0\).
If \(f^\prime\) is differentiable on \(I\), then \(f\) is twice differentiable on \(I\).
Denote by \(f^{\prime\prime}\) the function \((f^\prime)^\prime\) or, using Leibniz notation, write \[\frac{{\rm d}^2f}{{{\rm d}x}^2}(x) := \frac{{\rm d}}{{{\rm d}x}}\frac{{\rm d}f}{{{\rm d}x}}(x) = f^{\prime\prime}(x).\]
The second derivative is just the derivative of the first derivative. Practice finding the second derivative with this example.
Example 9
For each function \(f\) that is given below, determine \(f^{\prime\prime}(x)\):
- \(f(x) = x^4-5x^3+x^2+7x-2\);
- \(f(x) = \frac{1}{x}\);
- \(f(x) = x{\rm e}^{x}\);
- \(f(x) = \sin(x^2)\).
- The derivative is \(f'(x)=4x^3 -15x^2+2x+7\) so \(f''(x)=12x^2-30x+2\).
- The derivative is \(f'(x)=-\frac{1}{x^2}\) so \(f''(x)=\frac{2}{x^3}\) .
- The derivative is \(f'(x)=e^x +xe^x\) so \(f''(x)=e^x+e^x+xe^x.\)
- The derivative is \(f'(x)=2x\cos(x^2)\) so \(f''(x)=2\cos(x^2)-4x^2\sin(x^2)\)
If a function is twice differentiable, then the function \(f^{\prime\prime}\) is the derivative of the function \(f^\prime\), and so \(f^{\prime\prime}\) reveals information about \(f^\prime\) just as \(f^\prime\) reveals information about \(f\).
In this way, the function \(f^{\prime\prime}\) gives more information about \(f\)—It gives information that helps to classify the shape of \(f\).
The information that \(f^{\prime\prime}\) reveals about \(f\) is called second order information as opposed to the first order information that \(f^\prime\) reveals about \(f\).
Example 10
Find all maximal intervals on which \(f^\prime\) is increasing or decreasing, where
\(f(x) = x^5\)
\(f(x)=\mathrm{e}^x\).
Part a
The first and second derivative are \(f'(x)=5x^4\) and \(f''(x)=20x^3.\) To find where \(f'\) is increasing, find out where \(f''\) is positive, which will be on \((0,\infty).\) To find where \(f'\) is decreasing, find out where \(f''\) is negative, which will be on \((-\infty,0).\)
Part b
The first derivative is \[f^\prime(x)=2x\mathrm{e}^x+x^2\mathrm{e}^x\] and so the second derivative is \[f^{\prime\prime}(x)=\left(2x\mathrm{e}^x+x^2\mathrm{e}^x\right)^\prime=2\mathrm{e}^x+2x\mathrm{e}^x+2x\mathrm{e}^x+x^2\mathrm{e}^x=(x^2+4x+2)\mathrm{e}^x.\] Because \(\exp\) is always positive, \(f^{\prime\prime}\) may change whenever \(g\) changes sign, where \(g\) is given by
\[g(x)=x^2+4x+2.\]
The roots of \(g\) are given by \[r=\frac{-4\pm\sqrt{4^2-4(1)(2)}}{2(1)}=\frac{-4\pm\sqrt{8}}{2}=-2\pm\sqrt{2}\] so \(r_1=-2-\sqrt{2}\) and \(r_2=-2+\sqrt{2}.\)
The leading coefficient of \(g\) is positive, so \(g\) is positive on \[(-\infty, -2-\sqrt{2})\cup(-2+\sqrt{2},\infty)\] and negative on \[(-2-\sqrt{2},-2+\sqrt{2}).\]
Therefore \(f^\prime\) is increasing on \((-\infty,-2-\sqrt{2}]\) and \([-2+\sqrt{2},\infty)\) and decreasing on \([-2-\sqrt{2},-2+\sqrt{2}].\)
Example 11
For each function \(f\) that is given below, \(f(t)\) is the position of a particle at time \(t\) that is moving on a horizontal line:
- \(f(t) = 3t+1\);
- \(f(t) = 10+2t-10t^2\);
- \(f(t)={\rm e}^{-t^2}\)
- \(f(t)=5\arctan(t+3)\).
For each of these functions, find all maximal intervals on which the particle is speeding up or speeding down.
Part a
The first and second derivative are \(f'(t)=3\) and \(f''(t)=0\). The first derivative describes velocity and the second derivative describes acceleration. So the particle is speeding up when the first and second derivative are the same sign and it will be speeding down when first and second derivative are opposite sign. In this case, the particle is neither speeding up nor speeding down. It is always at constant velocity.
Part b
The first and second derivative are \(f'(t)=-20t+2\) and \(f''(t)=20\). The first derivative describes velocity and the second derivative describes acceleration. So the particle is speeding up when the first and second derivative are the sign and it will be speeding down when first and second derivative are opposite sign. In this case, the particle is speeding up when \(t<\tfrac{1}{10}\) and speeding down when \(t>\tfrac{1}{10}\).
Part c
The first derivative is \[f^\prime(t)=-2t\mathrm{e}^{-t^2}\] so the second derivative is \[f^{\prime\prime}(t)=-2\mathrm{e}^{-t^2}+4t^2\mathrm{e}^{-t^2}=(-2+4t^2)e^{-t^2}.\] Because \(\exp\circ(-\pow_2)\) is always positive, \(f^{\prime\prime}\) may change whenever \(g\) changes sign, where \(g\) is given by
\[g(t)=-2+4t^2.\]
The roots of \(g\) are given by
\[r=\pm\sqrt{\frac{1}{2}}\]
so \(r_1=-\frac{1}{\sqrt{2}}\) and \(r_2=\frac{1}{\sqrt{2}}.\) The leading coefficient of \(g\) is positive, so \(g\) is negative on \(\left(-\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\right)\) and positive on \(\left(-\infty,-\frac{1}{\sqrt{2}}\right)\cup \left(\frac{1}{\sqrt{2}},\infty\right).\) Therefore the particle accelerates to the right on the intervals \(\left(-\infty,-\frac{1}{\sqrt{2}}\right]\) and \(\left[\frac{1}{\sqrt{2}},\infty\right)\) and accelerates to the left on the interval \(\left[-\frac{1}{\sqrt{2}},\frac{1}{\sqrt{2}}\right].\)
Part d
The first derivative is \[f^\prime(t)=\frac{5}{(t+3)^2+1}=\frac{5}{t^2+6t+10}\] so the second derivative is \[f^{\prime\prime}(t)=-\frac{5(2t+6)}{(t^2+6t+10)^2}=\frac{-10t-30}{(t^2+6t+10)^2}.\] The denominator of \(f^{\prime\prime}\) is never zero, so the sign change of \(f^{\prime\prime}\) occurs whenever the numerator changes sign. The numerator is positive when \(t<-3\) and negative when \(t>-3\). Therefore the particle accelerates to the right on the interval \((-\infty,-3)\) and accelerates to the left on the interval \((-3,\infty).\)
Concavity and Curve Sketching
The second derivative reveals a lot about the shape of a function. Here are two words we use to describe the shape of a function using line segments to describe how a function “bends”.
Convex
A function is said to be convex (concave up) on an interval \(I\) if for every \(a\) and every \(b\) in \(I\), if \(L\) is the line that intersects \((a, f(a))\) and \((b, f(b))\), then for each \(x\) in \((a,b)\), \[L(x) \ge f(x).\] This is to say that \(L\) lies above \(f\) on the interval \([a,b]\).
Visually, we have something like this:
Here is another way the function could bend.
Concave
A function is said to be concave (concave down) on an interval \(I\) if for every \(a\) and every \(b\) in \(I\), if \(L\) is the line that intersects \((a, f(a))\) and \((b, f(b))\), then for each \(x\) in \((a,b)\), \[L(x) \le f(x).\] This is to say that \(L\) lies below \(f\) on the interval \([a,b]\).
In the case of when a function has a second derivative, the sign can be used to identify the concavity.
Theorem on Concavity and Second Derivatives
A function \(f\) has the property that \(f^{\prime\prime}\) is positive on an interval \(I\) “curves upwards” on \(I\) and is \(f\) is convex (concave up) on \(I\),
A function \(f\) has the property that \(f^{\prime\prime}\) is negative on an interval \(I\) “curves downwards” on \(I\) and \(f\) is concanve (concave down) on \(I\).
Here is a visual that summarizes the test.
Points at which the concavity change are called inflection points.
Inflection Point
A point \(x_0\) in the domain of a function \(f\) is an inflection point of \(f\) if there is an interval \((a,b)\) that contains \(x_0\) so that \(f^{\prime\prime}\) is defined on \((a, x_0)\cup (x_0, b)\) and either
\(f^{\prime\prime}(x)\) is negative for all \(x\) in \((a, x_0)\) and positive for all \(x\) in \((x_0, b)\) or
\(f^{\prime\prime}(x)\) is positive for all \(x\) in \((a, x_0)\) and negative for all \(x\) in \((x_0, b)\).
In other words, the sign of \(f"\) changes at \(x_0\).
Use these next examples to practice identifying inflection points and determining concavity of a function.
Example 12
For each function \(f\) that is given below, find all inflection points of \(f\) and give all maximal intervals on which \(f\) is convex or concave:
- \(f(x) = (x-5)^2\);
- \(f(x) = 5x{\rm e}^{-x^2}\);
- \(f(x) = x^{\frac{3}{5}}\).
- The first and second derivative are \(f'(x)=2(x-5)\) and \(f''(x)=2\). The second derivative is always positive, so \(f\) is convex (concave up) on \(\mathbb{R}\). It is never concave (concave down). So there are no inflection points
- The first and second derivative are \(f'(x)=5e^{-x^2}-10x^2e^{-x^2}\) and \(f''(x)=-10xe^{-x^2}-20xe^{-x^2}+20x^3e^{-x^2}=-30xe^{-x^2}+20x^3e^{-x^2}=(-30+20x^2)xe^{-x^2}.\) The second derivative is zero at \(x=0\) and \(x=\sqrt{\frac{3}{2}}\) and \(x=-\sqrt{\frac{3}{2}}\). The second derivative is positive on \(\left(-\sqrt{\tfrac{3}{2}},0\right)\) and \(\left(\sqrt{\tfrac{3}{2}},\infty\right)\), so the function is convex (concave up) on these intervals. The second derivative is negative on \(\left(-\infty,-\sqrt{\tfrac{3}{2}}\right)\) and \(\left(0,\sqrt{\tfrac{3}{2}}\right)\), so the function is convex (concave down) on these intervals. Therefore, \(x=0\) and \(x=\sqrt{\frac{3}{2}}\) and \(x=-\sqrt{\frac{3}{2}}\) are inflection points.
Example 13
For each of these choices of function \(f\), identify all inflection points of \(f\), and give all maximal intervals on which \(f\) is concave or convex:
a, \(f(x) = (x-1)\sqrt{|x|}\);
b, \(f(x) = \frac{1}{x-4}\).
Part a
The function \(f\) can be written like this:
\[ f(x)= \begin{cases} (x-1)\sqrt{-x}&\text{if }x<0\\ (x-1)\sqrt{x}&\text{if }x\geq 0. \end{cases} \]
The first derivative is
\[ f^\prime(x)= \begin{cases} \sqrt{-x}-\frac{x-1}{2\sqrt{-x}}&\text{if }x<0\\ \sqrt{x}+\frac{x-1}{2\sqrt{x}}&\text{if }x> 0. \end{cases} \]
When \(x<0\)
\[\begin{align*} f^{\prime\prime}(x)&=\left(\sqrt{-x}-\frac{x-1}{2\sqrt{-x}}\right)^\prime\\ &=-\frac{1}{2\sqrt{-x}}-\frac{2\sqrt{-x}+\frac{x-1}{\sqrt{-x}}}{(2\sqrt{-x})^2}\\ &=-\frac{1}{2\sqrt{-x}}-\frac{2\sqrt{-x}+\frac{x-1}{\sqrt{-x}}}{-4x}\\ &=-\frac{1}{2\sqrt{-x}}+\frac{2\sqrt{-x}+\frac{x-1}{\sqrt{-x}}}{4x}\\ &=\frac{2\sqrt{-x}}{4x}+\frac{2\sqrt{-x}+\frac{x-1}{\sqrt{-x}}}{4x}\\ &=\frac{4\sqrt{-x}+\frac{x-1}{\sqrt{-x}}}{4x}\\ &=\frac{-4x+(x-1)}{4x\sqrt{-x}}\\ &=-\frac{3x+1}{4x\sqrt{-x}}. \end{align*}\]
When \(x>0\)
\[\begin{align*} f^{\prime\prime}(x)&=\left(\sqrt{x}+\frac{x-1}{2\sqrt{x}}\right)^\prime\\ &=\frac{1}{2\sqrt{x}}+\frac{2\sqrt{x}-\frac{x-1}{\sqrt{x}}}{(2\sqrt{x})^2}\\ &=\frac{2\sqrt{x}+2\sqrt{x}-\frac{x-1}{\sqrt{x}}}{4x}\\ &=\frac{4\sqrt{x}-\frac{x-1}{\sqrt{x}}}{4x}\\ &=\frac{4x-(x-1)}{4x\sqrt{x}}\\ &=\frac{3x+1}{4x\sqrt{x}}. \end{align*}\]
Hence,
\[ f^{\prime\prime}(x)= \begin{cases} -\frac{3x+1}{4x\sqrt{|x|}}&\text{if }x<0\\ \frac{3x+1}{4x\sqrt{x}}&\text{if }x> 0. \end{cases} \]
The second derivative is zero when \[-3x+1=0\] and the second derivative is undefined when \[4x\sqrt{|x|}=0.\]
The second derivative is positive on \(\left[-\frac{1}{3},0\right)\cup(0,\infty)\) and negative on \(\left(-\infty,-\tfrac{1}{3}\right)\). So \(f\) is convex on \(\left[-\frac{1}{3},0\right]\) and \([0,\infty)\) and concave on \(\left(-\infty,-\tfrac{1}{3}\right].\) The function \(f\) only has an inflection point at \(-\tfrac{1}{3}.\)
Note: \(f\) is not convex \(\left[-\frac{1}{3},\infty\right).\)
Part b
The first derivative is
\[ f^\prime(x)=-\frac{1}{(x-4)^2} \]
and the second derivative is
\[ f^{\prime}(x)=\frac{2}{(x-4)^3}. \]
It is undefined at \(x=4\).
The second derivative is positive on \((4,\infty)\) and negative on \((-\infty,4),\) so \(f\) is convex on \((4,\infty)\) and concave on \((-\infty,4).\) However, \(4\) is not an inflection point because its not in \(\mathcal{D}(f)\).
Use this next example to visually identify concavity.
Example 14
Determine which of these points that are marked on this sketch of the function \(f\) appear to be inflection points of \(f\):
Inflection point is where concavity changes. This occurs at \(x=-5\), \(x=-3\), \(x=1\), \(x=2\), \(x=4\), \(x=6.\)
Just like with the first derivative, there is a theorem that allows us to use the first and second derivative to control the growth of the function.
Second Order Control Theorem
Take \(f\) to be a twice differentiable function on the interval \([a,b]\) such that there is a real number \(M\) so that \[|f^{\prime\prime}(x)|\leq M\quad\text{for all }[a,b].\] Then for all \(x\) in \([a,b]\),
\[f(a)+f^\prime(a)(x-a)-\tfrac{M}{2}(x-2)^2\leq f(x)\leq f(a)+f^\prime(a)(x-a)+\tfrac{M}{2}(x-2)^2.\]
Use this theorem to obtain bounds for the following example.
Example 15
Take \(f\) to be a twice differentiable function on \([0,4]\) and suppose that \(|f^{\prime\prime}(x)|\) is bounded above by \(K\) for all \(x\) in \([0,4]\). Sketch the smallest region in the plane that is guaranteed to contain \(f\), where \[K = \tfrac{1}{2}, \quad f(0) = 2, \quad f^\prime(0) = 1, \quad f(2) = 3, \quad f^\prime(2) = \tfrac{1}{2},\quad f(4) = 3, \quad \text{and} \quad f^\prime(4) = 0.\]
Each data point gives a different region and the intersection of all these region is the smallest region that is guaranteed to contain \(f.\)
- The Second Order Control theorem states for \(f\) with \(|f^{\prime\prime}(x)|\leq \frac{1}{2}\) for all \(x\) in \([0,4]\), \(f(0)=2\), and \(f^{\prime}(0)=1\), \(f\) satisfies the inequality \[2+(x-0)-\tfrac{1}{4}x^2\leq f(x)\leq 2+(x-0)+\tfrac{1}{4}x^2\] for all \(x\) in \([0,4]\). The region looks like this:
- The Second Order Control theorem states for \(f\) with \(|f^{\prime\prime}(x)|\leq \frac{1}{2}\) for all \(x\) in \([0,4]\), \(f(2)=3\), and \(f^{\prime}(2)=\tfrac{1}{2}\), \(f\) satisfies the inequality \[3+\tfrac{1}{2}(x-2)-\tfrac{1}{4}(x-2)^2\leq f(x)\leq 3+\tfrac{1}{2}(x-2)+\tfrac{1}{4}(x-2)^2\] for all \(x\) in \([0,4]\). The region looks like this:
- The Second Order Control theorem states for \(f\) with \(|f^{\prime\prime}(x)|\leq \frac{1}{2}\) for all \(x\) in \([0,4]\), \(f(4)=3\), and \(f^{\prime}(4)=0\), \(f\) satisfies the inequality \[3-\tfrac{1}{4}(x-4)^2\leq f(x)\leq 3+\tfrac{1}{4}(x-4)^2\] for all \(x\) in \([0,4]\). The region looks like this:
Altogether this is what the smallest region looks like:
Graphical representation of a function is important for capturing and encoding certain useful information about a function in a form that is easily accessible by the human mind and human perception. Precision is not necessarily important.
The level of precision that should be captured in the sketch of a function depends on the intended use of the sketch.
Example 16
Sketch an example of a continuous function \(f\) that has the property that \(f^{\prime\prime}\) is negative on \((-\infty, -1)\cup(3, \infty)\), \(f^{\prime\prime}\) is positive on \((-1, 3)\), the zero set of \(f^{\prime\prime}\) is \(\{-1,3\}\), \(f^\prime\) is positive on \((-\infty, 4)\), and \(f^\prime\) is negative on \((4, \infty)\).
Negative second derivative means that \(f\) is concave (concave down) on \((-\infty,-1)\cup(3,\infty)\) while \(f\) is convex (concave up) on \((-1,3)\) since the second derivative is positive. The second derivative has zeros at \(-1\) and \(3\) and the sign changes, so the function has inflection points at \(-1\) and \(3\). The first derivative is positive on \((-\infty,4)\) which means \(f\) is increasing on that interval while decreasing on \((4,\infty)\) since \(f'\) is negative. Here is an example of a function that satisfies these requirements.
In this next example, determine the first order and second order information to sketch this function.
Example 17
Sketch the function by finding where \(f\) is increasing, decreasing, convex (concave up), concave (concave down), and where \(f\) has a local max, local min, and inflection points. \[f(x) = x(x+1)(x-2).\]
The first and second derivative are \(f'(x)=3x^2-2x-2=3 (x - \tfrac{1}{3})^2 - \tfrac{7}{3}\) and \(f''(x)=6x-2.\) The first derivative is positive on \(\left(-\infty, -\tfrac{1}{3}-\frac{\sqrt{7}}{3}\right)\) and \(\left(-\tfrac{1}{3}+\frac{\sqrt{7}}{3},\infty\right)\) so it is increasing on these intervals.
The first derivative is negative on \(\left(-\tfrac{1}{3} -\frac{\sqrt{7}}{3},\tfrac{1}{3} + \frac{\sqrt{7}}{3}\right)\), so \(f\) is decreasing there.
Based on this information, the derivative goes from positive to negative at \(-\tfrac{1}{3}-\frac{\sqrt{7}}{3}\) so \(f\) has a local max there.
The derivative goes from negative to positive at \(-\tfrac{1}{3}+\frac{\sqrt{7}}{3}\) so \(f\) has a local min there.
The second derivative is negative on \((-\infty,\frac{1}{3})\) so \(f\) is concave down there while \(f\) is concave up on \((\frac{1}{3},\infty)\) since \(f''\) is positive.
There is a sign change at \(x=\frac{1}{3}\), so that is an inflection point. Here is an example of the graph.
In this next example, determine the first order and second order information to sketch this function.
Example 18
Precisely sketch the function \(f\) that is given by \[f(x) = |x|\mathrm{e}^{-x}.\]
The function can be written like this:
\[ f(x)= \begin{cases} -x\mathrm{e}^{-x}&\text{if }x<0\\ x\mathrm{e}^{-x}&\text{if }x\geq 0\\ \end{cases} \]
so the first derivative is
\[ f^{\prime}(x)= \begin{cases} -\mathrm{e}^{-x}+x\mathrm{e}^{-x}&\text{if }x<0\\ \mathrm{e}^{-x}-x\mathrm{e}^{-x}&\text{if }x> 0\\ \end{cases}\quad\text{which is equivalent to}\quad f^{\prime}(x)= \begin{cases} (x-1)\mathrm{e}^{-x}&\text{if }x<0\\ (1-x)\mathrm{e}^{-x}&\text{if }x> 0. \end{cases} \]
The second derivative is
\[ f^{\prime\prime}(x)= \begin{cases} \mathrm{e}^{-x}-(x-1)\mathrm{e}^{-x}&\text{if }x<0\\ -\mathrm{e}^{-x}-(1-x)\mathrm{e}^{-x}&\text{if }x> 0\\ \end{cases}\quad\text{which is equivalent to}\quad f^{\prime}(x)= \begin{cases} (2-x)\mathrm{e}^{-x}&\text{if }x<0\\ (x-2)\mathrm{e}^{-x}&\text{if }x> 0. \end{cases} \]
The function is not differentiable at \(0\).
Analyze the sign of \(f^\prime\) and \(f^{\prime\prime}\) by determining the critical values to see that \(f\) has a local minimum at \(0\), a local maximum at \(1\), is increasing on \([0,\infty)\), decreasing on \((-\infty,0]\), convex on \((-\infty,0]\) and \([2,\infty)\), concave on \([0,2]\), and has inflection points at \(0\) and \(2\).
Additionally, \(f\) bounded below by \(0\) is unbounded from above because
\[\lim_{x\to \infty}|x|\mathrm{e}^{-x}=\lim_{x\to \infty}x\mathrm{e}^{-x}=0\quad\text{and}\lim_{x\to -\infty}|x|\mathrm{e}^{-x}=\lim_{x\to -\infty}-x\mathrm{e}^{-x}=\infty.\]
Here is a sketch of \(f\) that incorporates all this information: