LocalAnalysis.mws

Local Analysis

>    restart;
with( plots ):
with(Student[Calculus1]):

Warning, the name changecoords has been redefined

>   

Auxiliary Procedures

>    InInterval := proc(x,S::list(numeric))
  if has(x,I) then return false end if;
  return evalb( evalf(x)>=op(1,S) and evalf(x)<=op(2,S) )
end proc:

>    TestIncrDecr := proc( df, pts )
  local c, m, fmt1, fmt2;
  Digits := 4;
  fmt1 := "f'(%a)=%a; the function is %a on the subinterval containing %a";
  fmt2 := "f'(%a)=%a; the function has a stationary point at x = %a";
  for c in evalf(pts) do
    m := eval( df, x=c );
    if m>0 then
      print( printf(fmt1, c, m, `increasing`, c) );
    elif m<0 then
      print( printf(fmt1, c, m, `decreasing`, c) );
    else
      print( printf(fmt2, c) );
    end if;
  end do:
end proc:

>    TestConcavity := proc( d2f, pts )
  local a, c, fmt1, fmt2;
  Digits := 4;
  fmt1 := "f''(%a)=%a; the function is concave %a on the subinterval containing %a";
  fmt2 := "f''(%a)=%a; the function has a possible inflection point at x = %a";
  for c in evalf(pts) do
    a := eval( d2f, x=c );
    if a>0 then
      print( printf(fmt1, c, a, `up`, c) );
    elif a<0 then
      print( printf(fmt1, c, a, `down`, c) );
    else
     print( printf(fmt2, c, a, c) );
    end if
  end do:
end proc:

>   

Lesson Overview

Locating the global extrema is only one step in the analyis of a function. In the current lesson the interest is in determining the local behavior of the function. Where is the curve increasing or decreasing? Where is the curve concave up or down? In addition to defining these terms, an important concept in this lesson is the connection between the first derivative and an increasing/decreasing function. Likewise, there is a connection between the second derivative and concavity. These facts form the basis for identifying local extrema and inflection points. The First and Second Derivative Tests are introduced only after you have an opportunity to develop some familiarity with the new concepts. These theorems provide two different ways to look at determining if a critical point is a local maximum or local minimum -- or neither.

The CurveAnalysis  [ Maplet Viewer][ MapleNet] and FunctionAnalyzer  [ Maplet Viewer][ MapleNet] maplets are similar. Either can be used to support the analysis that will be needed in this lesson. A key difference is that the FunctionAnalyzer  maplet can produce sign charts for the first and second derivative. The DerivativePlot  maplet [ Maplet Viewer][ MapleNet] is useful for creating a graph containing almost any combination of the function and its derivatives.

REQUEST: Revised maplets

Since the functionality of these maplets is so similar, maybe it makes sense to beef up the CurveAnalysis  maplet with some of the features of the FunctionAnalyzer  maplet. One unique feature of the FunctionAnalyzer  maplet is its ability to create sign charts for f ' and f '' (even if f is not known). The ability to evaluate the function (or a derivative) at a point is also nice. Maybe you could enhance CurveAnalysis  and create two new maplets, say SignChart  and DerivativeEvaluator  (enter a function or derivative and evaluate expressions at specified points). The DerivativePlot  is much simpler, but also much faster.

>   

Definition: Increasing and Decreasing

Let f be a function defined on an interval I .

Notes

  • A function that is constant on any subinterval of I  is neither increasing nor decreasing.
  • Note that the inequalities are strict.
  • A function is said to be nondecreasing  on   I  when x[1]  < x[2]  implies f(x[1])  <= f(x[2]) .
  • A function is said to be nonincreasing  on   I  when x[1]  < x[2]  implies f(x[1])  >= f(x[2]) .

>   

Point 1: First Derivative Determines Increasing/Decreasing

The definition of an increasing and decreasing function is fairly intuitive. However, it is easiest to implement when a graph of the function is available. The fact that `f '`(c)  is the slope of the tangent line to the graph of y = f(x)  at the point ( c , f(c)  ) suggests that the first derivative should be useful in determining if a function is increasing or decreasing on an interval containing c . The formal connection between increasing/decreasing and the first derivative is contained in the following theorem.

>   

Theorem: Increasing/Decreasing Test

Let f be a function that is

  • continuous on an interval I  and
  • differentiable on I  (except possibly at the endpoints).

Then:

  • if `f '`(x)  > 0 for all x  in I  (except possibly at the endpoints), then f is increasing on I  
  • if `f '`(x)  < 0 for all x  in I  (except possibly at the endpoints), then f is decreasing on I  

Notes

The sign of the derivative at the endpoints is not important.

In fact, it is not a problem if the derivative does not exist at one or both endpoints.

>   

Example 1:   f(x) = x^3-3*x^2-x   

Find the intervals on which the function

>    f1 := x^3 - 3*x^2 - x:
f(x) = f1;

f(x) = x^3-3*x^2-x

is increasing and decreasing.

>   

Because all polynomials are continuous on the entire real line, this function -- and all of its derivatives -- are automatically continuous for all values of x .

Recall that in the GlobalAnalysis lesson (Example 5) it was found that this function has two stationary points.

>    df1 := diff( f1, x ):
`f'`(x) = df1;

`f'`(x) = 3*x^2-6*x-1

>    stat1 := solve( df1 = 0, x ):
stat1;

1+2/3*3^(1/2), 1-2/3*3^(1/2)

Because the derivative is continuous, the Intermediate Value Theorem allows us to conclude that the derivative will have one sign on each of the following three intervals:

 ( -infinity , 1-2/sqrt(3)  ),   ( 1-2/sqrt(3) , 1+2/sqrt(3)  ),   and   ( 1+2/sqrt(3) , infinity  ).

To determine on which of these intervals the function is increasing and on which it is decreasing, simply evaluate the derivative at a convenient point in each subinterval. (The TestIncrDecr  command, defined at the top of this worksheet, evaluates the first derivative at each point and uses the sign of the result to report if the function is increasing or decreasing on the subinterval containing this point (or stationary at the point).)

>    testpts1 := [ -1, 0, 3 ]:
TestIncrDecr( df1, testpts1 );

f'(-1.)=8.; the function is increasing on the subinterval containing -1.

f'(0.)=-1.; the function is decreasing on the subinterval containing 0.

f'(3.)=8.; the function is increasing on the subinterval containing 3.

Thus, the function f(x) = x^3-3*x^2-x  is increasing on  ( -infinity , 1-2/sqrt(3)  ) and ( 1+2/sqrt(3) , infinity  ) and decreasing on ( 1-2/sqrt(3) , 1+2/sqrt(3)  ).

>   

Note

Maple's solve  command can solve some inequalities. In this case, it is able to provide a direct answer to our question.

The function is increasing on

>    solve( df1 > 0, x );

RealRange(-infinity,Open(1-2/3*3^(1/2))), RealRange(Open(1+2/3*3^(1/2)),infinity)

and decreasing on

>    solve( df1 < 0, x );

RealRange(Open(1-2/3*3^(1/2)),Open(1+2/3*3^(1/2)))

To conclude, the graph of this function with the increasing intervals shown in red and the decreasing interval shown in blue confirms these results.

>    p1 := plot( f1, x=-2         ..1-2/sqrt(3), color=red,
            legend=["y = f(x): increasing"] ):
p2 := plot( f1, x=1-2/sqrt(3)..1+2/sqrt(3), color=blue,
            legend=["y = f(x): decreasing"] ):
p3 := plot( f1, x=1+2/sqrt(3)..4,           color=red,
            legend=["y = f(x): increasing"] ):
