Chapter 7: Applications of Derivatives

Return to all notes

Increasing and Decreasing Functions

Recall that a function is increasing at the point $x$ if $f'(x)>0$ and it is decreasing if $f'(x) \lt 0$. Maple can help us understand functions and where they are increasing and decreasing using a combination of solving inequalities and taking the derivative.

Here’s an example. Find the intervals where $f(x)=x^{3}-15x^{2}+27x-4$ is increasing the intervals were the function is decreasing. To solve this we will defined the function:

f:=x->x^3-15x^2+27x-4

then we can find where the function is increasing

solve(f'(x)>0,x)

the result is shown as RealRange(-$\infty$, Open(1)), RealRange(Open(9),$\infty$), which can be written in the standard way as $(-\infty,1)\cup(9,\infty)$.

The interval of decrease is found with solve(f'(x)<0) resulting in (Open(1),Open(9)) which is the standard interval $(1,9)$.

We can see this using the following plot of the function:

Plot of the function $f$ showing intervals of increase and decrease

and looking carefully, the function is increase from $-\infty$ to 1 and then also from 9 to $\infty$. It is decreasing on the interval $(1,9)$.

Mean Value Theorem

Recall that the Mean Value Theorem is as follows:

Let $f$ be a function that is continuous on $[a,b]$ and differentiable on $(a,b)$. There exists a value $c$ in $(a,b)$ such that
$$f'( c )=\frac{f(b)-f(a)}{b-a}$$

In short, the MVT says that for nice functions, there is a tangent line that is parallel to the secant line. This is nicely visualized using a CAS like Maple. Let’s consider the function $f(x)=x^{2}+x$ on the interval $[0,2]$. Since this function is continuous and differentiable everywhere, it satisfies the Mean Value Theorem, and therefore there is a $c$ such that
$$
f'( c ) = \frac{f(2)-f(0)}{2-0} = \frac{6-0}{2} = 3
$$
and then we can find the $c$ by solving $f'( c )=2c+1=3$ or $c=1$. Next, we plot both the function and the secant line:
Plot of the function $f$ and its secant line

and as can be seen, the tangent line appears to be parallel to the secant line. Whenever the conditions of the Mean Value Theorem are satisified, this has to be true.

Critical value and Relative Extrema

A critical value of a function $f$ is a number $x$ in the domain of the function such that $f'(x)=0$ of $f'(x)$ does not exist.

Find all of the critical points of the function: $f(x)=x^{3}-15x^{2}+27x-4$

In this case, we solve where the derivative is 0.

solve(f'(x)=0,x)

maple returns $1,9$. Both of the these points are critical points. Since this is a polynomial, the derivative is defined everywhere so there are no places where the derivative is undefined. So the only cricial points are at $1$ and $9$.

Example

Find all of the critical points of the function $g(x) = |x^{2}-4|$.

If we define:
g:=x->|x^2-4|
and then

solve(g'(x)=0,x)

returns 0. Is this the only critical points? Let’s take a look at a plot of this:

Plot of $|x^{2}-4|$

Looking at the plot, there is indeed a critical point at $x=0$ because $f'(0)=0$, but it also appears that there are critical points where the derivative is undefined at $x=-2$ and $x=2$. Let’s see how Maple can help find these.

If we differentiate $g$, the we get 2x*abs(1,x^2-4). In short, abs(1,x^2-4) means the derivative of the absolute value. It basically translates to the sign of the function. Check out the help page on abs for more information.

To find the critical poins of this, we need to find where the function $x^{2}-4$ is zero or solve(x^2-4=0,x), which returns $-2,2$. Thus there are three critical points of this function, $-2, 0,2$.

Relative Extrema

A relative minimum of $f$ is a number $f( c )$, such that $f(x) ≥ f( c )$ for all $x$ near $c$. A relative maximum of $f$ is a number $f( c )$, such that $f(x) \leq f( c )$ for all $x$ near $c$. The term relative extrema is either a relative minimum or maximum.

As an example, let’s return to the function $f(x)=x^{3}-15x^{2}+27x-4$. From the plot reproduced here:
Plot of the function $f$

There appears to be a relative minimum of $f(9)=-239$ and a relative maximum of $f(1)=17$. As always it’s very difficulty to tell exactly the location(s) of relative extrema.

Theorem A number $f( c )$ is an relative minimum if $c$ is a critical value and $f'(x) \lt 0$ for $x \lt c$ and $f'(x) \gt 0$ for $x \gt c$. A number $f( c )$ is a relative maximum if $c$ is a critical value and $f'(x) \gt 0$ for $x \lt c$ and $f'(x) \lt 0$ for $x \gt c$.

In short, if $c$ is a critical value and $if'$ switches sign from positive to negative, then $f( c )$ is a relative maximum. If $f'$ switches sign from negative to positive, then $f( c )$ is a relative minimum. Also,

Often, we can build a chart of the value of the derivative and let’s let Maple help us do this.

First, recall that we found the critical values of the function to be $1,9$. If we pick a value to the left of 1, between 1 and 9 and to the right of 9 and evaluate the derivative, we can determine that in fact, we have relative minima and maxima.

xValues:=[x,0,1,5,9,12]

then the following will evaluate the derivative at these points:

Matrix(map(a->[a,f'(a)],xValues))

which returns the matrix:
\[
\begin{array}{cc}
x&f'(x)\newline
0&27\newline
1&0\newline
5&-48\newline
9&0\newline
12&99\end{array}
\]

So the derivative goes from positive to negative across $x=1$, so that is a location of a relative maximum. And the derivative goes from negative to positive across $x=9$, so that is a relative minimum.

Example

Find all relative extrema of $g(x)=|x^{2}-4|$.

From above, the critical point are $-2,0,2$. And if we repeat the steps above:

xValues:=[-3,-2,-1,0,1,2,3]
Matrix(map(a->[a,g'(a)],xValues))

an error: Error, (in simpl/abs) abs is not differentiable at 0 because at $-2$ and $2$, the derivative is not defined. Let’s throw those points out:

xValues:=[-3,-1,0,1,3]
Matrix(map(a->[a,g'(a)],xValues))

$$\begin{array}{cc}
x&g'(x)\newline
-3 & -6 \newline
-1 & 2 \newline
0 & 0 \newline
1 & -2 \newline
3 & 6 \end{array}
$$
and remembering that the function is undefined at $x=-2$ and $x=2$, then the derivative switches sign from negative to positive at $x=-2$, so it is relative min, the derivative switches sign from positive to negative at $x=0$, so it is a relative max and the derivative switches sign from negative to positive at $x=2$, so it is a relative min.

Exercise

Find all relative extrema of $(x^{3}-4x)^{1/3}$. Hint: use the surd command. You should use a plot, but to show they are relative extrema, find all critical points as above and evaluate the derivative at points between critical points.

Concavity of a Graph and Inflection points.

A graph of a function $f$ is concave up at the point $x$ if it’s derivative is increasing or $f^{\prime\prime}(x)>0$. A graph of a function $f$ is concave down at the point $x$ if it’s derivative is decreasing or $f^{\prime\prime}(x)\lt 0$.

Example

Find the intervals on which the function $f(x)=x^{4}-3x^{2}-1$ is concave up and concave down.

If we solve

solve(f''(x)>0)

we get the intervals $(-\infty,-\frac{\sqrt{2}}{2})$ and $(\frac{\sqrt{2}}{2},\infty)$ so this is where the function is concave up. And

solve(f''(x) < 0)

results in the interval $(-\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2})$.

Recall that an inflection point of a function is a $x$-coordinate where the con

Relative Extrema and the Second Derivative

There is an alternative way to test for relative extrema by using the second derviative. Generally, it’s often easier to use if the second derivative exists.

Theorem If $f'( c )=0$ and $f^{\prime\prime}(c )>0$, then $f( c )$ is a relative minimum. If $f'( c )=0$ and $f^{\prime\prime}( c )< 0$, then $f( c )$ is a relative maximum.

Example

Use the theorem above to find the relative extrema of $f(x)=x^{3}-15x^{2}+27x-4$.

Again, if we find the $x$ values where the derivative is 0 (Note: we did this above), using:

solve(f'(x)=0,x)

get $1,9$ again. And since $f^{\prime\prime}(1)= -24$, $f(1)$ is a relative maximum and since $f^{\prime\prime}(9)=24$, then $f(9)$ is a relative minimum.

Example

Can we use the above theorem to find the relative extrema of $g(x)=|x^{2}-4|$?

We can for the critical value of $x=0$ and since $g^{\prime\prime}(0)=-2$, then $g(0)$ is a relative maxmium. However, since the derivative (and therefore second derviative) is not defined at $x=-2$ and $x=2$, then we can’t use this theorem for these critical points. The theorem above about the swtiching signs of the derivative still holds.

Exercise

Use the above theorem to find the relative extrema of $f(x)=e^{-x}(x^{2}-6x-6)$

Absolute Maxima and Minima

Extrema Value Theorem

If $f$ is continuous on a closed interval $[a,b]$, then $f$ attains an absolute maximum value $f( c )$ and an absolute minimum $f(d)$ at some numbers $c$ and $d$ in $[a,b]$.

Closed Interval Method

The following steps will find the absolute maximum and minimum:

  1. Find all critical values of $f$.

  2. Evaluate $f$ on all points in 1) within the interval as well as the two endpoints.

  3. The smallest function value in 2) is the absolute min and the largest is the absolute maximum.

Example

Find the absolute maximum and minimum of $g(x)=|x^{2}-4|$ on the interval $[-1,4]$

  1. The critical values of $g$ are $-2,0$ and $2$ (see above)

  2. We evaluate $g$ at only the values $0$ and $2$ from 1) because $-2$ is not in the interval $[-1,4]$ and the values $-1$ and $4$.

    To do this in Maple

    xValues:=[0,2,-1,4]
    Matrix(map(a->[a,g(a)],xValues))

    returns

    $$\left[\begin{array}{cc}
    0 & 4 \newline
    2 & 0 \newline
    -1 & 3 \newline
    4 & 12 \end{array}\right]$$

  3. The smallest function value is 0, so this is the absolute minimumum and the largest function value is 12, so this is the aboslute maximum. The absolute minimum occurs at $x=2$ and the absolute maximum occurs at $x=4$.

Example

Find the dimensions of the rectangle with the largest area that fits underneath the function $f(x)=\sqrt{4-x^{2}}$ and the base of the rectangle is on the $x$-axis.

Plot of the function $f$ and a rectangle

Let half of the width of the rectangle be $x$ (so the height is $f(x)$). Therefore the area is
$$A=2xf(x)=2x\sqrt{4-x^{2}}$$
and we seek to find the absolute maximum of this function.

Note that since no interval was given, we will use the domain of the function as the domain. Since the square root must be greater than or equal to 0, the domain is

solve(4-x^2>=0,x)

results in the interval $[-2,2]$, so this is the interval for the closed interval method.

The first step is to find the critical points. Let

A:=x->2x*sqrt(4-x^2)

and find where the derivative is zero.

solve(A'(x)=0)

results in $[-\sqrt{2},\sqrt{2}]$. And find where where the derivative is undefined.

simplify(A'(x))

results in
$$-4\,{\frac {x^{2}-2}{\sqrt {-x^{2}+4}}}$$

and the derivative will be undefined where the denominator is zero or

solve(denom((#)))

where the (#) is the line number of the expression above and the result is $-2,2$.

The second step is to evaluate the function at all the critical points as well as the endpoints (which are $-2$ and $2$, the same as two of the critical points.)

xValues:=[-sqrt(2),sqrt(2),-2,2]
Matrix(map(a->[a,A(a)],xValues))

results in
$$\left[\begin{array}{cc}
-\sqrt{2} & -4 \newline
\sqrt{2} & 4 \newline
-2 & 0 \newline
2 & 0
\end{array}\right]$$

so the absolute maximum is $4$ and occurs when $x=\sqrt{2}$.

Recall that the question asked for the dimensions of the retangle. So the width is $2x$ which is $\sqrt{2}$ and the height is $f(\sqrt{2})= \sqrt{2}$.

Exercise

A can is in the shape of a right circular cylinder. What are the dimensions (radius and height) of the can that holds 1000 $\text{cm}^{3}$ of liquid and uses the smallest amount of material. Note: in this case, you don’t need a closed interval, but you should show that the amount of material (or the surface area) is a minimum by using the second derivative test.

Using the built-in maximum and minimum function

Maple also has a maximum and minimum function for a given interval. For example to repeat finding the absolute minimum and maximum values of $g(x)=|x^{2}-4|$ on the interval $[-1,4]$, we can type

maximize(g(x), x = -1 .. 4)

which returns 12 and

minimize(g(x), x = -1 .. 4)

which returns 0.

If we want to also find the location of the maximum and minimum, we use the location option.

minimize(g(x),x=-1..4,location)

which returns 0, {[{x = 2}, 0]} which is a fairly complicated way to say that the minimum is 0 and is located at $x=2$.

Again, like above, if we are asked for the dimensions of the rectangle, we need to recall that the width is $2x$ and the height is $\sqrt{4-x^{2}}$, so

subs(x=sqrt(2),2x)

and

subs(x=sqrt(2),sqrt(4-x^2))

returns $2\sqrt{2}$ and $\sqrt{2}$ as the dimensions.

Example

Use Maple’s built-in functions to find the maximum area from the example above.

maximize(2x*sqrt(4-x^2),x=-2..2,location)

returns 4, {[{x = sqrt(2)}, 4]} which means that the function reaches a maximum of 4 when $x=\sqrt{2}$.

Using Calculus to find accurate plots

This section also shows that we can use Calculus to help us find a good plotting window. Consider the following function:
$$f(x)=3x^{4}+320x^{3}+3000x^{2}-600000x+5000$$

If we just plot it in Maple, we get:

Plot of the function $f$

which doesn’t look right. It’s a quartic (because of the largest power of $x$) with positive $x^{4}$ term so it should be a bit like $x^{2}$ for large $|x|$.

We could blindly poke around for a good plotting window, but instead we’ll find any important features. First, let’s find the critical points.

solve(f'(x)=0)

results in $20,-50,-50$, so there are two critical points. If we make sure we include these,

plot(f(x),x=-80..40)

we get the following plot:

Plot of $f$ with a better plotting window

Another Example

Plot $g(x)=10000x^{5}-x^{3}$.

Again, a plot of this results in

Plot of the function $g$

How do we know if this is correct. A little knowledge of a function with $x^{5}$ as the leading term means that it could be right because it may look like $x^{3}$, but it’s hard to tell. Let’s check for critical points.

solve(g'(x)=0)

results in
$$0, 0, \frac{\sqrt{15}}{500}, -\frac{\sqrt{15}}{500}$$
and then making this a decimal approximation

evalf((#))

where (#) is the line number of the previous output and the result is
$$[0., 0., 0.007745966692, -0.007745966692]$$
so the critical points are not visible on the previous plot. In this case, if we change the plotting window using

plot(g(x), x = -0.011..0.011)

we get the plot

Plot of $g$ with a better plotting window

One more example

Lastly, let’s look at the plot of
$$h(x)=\frac{1}{x^{8}}-200000000\frac{1}{x^{4}}$$
where the standard plot looks like:

Plot of the function $h$
which doesn’t look good.

Let’s start looking for the $x$-intercepts.

fsolve(numer(h(x)) = 0)

where we have used fsolve because an approximate location is sufficient and the function is 0 where the numerator is 0. The result is
$$-0.008408964153, 0.008408964153$$

and let’s look for the critical points:

evalf(solve(h'(x)=0))

results in
$$0.010 -0.0100, 0.0100I, -0.0100I$$
where the last two are imaginary.

If we plot to include these points,

plot(h(x),x=-0.011..0.011)

get:

Another plot of $h$
which doesn’t look any better than the above plot.

Next, let’s change the vertical range. We want to make sure that we are including the $y$-values of the critical points.

h(0.01)
h(-0.01)

both return $-1.000 10^{16}$. If we then do

plot(h(x), x = -0.011..0.011,y=-1.0*10^16..1.0*10^16)

we get

Yet another plot of $h$

which is better, but tinkering a bit more

plot(h(x), x = -0.025..0.025,y=-1.0*10^16..1.0*10^16)

results in

The final plot of $h$