next up previous
Next: About this document ... Up: lab_temp Previous: lab_temp

Subsections


First and second derivative tests

Purpose

Background

Suppose that $f(x)$ is a differentiable function. Then we know that the value of $f'(x)$ gives the slope of the tangent line at $x$. Geometrically, the slope of the tangent line at a particular point $x=a$ tells us whether the value of the function is increasing, decreasing, or staying the same as we look at values of $x$ near $a$. In applications, one is often trying to find the minimum or maximum values of a function so it turns out to be important to be able to determine when a function is increasing and when it is decreasing. Mathematically, we say that a function is increasing on an interval $I$ if $x_1 < x_2$ means $f(x(1) < f(x_2)$ for every pair of numbers $x_1,x_2$ in $I$. Conversely, we we say that a function is decreasing on an interval $I$ if $x_1 < x_2$ means $f(x(1) > f(x_2)$ for every pair of numbers $x_1,x_2$ in $I$. These are the definitions of increasing and decreasing functions, but they are not very easy to apply. Most often, we use the first derivative as described in the following theorem.

Theorem 1   Suppose $f$ is continuous on an interval $I$ and differentiable at every interior point of $I$.
  1. If $f'(x) > 0$ on the interior of $I$, then $f$ is increasing on $I$.
  2. If $f'(x) < 0$ on the interior of $I$, then $f$ is decreasing on $I$.

This theorem says that we can determine when a function is increasing or decreasing by solving the inequalities $f'(x) > 0$ and $f'(x) , 0$. In practice, we usually work with functions having continuous derivatives, which means that $f'$ can change sign only at a point where $f'(x)=0$. For example, consider $f(x) = x^2$. The derivative is $f'(x) = 2x$, which is zero only at $x=0$. This critical point divides the real line up into two intervals, $x<0$ and $x>0$. Since $f'$ can never be zero if $x \neq 0$, the sign of $f'(x)$ is constant on each interval. That is for $x<0$ we have $f'(x) = 2x
<0$ so $f$ is decreasing for $x<0$. Similarly, $f$ is increasing for $x>0$. This suggests the following procedure for determining where a function is increasing or decreasing.
  1. Find the critical points of $f$. Note that according to the definition in the text, critical points of $f$ are points where either $f'$ is zero, the derivative doesn't exist, or endpoints of $I$ if $f$ is defined on a finite interval $I$.
  2. The critical points divide the domain of $f$ into subintervals on which the sign of $f'$ is constant. Check the sign of $f'$ at one interior point on each subinterval. If it is positive, $f$ is increasing on that subinterval. If it is negative, $f$ is decreasing on that subinterval.

The second derivative, $f''(x)$ also provides information about the shape of the curve in terms of what is called concavity. Concavity can also be defined in several ways. Geometrically, it can be said that the graph of $f$ is concave up near a point $x=a$ if the tangent line at $x=a$ lies below the graph of $f$ on some open interval containing $a$ and is concave up if the tangent line lies above the graph of $f$ on some open interval containing $c$. Algebraically, concavity is most often defined by saying that $f$ is concave up on an interval $I$ if $f'$ is increasing on $I$ and is concave down on $I$ if $f'$ is decreasing on $I$. Using the theorem above and remembering that $f''$ is the derivative of $f'$ gives the following result.

Theorem 2   Suppose $f$ be twice differentiable on the open interval $I$.
  1. If $f''(x) > 0$ on $I$, then $f$ is concave up on $I$.
  2. If $f''(x) < 0$ on $I$, then $f$ is concave down on $I$.

This means that we can find where $f$ is concave up and concave down using the same procedure on $f''$ that we used on $f'$. That is, we first find all of values of $x$ for which $f''(x)=0$, or $f''(x)$ doesn't exist. Including the endpoints, if our domain is a finite interval, these values of $x$ are the endpoints of distinct subintervals on which the sign of $f''$ is constant. Checking the sign of $f''$ at one point in the interior of each subinterval determines the concavity of $f$ on that subinterval.

Remember also that the second derivative can be helpful in determining local maximums and local minimums. That is, if you find a critical value, where $f'(x)=0$ or is undefined, then substitute the critical value into the second derivative. If the second derivative is positive, then there is a relative minimum there and if the second derivative is negative, then there is a relative maximum there.

Using Maple

The Maple commands that are most useful are the ones for plotting functions, taking derivatives, and solving equations. By plotting the function and/or its derivatives, you can get a very good idea of where it is increasing/decreasing and where it is concave up/concave down. Then using the solve or fsolve commands you can find the values of $x$ where $f'(x)=0$ or $f''(x)=0$. Finally, you can use Maple to check the signs of $f'$ or $f''$ in the interior of the subintervals. The example below shows how you can use Maple to find intervals where the function $f(x)=x^3-3*x+1$ is increasing and decreasing.
> f := x-> x^3-3*x+1;
> plot(f(x),x=-3..3);
> solve(D(f)(x)=0,x);
> D(f)(-2);
> D(f)(0);
> D(f)(2);
The plot helps to see how many critical values you have. The solve command shows that there are critical values at $x=-1$ and $x=1$ which means that the intervals can be broken up into $(-\infty,-1)$, $(-1,1)$, and $(1,\infty)$. Remember that if solve doesn't work or doesn't find all critical values, you can use the fsolve command specifying ranges for $x$ in which to solve. Then chosing a point in each interval, we can see that the value of the derivative is positive at $x=-2$ which implies that the function is increasing on the interval $(-\infty,-1)$. We can also use the second derivative test to classify $x=-1$ and $x=1$ as relative maximum or relative minimum. See the Maple commands below to help you do this.
> D[1,1](f)(-1);
> f(-1);
> D[1,1](f)(1);
> f(1);
As you can see, the value of the second derivative at $x=-1$ is negative implying that $(-1,3)$ is a relative maximum. The value of the second derivative at $x=1$ is positive which means that $(1,-1)$ is a relative minimum.

Exercises

  1. For the function $\displaystyle f(x) = 2x^3-x^2 \cos(x)-7x$, find the intervals on which $f$ is increasing and the intervals on which it is decreasing.

  2. For the function $\displaystyle f(x)=\frac{x^2-4x+4}{x^2+1}$,
    1. Plot $f(x)$ over the interval $-2 \leq x \leq 2$.
    2. Find all critical values.
    3. Find corresponding $y$ values for each critical value.
    4. Classify each point as a relative maximum or a relative minimum using the second derivative test.

  3. Find the absolute extrema for the function $g(x) = x \cos(x)$ on the closed interval $[0,5]$ without plotting the function. You may plot the derivative to be sure that you have found all critical values.


next up previous
Next: About this document ... Up: lab_temp Previous: lab_temp
Jane E Bouchard
2005-02-01