p4 := plot( df1, x=-2        ..4,           color=green,
            legend=["y = f '(x)"] ):
display( [p1,p2,p3,p4] );

[Maple Plot]

Observe how the graph of the derivative changes sign precisely where the function changes from increasing to decreasing and later from decreasing to increasing.

>   

Maplets to Determine Intervals where a Function is Increasing/Decreasing

There are a number of maplets that can be used to obtain information about where a function is increasing and decreasing.

CurveAnalysis  [ Maplet Viewer][ MapleNet]

The CurveAnalysis  maplet can explicitly identify intervals on which a function is increasing or decreasing. To use this maplet to determine the increasing intervals for a function:

  • enter the function (as a function of x ) and interval (it is best to avoid using infinities but sometimes works with minimal objections)
  • click the button labeled Show the Increasing Intervals  
  • press the Show  button

The interval(s) on which the function is increasing will be shown in the large box labeled Points and Intervals . Note that all intervals appear to be closed intervals.

Obtaining the interval(s) on which the function is decreasing should be apparent. Other features of this maplet will be discussed later in this lesson.

>   

FunctionAnalyzer   [ Maplet Viewer][ MapleNet]

The FunctionAnalyzer  maplet is similar. It has somewhat greater flexibility but requires a little more from the user. To use this maplet to identify the intervals on which a function is increasing:

  • enter the function in the region labeled y =  in the Function  panel
    the first and second derivatives will be computed automatically
  • in the Solve an Equation or Inequality  panel, enter Dy > 0  in the field labeled Enter equation to be solved (use y, Dy, D2y)  
  • press the Attempt to solve equation  button

Maple's results will be displayed in the region immediately above the button you just clicked.

A unique feature of the FunctionAnalyzer  maplet is the ability to create a ``sign chart'' for the first and second derivative of a function. A sign chart can be a particularly effective method to display intervals where a function is increasing or decreasing. To activate this feature:

  • click the Show sign chart box in the First Derivative panel
  • in the fields to the right of the label Horizontal Axis , enter the endpoints of the interval and the name of the independent variable
  • press the Update plot  button

The plotting window will display an empty set of axes except for a horizontal line near the bottom. The function is increasing wherever this line is red and decreasing wherever this line is blue. This is the sign chart for the first derivative.

To include the function and/or first derivative in the plot, click the appropriate Include in plot  buttons in the Function  and First Derivative  panels, then press the Update plot  button.

>   

DerivativePlot   [ Maplet Viewer][ MapleNet]

The DerivativePlot  maplet has a very simple purpose - for a given function, create a graph showing almost any combination of the function and its derivatives. For example, to display a graph of a function and its first derivative:

  • enter the Function  (it is not necessary to enter the range in the a =  and b =  fields)
  • change the orders  field to [ 1 ]  (the square brackets are needed)
  • in the Display Options  panel, click the Show function  and Show derivatives  buttons
  • also in the Display Options  panel, enter the viewing window
  • press the Plot button

The Plot Window  will be updated to contain a plot of the function and its first derivative on the specified interval. (By default, the function will be plotted in red. For this reason it is recommended that you not use red as a color to display a derivative.)

>   

Example 2:   f(x) = (x^3-3*x^2-x)/(x^2-4)   

Find the intervals on which the function

>    f2 := (x^3 - 3*x^2 - x)/(x^2-4):
f(x) = f2;

f(x) = (x^3-3*x^2-x)/(x^2-4)

is increasing and decreasing.

>   

This function is continuous, and differentiable, for all real numbers x  except x = 2  and x = -2 .

The singularities at x = 2  and x = -2  need to be remembered because these are points where the derivative could jump from positive to negative, or vice versa.

>    sing2 := -2, 2:
sing2;

-2, 2

The derivative is

>    df2 := simplify(diff( f2, x )):
`f'`(x) = df2;

`f'`(x) = (x^4-11*x^2+24*x+4)/(x^2-4)^2

Of the four zeroes of the numerator, there are two real-valued solutions. These are stationary points.

>    q1 := solve( numer(df2) = 0, x ):
stat2 := op(remove( has, allvalues([q1]), I )):
evalf[4](stat2);

-.157, -4.081

By the continuity of the derivative and the Intermediate Value Theorem, the derivative can change sign at a point where the derivative is zero (a stationary point) or where the function and/or derivative is not defined (a singular point). Thus, the real line is divided into the following five intervals on which the function is either increasing or decreasing:

 ( -infinity , -4.08 ),   ( -4.08, -2 ),   ( -2, -0.16 ),   ( -0.16, 2 ),   ( 2, infinity  )

To determine on which of these intervals the function is increasing and on which it is decreasing, simply evaluate the derivative at a convenient point in each subinterval.

>    testpts2 := [ -5, -3, -1, 1, 3 ]:
TestIncrDecr( df2, testpts2 );

f'(-5.)=.5306; the function is increasing on the subinterval containing -5.

f'(-3.)=-3.440; the function is decreasing on the subinterval containing -3.

f'(-1.)=-3.333; the function is decreasing on the subinterval containing -1.

f'(1.)=2.000; the function is increasing on the subinterval containing 1.

f'(3.)=2.320; the function is increasing on the subinterval containing 3.

Thus, the function f(x) = (x^3-3*x^2-x)/(x^2-4)  is increasing on ( -infinity , -4.08 ), ( -0.16, 2 ), and ( 2, infinity  ) and decreasing on ( -4.08, -2 ) and ( -2, -0.16 ). Because x = -2  is not in the domain of this function, it would be incorrect to say that this function is increasing on ( -0.16, infinity  ).

>   

Note

Using Maple's solve  command, the function is found to be increasing on

>    solve( df2 > 0., x );

RealRange(-infinity,Open(-4.079542449)), RealRange(Open(-.1555949369),Open(2.)), RealRange(Open(2.),infinity)
RealRange(-infinity,Open(-4.079542449)), RealRange(Open(-.1555949369),Open(2.)), RealRange(Open(2.),infinity)

>   

and decreasing on

>    solve( df2 < 0., x );

RealRange(Open(-4.079542449),Open(-2.)), RealRange(Open(-2.),Open(-.1555949369))

Note the use of the floating point zero, 0. , to force Maple to report floating-point results. If the integer zero, 0 , is used, Maple's output is rather imposing -- but exact! (Try it!)

To conclude, the graph of this function with the increasing intervals shown in red and the decreasing interval shown in blue confirms these results.

>    p1 := plot( f2, x=-16  ..-4.08, color=red,
            legend=["y = f(x): increasing"] ):
p2 := plot( f2, x=-4.08..-2,    color=blue,
            legend=["y = f(x): decreasing"] ):
p3 := plot( f2, x=-2   ..-0.16, color=blue,
            legend=["y = f(x): decreasing"] ):
p4 := plot( f2, x=-0.16.. 2,    color=red,
            legend=["y = f(x): increasing"] ):
p5 := plot( f2, x= 2   ..16,    color=red,
            legend=["y = f(x): increasing"] ):
p6 := plot( df2, x=-16 ..16,    color=green, discont=true,
            legend=["y = f '(x)"] ):
display( [p1,p2,p3,p4,p5,p6], view=[-16..16,-30..20] );

[Maple Plot]

Observe how the function changes from increasing to decreasing at the two stationary points. Note also that at x  = -2 the function is decreasing on either side but not decreasing on any interval containing points from both sides of the singularity. The same behavior can be seen at x  = 2 except that the function is increasing on both sides of this singularity.

>   

Example 3: f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27   

Find the intervals on which the function

>    f3 := x^5-7*x^4+10*x^3+18*x^2-27*x-27:
f(x) = f3;

f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27

is increasing and decreasing.

>   

Because all polynomials are continuous on the entire real line, this function -- and all of its derivatives -- are automatically continuous for all values of x .

The derivative is the fourth-degree polynomial

>    df3 := diff( f3, x ):
`f'`(x) = df3;

`f'`(x) = 5*x^4-28*x^3+30*x^2+36*x-27

The (four) roots of which are

>    stat3 := solve( df3 = 0, x ):
stat3;

-1, 3/5, 3, 3

Because the derivative is continuous, the Intermediate Value Theorem allows us to conclude that the derivative will have one sign on each of the following four intervals:

 ( -infinity , -1 ),   ( -1, 3/5  ),   ( 3/5 , 3 ),   and   ( 3, infinity  ).

To determine on which of these intervals the function is increasing and on which it is decreasing, simply evaluate the derivative at a convenient point in each subinterval.

>    testpts3 := [ -2, 0, 2, 4 ]:
TestIncrDecr( df3, testpts3 );

f'(-2.)=325.; the function is increasing on the subinterval containing -2.

f'(0.)=-27.; the function is decreasing on the subinterval containing 0.

f'(2.)=21.; the function is increasing on the subinterval containing 2.

f'(4.)=85.; the function is increasing on the subinterval containing 4.

Thus, the function f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27  is increasing on ( -infinity , -1 ), ( 3/5 , 3 ), ( 3, infinity  ) and decreasing on ( -1, 3/5  ). Because the function is defined at x = 3 , it would be correct to say the function is increasing on ( 3/5 , infinity  ). This point will be addressed again after the plot of the function and its derivative are obtained.

>   

Note

Using the solve  command, the function is found to be increasing on

>    solve( df3 > 0, x );

RealRange(-infinity,Open(-1)), RealRange(Open(3/5),Open(3)), RealRange(Open(3),infinity)

and decreasing on

>    solve( df3 < 0, x );

RealRange(Open(-1),Open(3/5))

To conclude, the graph of this function with the increasing intervals shown in red and the decreasing interval shown in blue confirms these results.

>    p1 := plot( f3, x=-2 ..-1,  color=red,
            legend=["y = f(x): increasing"] ):
p2 := plot( f3, x=-1 ..3/5, color=blue,
            legend=["y = f(x): decreasing"] ):
p3 := plot( f3, x=3/5..5,   color=red,
            legend=["y = f(x): increasing"] ):
p4 := plot( df3, x=-2..5, color=green,
            legend=["y = f'(x)"] ):
display( [p1,p2,p3,p4], view=[-2..5,-100..200] );

[Maple Plot]

Observe how the graph of the derivative does not change sign at the stationary point at x  = 3. This zero in the derivative forces the graph of the function to flatten out at this point -- but only at this one point. Technically, the function is still increasing at x  = 3 because all function values to the left of x  = 3 are negative and all function values to the right are positive.

>   

Definition: Concave Up and Down

Let f be a function defined on an interval I .

An inflection point  of  f  occurs at each point where f changes concavity.

Note

  • A linear function is neither concave up nor concave down.
  • Inflection points occur only at points in the domain of the function.

>   

Point 2: Second Derivative Determines Concavity

In the first part of this lesson we learned that a differentiable function, f, is increasing when its derivative is positive. Applied to the first derivative, we observe that f ' is increasing when (f ')' = f '' is positive.

>   

Theorem: Concave Up/Down Test

Suppose f is a function that is

  • continuous on an interval I  and
  • has two derivatives on I  (except possibly at the endpoints)

Then,

  • if `f ''`(x)  > 0 for all x  in I  (except possibly the endpoints), then f is concave up on I  
  • if `f ''`(x)  < 0 for all x  in I  (except possibly the endpoints), then f is concave down on I  

Notes:

  • A consequence of this theorem is that an inflection point is a point where the second derivative changes sign. This can be a point where `f ''`(x) = 0  or a point where `f ''`(x)  does not exist (but is in the domain of f).
  • Points where `f ''`(x) = 0  are called possible  inflection points. It is still necessary to check for the sign change in f '' at this point.
  • The hypotheses can be simplified to "Suppose f is a function that has a second derivative on an interval I ". If a function has a second derivative on an interval, then the first derivative and the function must both be continuous. The explicit listing of continuity in the statement of the theorem is a reminder to check this property prior to attempting to apply the theorem.

>   

Example 4:   f(x) = x^3-3*x^2-x   

Find the intervals on which the function

>    f4 := x^3-3*x^2-x:
f(x) = f4;

f(x) = x^3-3*x^2-x

is concave up and concave down; identify any inflection points.

>   

The approach is to use the singular points and possible inflection points (solutions to `f ''`(x) = 0 ) to divide the domain into intervals where the second derivative will be either positive or negative on the entire interval.

This is the same function as in Example 1. Once again, the fact that the function is a polynomial means there are no singulararities for this function, or any of its derivatives. The second derivative is

>    ddf4 := diff( f4, x,x ):
`f ''`(x) = ddf4;

`f ''`(x) = 6*x-6

and the possible inflection points are the solutions to `f ''`(x) = 0 :

>    possinfl4 := solve( ddf4 = 0, x ):
possinfl4;

1

This means the second derivative will have one sign on each of the following two intervals:

 ( -infinity , 1 )   and   ( 1, infinity  ).

To determine if the function concave up or concave down on an interval, simply evaluate the derivative at a convenient point in each subinterval. (The TestConcavity  command, defined at the top of this worksheet, evaluates the second derivative at each point and uses the sign of the result to report if the function is concave up or concave down (or a possible inflection point).)

>    testpts4 := [ 0, 2 ]:
TestConcavity( ddf4, testpts4 );

f''(0.)=-6.; the function is concave down on the subinterval containing 0.

f''(2.)=6.; the function is concave up on the subinterval containing 2.

Thus, the function f(x) = x^3-3*x^2-x  is concave up on ( 1, infinity  ) and concave down on ( -infinity , 1 ).

>   

Note

Using the solve  command, the function is found to be concave up on

>    solve( ddf4 > 0, x );

RealRange(Open(1),infinity)

and concave down on

>    solve( ddf4 < 0, x );

RealRange(-infinity,Open(1))

To conclude, the graph of this function with the concave up interval shown in pink and the decreasing interval shown in cyan confirms these results.

>    p1 := plot(   f4, x=-2..1, color=pink,
            legend=["y = f(x): concave up"] ):
p2 := plot(   f4, x= 1..4, color=cyan,
            legend=["y = f(x): concave down"] ):
p3 := plot( ddf4, x=-2..4, color=turquoise,
            legend=["y = f''(x)"] ):
display( [p1,p2,p3] );

[Maple Plot]

Observe how the graph of the second derivative changes sign precisely where the function changes concavity, at x  = 1.

>   

Maplets to Determine Intervals where a Function is Concave Up/Down

The three maplets useful for determining intervals where a function is increasing and decreasing are also appropriate to determine where a function is concave up and down.

CurveAnalysis  [ Maplet Viewer][ MapleNet]

The CurveAnalysis  maplet contains buttons for computing intervals where the function is concave up and where it is concave down. Likewise, the concavity information can be displayed in the plot. The usage is completely parallel to the usage of this maplet for increasing/decreasing analysis.

>   

FunctionAnalyzer   [ Maplet Viewer][ MapleNet]

The FunctionAnalyzer  maplet is similar. Use the Second Derivative panel to specify if the plot should include the second derivative and/or the sign chart for f ''. To specify the second derivative in an equation, use D2y . For example, to find the interval(s) where the function is concave down, enter D2y < 0  in the field labeled Enter equation to be solved (use y, Dy, D2y) .

>   

DerivativePlot   [ Maplet Viewer][ MapleNet]

The DerivativePlot  maplet requires no additional discussionn except to say that the second derivative will be included in the plot if 2  is in the orders  field.

>   

Example 5:   f(x) = (x^3-3*x^2-x)/(x^2-4)   

Find the intervals on which the function

>    f5 := (x^3-3*x^2-x)/(x^2-4):
f(x) = f5;

f(x) = (x^3-3*x^2-x)/(x^2-4)

is concave up and concave down; identify any inflection points.

>   

This is the same function as in Example 2. Recall that the domain of this function is all real numbers except x = 2  and x = -2 . The first two derivatives are

>    df5 := simplify( diff( f5, x ) ):
ddf5 := simplify( diff( f5, x,x ) ):
`f '`(x) = df5;
`f ''`(x) = ddf5;

`f '`(x) = (x^4-11*x^2+24*x+4)/(x^2-4)^2

`f ''`(x) = 6*(-12*x^2-16+x^3+12*x)/(x^2-4)^3

These functions are clearly defined and continuous on the domain of f, i.e., all real numbers x  except x = 2  and x = -2 . Because the function is discontinuous at these singularities, it is possible for the concavity to change at these points. These points will be endpoints for  intervals where the second derivative does not change sign.

>    sing5 := -2, 2:
sing5;

-2, 2

Of the three zeroes of the numerator, there is only one real-valued solution. This is the only possible inflection point.

>    q1 := solve( numer(ddf5) = 0, x ):
possinfl5 := op(remove( has, [q1], I )):
possinfl5 = evalf[4]( possinfl5 );

2*3^(2/3)+2*3^(1/3)+4 = 11.04

The second derivative can change sign at a point where the second derivative is zero (a possible inflection point) or where the function and/or its second derivative is not defined (a singular point). Thus, the real line is divided into the following four intervals on which the function does not change concavity:

 ( -infinity , -2 ),   ( -2, 2 ),   ( 2, 11.04 ),   ( 11.04, infinity  )

To determine on which of these intervals the function is increasing and on which it is decreasing, simply evaluate the derivative at a convenient point in each subinterval.

>    testpts5 := [ -3, 0, 3, 12 ]:
TestConcavity( ddf5, testpts5 );

f''(-3.)=-8.976; the function is concave down on the subinterval containing -3.

f''(0.)=1.500; the function is concave up on the subinterval containing 0.

f''(3.)=-2.928; the function is concave down on the subinterval containing 3.

f''(12.)=.2799e-3; the function is concave up on the subinterval containing 12.

Thus, the function f(x) = (x^3-3*x^2-x)/(x^2-4)  is concave up on ( -2, 2 ) and ( 11.04, infinity  ) and concave down on ( -infinity , -2 ) and ( 2, 11.04 ). Because an inflection point must, by definition, occur at a point in the domain of the function, this function has only one inflection point, at x = 11.04 .

>   

Note

Using the solve  command, the function is found to be concave up on

>    solve( ddf5 > 0, x );

RealRange(Open(-2),Open(2)), RealRange(Open(2*3^(2/3)+2*3^(1/3)+4),infinity)

and concave down on

>    solve( ddf5 < 0, x );

RealRange(-infinity,Open(-2)), RealRange(Open(2),Open(2*3^(2/3)+2*3^(1/3)+4))

To conclude, the graph of this function with the concave up intervals shown in pink and the concave down intervals shown in cyan confirms these results.

>    p1 := plot(   f5, x=-5   ..-2,    color=cyan,
            legend=["y = f(x): concave down"] ):
p2 := plot(   f5, x=-2   ..2,     color=pink,
            legend=["y = f(x): concave up"] ):
p3 := plot(   f5, x= 2   ..11.04, color=cyan,
            legend=["y = f(x): concave down"] ):
p4 := plot(   f5, x=11.04..16,    color=pink,
            legend=["y = f(x): concave up"] ):
p5 := plot( ddf5, x=-6   ..26,    color=turquoise,
            discont=true, legend=["y = f ''(x)"] ):
display( [p1,p2,p3,p4,p5], view=[-6..16,-30..30] );

[Maple Plot]

This plot is not as clear as might have been expected. On this scale, it is impossible to see that there actually is an inflection point. Let's take a closer look at the second derivative.

>    plot( ddf5, x=10..20 );

[Maple Plot]

Note the scale on the vertical axis. This restores confidence in our analysis!

>   

Example 6: f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27   

Find the intervals on which the function

>    f6 := x^5-7*x^4+10*x^3+18*x^2-27*x-27:
f(x) = f6;

f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27

is concave up and concave down; identify all inflection points.

>   

There are no singularities; only the possible inflection points need to be found. The second derivative is the third-degree polynomial

>    ddf6 := diff( f6, x,x ):
`f''`(x) = ddf6;

`f''`(x) = 20*x^3-84*x^2+60*x+36

The zeroes of which are

>    possinfl6 := solve( ddf6 = 0, x ):
possinfl6;
evalf[4](possinfl6);

3, 3/5+2/5*6^(1/2), 3/5-2/5*6^(1/2)

3., 1.580, -.3796

Because the derivative is continuous, the Intermediate Value Theorem allows us to conclude that the second derivative will have one sign on each of the following four intervals:

 ( -infinity , -0.38 ),   ( -0.38, 1.58 ),   ( 1.58, 3 ),   and   ( 3, infinity  ).

To determine on which of these intervals the function is concave up and on which it is concave down, simply evaluate the second derivative at a convenient point in each subinterval.

>    testpts6 := [ -1, 0, 2, 4 ]:
TestConcavity( ddf6, testpts6 );

f''(-1.)=-128.; the function is concave down on the subinterval containing -1.

f''(0.)=36.; the function is concave up on the subinterval containing 0.

f''(2.)=-20.; the function is concave down on the subinterval containing 2.

f''(4.)=212.; the function is concave up on the subinterval containing 4.

Thus, the function f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27  is concave up on ( -0.38, 1.58 ) and ( 3,   infinity  ) and concave down on ( -infinity , -0.38 ) and ( 1.58, 3 ). The three inflection points for this function: occur at x = -.38 , x = 1.58 , and x = 3 .

>   

Note

Using the solve  command, the function is found to be increasing on

>    solve( ddf6 > 0, x );

RealRange(Open(3/5-2/5*6^(1/2)),Open(3/5+2/5*6^(1/2))), RealRange(Open(3),infinity)

and decreasing on

>    solve( ddf6 < 0, x );

RealRange(-infinity,Open(3/5-2/5*6^(1/2))), RealRange(Open(3/5+2/5*6^(1/2)),Open(3))

To conclude, the graph of this function with the concave up intervals shown in pink and the concave down intervals shown in cyan confirms these results.

>    p1 := plot( f6, x=-2   ..-0.38, color=cyan, legend=["y = f(x): concave down"] ):
p2 := plot( f6, x=-0.38.. 1.58, color=pink, legend=["y = f(x): concave up"] ):
p3 := plot( f6, x= 1.58.. 3,    color=cyan, legend=["y = f(x): concave down"] ):
p4 := plot( f6, x= 3   .. 5,    color=pink, legend=["y = f(x): concave up"] ):
p5 := plot( ddf6, x=-3..5, color=turquoise, legend=["y = f ''(x)"] ):
display( [p1,p2,p3,p4,p5], view=[-2..5,-100..200] );

[Maple Plot]

The three inflection points are clearly visible in this plot. It should also be noted that the x  = 3 is both an inflection point and a stationary point.

>   

Definition: Local Max/Min

Let f be a function with domain I . A point c in I  is said to be

Notes

  • Observe how the local extrema are defined in terms of global extrema on an appropriate closed and bounded interval
  • If c is a local minimum of f, then f(c)  is the corresponding local miximum value  of  f.
  • If c is a local maximum of f, then f(c)  is the corresponding local maximum value  of  f.

>   

Point 3: Locating and Classifying Local Extrema

To conclude this lesson there are two tests for locating and classifying local extrema. For example, if a function with a continuous derivative has a local maximum at a point then the function must be increasing to the left and decreasing to the right of the local maximum. That is, at the critical point the first derivative is zero and changes sign from positive to negative. Moreover, since the first derivative changes from positive to negative, the first derivative is decreasing. This means the second derivative is negative and so the function is concave down. These observations combined with the analogous statements for a local minimum are summarized in the First and Second Derivative Tests.

Theorem: First Derivative Test

Suppose

  • f is a function that is differentiable on an interval I  and
  •   c  is a critical point of f in I .

Then,

  • if `f '`(x)  changes sign from negative to positive at x = c , then f has a local maximum at c  
  • if `f '`(x)  changes sign from positive to negative at x = c , then f has a local minimum at c  

Notes:

  • If c  is a critical point of f but the derivative does not change sign at c , then c  is neither a local maximum nor a local minimum.
  • Technically, the derivative does not need to exist at x = c , but it is essential that the function be continuous at c .
  • For example, if f has a corner or a cusp, then `f '`(c)  will not exist but the derivative is likely to exists on either side of x = c . The theorem does apply to this situation, assuming the first derivative changes sign at c .

>   

Theorem: Second Derivative Test

Suppose

  •  f is a function with a second derivative on an interval I  and
  •   c  is a point in I  with `f '`(c) = 0 .

Then,

  • if `f ''`(c)  < 0, then f has a local maximum at c  
  • if `f ''`(c)  > 0, then f has a local minimum at c  

Notes:

  • Points where `f ''`(c) = 0  are possible  inflection points. Recall that it is necessary to check for the sign change in f '' at this point.
  • The first hypothesis implies f is continuous on I (in particular, at c); this theorem does not apply at a discontinuity of f.
  • The second  hypothesis implies that the theorem applies only at points where f has a horizontal tangent. If x = c  is a singularity of f then the theorem does not apply.

>   

Example 7: f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27   

Find the intervals on which the function

>    f7 := x^5-7*x^4+10*x^3+18*x^2-27*x-27:
f(x) = f7;

f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27

is increasing, decreasing, concave up and concave down; identify all local extrema and all inflection points.

>   

This is the third time this function has appeared in this lesson. The analysis based on the first derivative was essentially completed in Example 3:

The first derivative is

>    df7 := diff( f7, x ):
`f '`(x) = df7;

`f '`(x) = 5*x^4-28*x^3+30*x^2+36*x-27

and the (four) stationary points are

>    stat7 := solve( df7 = 0, x ):
stat7;

-1, 3/5, 3, 3

The derivative will have one sign on each of the following four intervals:

 ( -infinity , -1 ),   ( -1, 3/5  ),   ( 3/5 , 3 ),   and   ( 3, infinity  ).

Testing the sign of the derivative at one point in each of these intervals yields:

>    testpts7a := [ -2, 0, 2, 4 ]:
TestIncrDecr( df7, testpts7a );

f'(-2.)=325.; the function is increasing on the subinterval containing -2.

f'(0.)=-27.; the function is decreasing on the subinterval containing 0.

f'(2.)=21.; the function is increasing on the subinterval containing 2.

f'(4.)=85.; the function is increasing on the subinterval containing 4.

Based on this information we concluded the function f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27  is increasing on ( -infinity , -1 ), ( 3/5 , infinity  ) and decreasing on ( -1, 3/5  ). Further, the First Derivative Test allows us to conclude the function has a local maximum at x  = -1 and a local minimum at x = 3/5 . The critical point at x  = 3 is neither a local maximum nor a local minimum because the first derivative is positive on both sides of x  = 3.

>   

The analysis based on the second derivative was started in Example 6:

The second derivative is the third-degree polynomial

>    ddf7 := diff( f7, x,x ):
`f ''`(x) = ddf7;

`f ''`(x) = 20*x^3-84*x^2+60*x+36

The zeroes of which are

>    possinfl7 := solve( ddf7 = 0, x ):
possinfl7;
evalf[7](possinfl7);

3, 3/5+2/5*6^(1/2), 3/5-2/5*6^(1/2)

3., 1.579796, -.3797960

The second derivative has one sign on each of the following four intervals:

 ( -infinity , -0.38 ),   ( -0.38, 1.58 ),   ( 1.58, 3 ),   and   ( 3, infinity  ).

Concavity is determined by evaluating the second derivative at a convenient point in each subinterval.

>    testpts7b := [ -1, 0, 2, 4 ]:
TestConcavity( ddf7, testpts7b );

f''(-1.)=-128.; the function is concave down on the subinterval containing -1.

f''(0.)=36.; the function is concave up on the subinterval containing 0.

f''(2.)=-20.; the function is concave down on the subinterval containing 2.

f''(4.)=212.; the function is concave up on the subinterval containing 4.

Thus, the function f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27  is concave up on ( -0.38, 1.58 ) and ( 3,   infinity  ) and concave down on ( -infinity , -0.38 ) and ( 1.58, 3 ). The three inflection points for this function occur at x  = 0.38, x = 1.58 , and x = 3 .

To use the Second Derivative Test to classify the critical points it suffices to determine the concavity at each stationary point.

>    TestConcavity( ddf7, {stat7} );

f''(3.)=0.; the function has a possible inflection point at x = 3.

f''(-1.)=-128.; the function is concave down on the subinterval containing -1.

f''(.6000)=46.08; the function is concave up on the subinterval containing .6000

Thus, this function has a local maximum at x  = -1, a local minimum at x = 3/5 , and x  = 3 is not a local extremum. These results are consistent with those found with the First Derivative Test.

>    FunctionChart( f7, -7/4..4,
               pointoptions=[symbolsize=20],
               slope=[thickness(2,2), color(red,blue)],
               concavity=[filled(pink,cyan)] );

[Maple Plot]

All zeroes of the function are identified with a circle, all stationary points are marked with diamonds, and inflection points with a cross; the curve is plotted in red on intervals where the function is increasing and in blue where the function is decreasing; the pink shaded regions are the regions under the curve when the function is concave up and the cyan regions are the regions under the curve when the function is concave down.

The appearance of a circle, diamond, and cross at x = 3  reinforces the earlier observation that this point is a stationary point and a critical point (not to mention a zero) for this function. Algebraically, this means (x-3)^3  must be a factor of this function; the fact that x = -1  is a zero and stationary point of the function means (x+1)^2  must be a factor of the polynomial. Because the original polynomial is fifth degrree, it must be the case that

  f(x) = (x-3)^3*(x+1)^2  

>    f(x) = f7;
`` = factor( f7 );

f(x) = x^5-7*x^4+10*x^3+18*x^2-27*x-27

`` = (x+1)^2*(x-3)^3

>   

Maplets for Local Analysis

The full power of the three maplets introduced earlier in the lesson can now be realized.

CurveAnalysis  [ Maplet Viewer][ MapleNet]

The CurveAnalysis  maplet can Show  or Plot  the function, local maxima and minima, intervals on which the function is increasing and decreasing, and intervals where the function is concave up and concave down.

>   

FunctionAnalyzer   [ Maplet Viewer][ MapleNet]

The FunctionAnalyzer  maplet is an excellent tool to help work through the local analysis of a function. Its interface allows the user to specify the relevant equations to be solved to determine stationary points, possible inflection points, intervals on which the function is increasing/decreasing/concave up/concave down, etc.. The plot window can display any combination of the function, its first two derivatives, and the sign charts for the first and second derivative.

Note that this maplet can be used if you need to perform some analysis on a function for which only the first (or second) derivative is known.

>   

DerivativePlot   [ Maplet Viewer][ MapleNet]

The DerivativePlot  maplet is much simpler; all it can do is display a plot of any combination of the function and its derivatives.

>   

Example 8:   f(x) = sin(x)+cos(2*x)   

Consider the trigonometric function from Example 8 in the GlobalAnalysis lesson.

>    f8 := sin(x)+cos(2*x):
f(x) = f8;

f(x) = sin(x)+cos(2*x)

Identify the subintervals of one period of this function on which this function is increasing, decreasing, concave up, and concave down. Also, find the local extrema and inflection points.

>   

The period of this function is 2*Pi . It suffices to complete the local analysis on [ -Pi , Pi  ]; the behavior of the function for the rest of the real line is obtained by shifting. This function, and all its derivatives, are continous; there are no singularities. The possible locations for inflection points are the zeroes of the second derivative:

>    df8 := collect(diff( f8, x ),[sin,cos]):
ddf8 := collect(diff( f8, x,x ),[sin,cos]):
`f '`(x) = df8;
`f ''`(x) = ddf8;

`f '`(x) = cos(x)-2*sin(2*x)

`f ''`(x) = -sin(x)-4*cos(2*x)

On the closed and bounded interval [ -Pi , Pi  ] the critical points consist of the stationary points

>    q1 := df8 = 0:
stat8 := solve( q1, x ):
stat8;

-1/2*Pi, 1/2*Pi, arctan(1/15*15^(1/2)), -arctan(1/15*15^(1/2))+Pi

and the endpoints of one period of the function

>    end8 := -Pi, Pi:
end8;

-Pi, Pi

>    crit8 := stat8, end8:
crit8;
evalf[4]( crit8 );

-1/2*Pi, 1/2*Pi, arctan(1/15*15^(1/2)), -arctan(1/15*15^(1/2))+Pi, -Pi, Pi

-1.571, 1.571, .2527, 2.889, -3.142, 3.142

The derivative has a constant sign on each of the following intervals:

 [ -3.142, -1.571 ),   ( -1.571, 0.253 ),   ( 0.253, 1.571 ),   ( 1.571, 2.889 ), ( 2;889, 3.142 ]  

>    testpts8a := [ -2, 0, 1, 2, 3 ]:
TestIncrDecr( df8, testpts8a );

f'(-2.)=-1.930; the function is decreasing on the subinterval containing -2.

f'(0.)=1.; the function is increasing on the subinterval containing 0.

f'(1.)=-1.279; the function is decreasing on the subinterval containing 1.

f'(2.)=1.098; the function is increasing on the subinterval containing 2.

f'(3.)=-.4312; the function is decreasing on the subinterval containing 3.

Thus, f is increasing on ( -1.571, 0.253 ), ( 1.571, 2.889 ) and decreasing on [ -3.142, -1.571 ), ( 0.253, 1.571 ), ( 2;889, 3.142 ]. Moreover, by the First Derivative Test, f has local maxima at x  = 0.253 and x  = 2.889 and local minima at x  = -1.571 and x  = 1.571 (and at all points obtained by adding an integer multiple of 2*Pi  to these positions).

>   

The possible inflection points in [ -Pi , Pi  ] are the zeroes of the second derivative:

>    q2 := ddf8 = 0:
possinfl8 := solve( q2, x ):
possinfl8;
evalf[4]( possinfl8 );

arctan(16*(1/16-1/16*129^(1/2))/(126+2*129^(1/2))^(1/2)), -arctan(16*(1/16-1/16*129^(1/2))/(126+2*129^(1/2))^(1/2))-Pi, arctan(16*(1/16+1/16*129^(1/2))/(126-2*129^(1/2))^(1/2)), -arctan(16*(1/16+1/16*1...
arctan(16*(1/16-1/16*129^(1/2))/(126+2*129^(1/2))^(1/2)), -arctan(16*(1/16-1/16*129^(1/2))/(126+2*129^(1/2))^(1/2))-Pi, arctan(16*(1/16+1/16*129^(1/2))/(126-2*129^(1/2))^(1/2)), -arctan(16*(1/16+1/16*1...

-.7044, -2.438, .8830, 2.259

The second derivative does not change sign on each of the intervals:

 [ -3.142, -2.438 ),   ( -2.438, -0.7044 ),   ( -0.7044, 0.8830 ),   ( 0.8830, 2.259 ),   ( 2.259, 3.142 ].

>    testpts8b := [ -3, -1, 0, 1, 3 ]:
TestConcavity( ddf8, testpts8b );

f''(-3.)=-3.700; the function is concave down on the subinterval containing -3.

f''(-1.)=2.506; the function is concave up on the subinterval containing -1.

f''(0.)=-4.; the function is concave down on the subinterval containing 0.

f''(1.)=.8225; the function is concave up on the subinterval containing 1.

f''(3.)=-3.982; the function is concave down on the subinterval containing 3.

Thus, f is concave up on ( -2.438, -0.7044 ) and ( 0.8830, 2.259 ) and concave down on [ -3.142, -2.438 ), ( -0.7044, 0.8830 ), and ( 2.259, 3.142 ]. The change in concavity at each possible inflection point means there are four inflection points in [ -Pi , Pi  ]: x  = -2.438, x  = -0.7044, x  = 0.8830, and x  = 2.259.

To classify the stationary points using the Second Derivative Test it is necessary to evaluate the second derivative at each stationary point:

>    TestConcavity( ddf8, [stat8] );

f''(-1.571)=5.000; the function is concave up on the subinterval containing -1.571

f''(1.571)=3.000; the function is concave up on the subinterval containing 1.571

f''(.2527)=-3.750; the function is concave down on the subinterval containing .2527

f''(2.889)=-3.750; the function is concave down on the subinterval containing 2.889

Because the second derivative is positive at x  = -1.571 and x  = 1.571, f has local minima at these points. Similarly, the function has local maxima at x  = 0.253 and x  = 2.889 because the second derivative is positive at these points. (Note that this is the same conclusion reached with the First Derivative Test.)

>   

Instead of piecing together plots as in earlier examples, the FunctionChart  command from the Student[Calculus1]  package will be used to create a single plot displaying the results of our local analysis.

>    FunctionChart( f8, -Pi..Pi,
               pointoptions=[symbolsize=20],
               slope=[thickness(2,2), color(red,blue)],
               concavity=[filled(pink,cyan)] );

[Maple Plot]

In this picture, all zeroes of the function are identified with a circle, all stationary points are marked with diamonds, and inflection points with a cross; the curve is plotted in red on intervals where the function is increasing and in blue where the function is decreasing; the pink shaded regions are the regions under the curve when the function is concave up and the cyan regions are the regions under the curve when the function is concave down. This picture confirms all of the results obtained directly analytically.

>   

Example 9:   f(x) = (x^3-3*x^2-x)/(x^2-4)  

Consider the function

>    f8 := (x^3-3*x^2-x)/(x^2-4):
f(x) = f8;

f(x) = (x^3-3*x^2-x)/(x^2-4)

Find all intervals where this function is increasing, decreasing, concave up, and concave down. In addition, identify all local and global extrema and inflection points.

>   

This function has been analyzed in Examples 2 and 5. The stationary points are the real-valued zeroes of the first derivative

>    df8 := simplify( diff( f8, x ) ):
`f '`(x) = df8:
q1 := solve( numer(df5)=0, x ):
stat8 := op(remove( has, evalf[4](allvalues([q1])), I )):
stat8;

-.157, -4.081

The function has two singularities

>    sing8 := -2, 2:
sing8;

-2, 2

Thus, the critical points are

>    crit8 := stat8, sing8:
crit8;

-.157, -4.081, -2, 2

The sign of the first derivative does not change on the intervals defined by these points:

 ( -infinity , -4.08 ),   ( -4.08, -2 ),   ( -2, -0.16 ),   ( -0.16, 2 ),   ( 2, infinity  )

Testing the sign of the first derivative at a convenient point in each of these intervals:

>    testpts8a := [ -5, -3, -1, 1, 3 ]:
TestIncrDecr( df8, testpts8a );

f'(-5.)=.5306; the function is increasing on the subinterval containing -5.

f'(-3.)=-3.440; the function is decreasing on the subinterval containing -3.

f'(-1.)=-3.333; the function is decreasing on the subinterval containing -1.

f'(1.)=2.000; the function is increasing on the subinterval containing 1.

f'(3.)=2.320; the function is increasing on the subinterval containing 3.

Thus, the function f(x) = (x^3-3*x^2-x)/(x^2-4)  is increasing on ( -infinity , -4.081 ), ( -0.157, 2 ), and ( 2, infinity  ) and decreasing on ( -4.081, -2 ) and ( -2, -0.157 ). The First Derivative Test classifies x  = -4.081 as a local maximum and x  = -0.157 as a local minimum. The First Derivative Test does not apply at the two singularities because the function is not continuous at these points. (In fact, the graph of the function has vertical asymptotes at x  = -2 and x  = 2.)

>   

For the analysis based on the second derivative:

>    ddf8 := simplify( diff( f8, x,x ) ):
`f ''`(x) = ddf8;

`f ''`(x) = 6*(-12*x^2-16+x^3+12*x)/(x^2-4)^3

The possible inflection points are the real-valued zeroes of the numerator:

>    q1 := solve( numer(ddf5) = 0, x ):
possinfl5 := op(remove( has, [q1], I )):
possinfl5;evalf[4]( possinfl5 );

2*3^(2/3)+2*3^(1/3)+4

11.04

This possible inflection point and the two singularities of the function define four intervals on which the second derivative cannot change sign:

 ( -infinity , -2 ),   ( -2, 2 ),   ( 2, 11.04 ),   ( 11.04, infinity  )

To determine the convexity on each interval, evaluate the second derivative at a convenient point in each subinterval:

>    testpts8 := [ -3, 0, 3, 12 ]:
TestConcavity( ddf8, testpts8 );

f''(-3.)=-8.976; the function is concave down on the subinterval containing -3.

f''(0.)=1.500; the function is concave up on the subinterval containing 0.

f''(3.)=-2.928; the function is concave down on the subinterval containing 3.

f''(12.)=.2799e-3; the function is concave up on the subinterval containing 12.

Thus, the function f(x) = (x^3-3*x^2-x)/(x^2-4)  is concave up on ( -2, 2 ) and ( 11.04, infinity  ) and concave down on ( -infinity , -2 ) and ( 2, 11.04 ). The only inflection point for this function occurs at x = 11.04 .

To classify the stationary points using the Second Derivative Test it is necessary to determine the concavity of the function at each stationary point:

>    TestConcavity( ddf8, [stat8] );

f''(-.157)=1.736; the function is concave up on the subinterval containing -.157

f''(-4.081)=-.9864; the function is concave down on the subinterval containing -4.081

Thus, x = -4.081  is a local maximum and x = -.157  is a local minimum for this function. (The Second Derivative Test tells us nothing about the singularities.)

This information is consistent with the plots created previously and here, using the FunctionChart  command.

>    FunctionChart( f8, -10..16, view=[DEFAULT,-20..20],
               pointoptions=[symbolsize=20],
               slope=[thickness(2,2), color(red,blue)],
               concavity=[filled(pink,cyan)] );

[Maple Plot]

>   

Example 10: f(x) = sqrt(abs(x^2-4*x+3))  

Let

>    f10 := sqrt( abs(x^2-4*x+3) ):
f(x) = f10;

f(x) = abs(x^2-4*x+3)^(1/2)

Find all intervals where this function is increasing, decreasing, concave up, and concave down. In addition, identify all local and global extrema and inflection points.

>   

This function was first encountered in Example 10 of the Global Analysis lesson. Recall that this function is defined for all real numbers. The first derivative is

>    df10 := simplify(diff( f10, x )):
`f'`(x) = convert(df10,piecewise,x);

`f'`(x) = PIECEWISE([(x-2)/(x^2-4*x+3)^(1/2), x < 1],[undefined, x = 1],[-(x-2)/(-3-x^2+4*x)^(1/2), x < 3],[undefined, x = 3],[(x-2)/(x^2-4*x+3)^(1/2), 3 < x])

There are two singularities

>    sing10 := 1,3:
sing10;

1, 3

and the sole stationary point is

>    q1 := df10 = 0:
stat10 := solve( q1, x ):
stat10;

2

The full set of critical points for this function is

>    crit10 := [ sing10, stat10 ]:
crit10;

[1, 3, 2]

The first derivative does not change sign on the intervals

 ( -infinity , 1 ),   ( 1, 2 ),   ( 2, 3 ),   and   ( 3, infinity  )

Evaluation of the first derivative at a single point in each interval shows:

>    testpts10a := [ 0, 3/2, 5/2, 4 ]:
TestIncrDecr( df10, testpts10a );

f'(0.)=-1.155; the function is decreasing on the subinterval containing 0.

f'(1.500)=.5775; the function is increasing on the subinterval containing 1.500

f'(2.500)=-.5775; the function is decreasing on the subinterval containing 2.500

f'(4.)=1.155; the function is increasing on the subinterval containing 4.

Thus, the function is increasing on ( 1, 2 ) and ( 3, infinity  ) and decreasing on ( -infinity , 1 ) and ( 2, 3 ). Further, the First Derivative Test can be applied at each critical point (yes, including the singular points) to conclude that the function has a local maximum at x  = 2 and local minima at x  = 1 and x  = 3.

>   

The second derivative is

>    ddf10 := simplify( diff( f10, x,x ) ):
`f ''`(x) = convert( ddf10, piecewise, x );

`f ''`(x) = PIECEWISE([-1/((x^2-4*x+3)^(3/2)), x < 1],[undefined, x = 1],[-1/((-3-x^2+4*x)^(3/2)), x < 3],[undefined, x = 3],[-1/((x^2-4*x+3)^(3/2)), 3 < x])

There are no possible inflection points

>    q2 := ddf10=0:
possinfl10 := solve( q2, x ):
possinfl10;

The representation of the second derivative shown above clearly indicates that the second derivative will be negative everywhere it is defined. If this is not seen, the singular points separate the real line into three subintervals on which the second derivative does not change sign:

 ( -infinity , 1 ),   ( 1, 3 ),   and   ( 3, infinity  )

>    testpts10b := [ 0, 2, 4 ]:
TestConcavity( ddf10, testpts10b );

f''(0.)=-.1925; the function is concave down on the subinterval containing 0.

f''(2.)=-1.; the function is concave down on the subinterval containing 2.

f''(4.)=-.1925; the function is concave down on the subinterval containing 4.

and the function is concave down for all real numbers except x  = 1 and x  = 3.

Because `f '`(2)  = 0 and `f ''`(2)  < 0, the Second Derivative Test implies x  = 2 is a local maximum. Note that the Second Derivative Test cannot be used to classify the singular points, x  = 1 and x  = 3.

These results are all summarized in the plot

>    FunctionChart( f10, -2..6,
               pointoptions=[symbolsize=20],
               slope=[thickness(2,2), color(red,blue)],
               concavity=[filled(pink,cyan)] );

[Maple Plot]

>   

Example 11: f(x) = sqrt(x^2-4*x+3)  

Define

>    f11 := sqrt( x^2-4*x+3 ):
f(x) = f11;

f(x) = (x^2-4*x+3)^(1/2)

Find all intervals where this function is increasing, decreasing, concave up, and concave down. In addition, identify all local and global extrema and inflection points.

>   

This function is similar to the one just studied in Example 10. The first impact of the removal of the absolute value is that the domain of the function is the union of the (closed) sets ( -infinity , 1 ] and [ 3, infinity  ).

The first derivative is

>    df11 := simplify(diff( f11, x )):
`f '`(x) = df11;

`f '`(x) = (x-2)/(x^2-4*x+3)^(1/2)

The lone zero of the first derivative is

>    q1 := solve( numer(df11) = 0, x ):
q1;

2

but note that this point is not in the domain of f. Thus, there are no stationary points:

>    stat11 := remove( InInterval, q1, [1,3] ):
stat11;

Because x  = 1 and x  = 3 are points in the domain of the function but where the first derivative is not defined, we have two singular points:

>    sing11 := 1, 3:
sing11;

1, 3

The complete set of critical points is

>    crit11 :=  [ stat11, sing11 ]:
crit11;

[1, 3]

Because there are no other stationary points, the first derivative will be not change sign on either of the intervals

 ( -infinity , 1 )   and   ( 3, infinity  )

When the first derivative is evaluated at a convenient point in each interval it is found that

>    testpts11a := [ -2, 4 ]:
TestIncrDecr( df11, testpts11a );

f'(-2.)=-1.033; the function is decreasing on the subinterval containing -2.

f'(4.)=1.155; the function is increasing on the subinterval containing 4.

The function is increasing on ( 3, infinity  ) and is decreasing on ( -infinity , 1 ). While the First Derivative Test is not applicable at the singular points (because the first derivative is not defined on both sides of the point), the definition of a local minimum and the fact that the function decreases for all x  < 1 are sufficient to allow us to conclude x  = 1 is a local minimum. Likewise, the observation that the function is increasing for all x  > 3 means x  = 3 is also a local minimum of the function.

>   

The second derivative is

>    ddf11 := simplify( diff( f11, x,x ) ):
`f ''`(x) = ddf11;

`f ''`(x) = -1/((x^2-4*x+3)^(3/2))

Thie second derivative is defined, and negative, for all x  < 1 or x  > 3. Thus, the function is concave down on its domain and has no inflection points. Because there are no stationary points, the Second Derivative Test is of no use for this function.

Thus, x  = -4.081 is a local maximum and x  = -0.157 is a local minimum for this function. (The Second Derivative Test tells us nothing about the singularities.)

This information is consistent with the plots created previously and here, using the FunctionChart  command.

>    FunctionChart( f11, -2..6,
               pointoptions=[symbolsize=20],
               slope=[thickness(2,2), color(red,blue)],
               concavity=[filled(pink,cyan)] );

[Maple Plot]

>   

Lesson Summary

The four main results developed in this lesson are

Theorem: Increasing/Decreasing Test

Let f be a function that is

  • continuous on an interval I  and
  • differentiable on I  (except possibly at the endpoints).

Then:

  • if `f'`(x)  > 0 for all x  in I  (except possibly at the endpoints), then f is increasing on I  
  • if `f'`(x)  < 0 for all x  in I  (except possibly at the endpoints), then f is decreasing on I  

Theorem: Concave Up/Down Test

Suppose f is a function that is

  • continuous on an interval I and
  • has two derivatives on I  (except possibly at the endpoints)

Then,

  • if `f ''`(x)  > 0 for all x  in I  (except possibly the endpoints), then f is concave up on I  
  • if `f ''`(x)  < 0 for all x  in I  (except possibly the endpoints), then f is concave down on I  

Theorem: First Derivative Test

Suppose

  • f is a function that is differentiable on an interval I  and
  •   c  is a critical point of f in I .

Then,

  • if `f '`(x)  changes sign from negative to positive at x = c , then f has a local maximum at c  
  • if `f '`(x)  changes sign from positive to negative at x = c , then f has a local minimum at c  

Notes:

  • If c  is a critical point of f but the derivative does not change sign at c , then c  is neither a local maximum nor a local minimum.
  • Technically, the derivative does not need to exist at x = c , but it is essential that the function be continuous at c .
  • For example, if f has a corner or a cusp, then `f '`(c)  will not exist but the derivative is likely to exists on either side of x = c . The theorem does apply to this situation, assuming the first derivative changes sign at c .

>   

Theorem: Second Derivative Test

Suppose

  •  f is a function with a second derivative on an interval I  and
  •   c  is a point in I  with `f '`(c) = 0 .

Then,

  • if `f ''`(c)  < 0, then f has a local maximum at c  
  • if `f ''`(c)  > 0, then f has a local minimum at c  

Notes:

  • Points where `f ''`(c) = 0  are possible  inflection points. Recall that it is necessary to check for the sign change in f '' at this point.
  • The first hypothesis implies f is continuous on I (in particular, at c); this theorem does not apply at a discontinuity of f.
  • The second  hypothesis implies that the theorem applies only at points where f has a horizontal tangent. If x = c  is a singularity of f then the theorem does not apply.

>   

>   

The eleven examples in this lesson illustrate some of the ways these results can be used, and what to do when they do not apply.

One topic that has not been explicitly discussed until now is how to decide how to choose between the First and Second Derivative Tests. The Second Derivative Test involves evaluating the second derivative at a point while the First Derivative Test requires knowledge about the sign of the derivative on both sides of the  point.  In general, the Second Derivative Test is easier to apply when the second derivative is not difficult to find and all critical points are stationary points.(Of course, the TestIncrDecr  command helps to make the First Derivative Test a little easier to apply.)

The CurveAnalysis  [ Maplet Viewer][ MapleNet], FunctionAnalyzer  [ Maplet Viewer][ MapleNet], and DerivativePlot  [ Maplet Viewer][ MapleNet] maplets can be useful for different parts of the analysis of a function. CurveAnalysis  produces the nicest graphs of the function with indications where the function is increasing/decreasing and concave up/down; it can also provide answers in term of intervals. The FunctionAnalyzer  maplet can be used more generally to find points or intervals satisfying general equations involving the function and its first two derivatives; graphically, its best feature is the ability to create sign charts for the first and second derivative. Use the DerivativePlot  maplet to construct a plot of a function and/or selected derivatives.  The FunctionChart  command, in the Student[Calculus1]  package, provides very nice plots of the function with indications for critical points, inflection points, increasing/decreasing intervals, and concave up/down intervals.

>   

What's Next?

As usual, there is an online homework assignment consisting of practice problems and a homework assignment; a textbook homework assignment is also provided. It is probably wisest to practice first on the textbook problems, move to the online practice problems, then complete the online homework set.

Quiz 5 contains questions pertaining to the Related Rates, Global Analysis and Local Analysis lessons. Complete this quiz before continuing with the next three lessons of the unit.

We now have all the tools needed to analyze almost any function. In the next lessons these techniques will be put to use solving Optimization Problems and Graphing functions.

>   

>   

>