MeanValueTheorem.mws

Mean Value Theorem

>    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:

>   

Lesson Overview

The Mean Value Theorem (MVT) is one of the milestones in calculus. The geometric nature of the MVT makes it easy to believe and understand. Some of the more important uses of the MVT are not so geometric and require more effort to understand. In this lesson the MVT will be stated. In place of a proof, examples will be provided to show how the MVT can fail to hold if the hypotheses are not satisfied. Additional examples illustrate some of the results that are based on the MVT. The final example is the foundation for the discussions of Antiderivatives in the Unit 4.

The MeanValueTheorem  maplet [ Maplet Viewer][ MapleNet] provides a nice visualization tool for the basic geometry behind the MVT.

>   

The Mean Value Theorem (MVT)

Recall that the Intermediate Value Theorem (IVT) states that a continuous function on a closed and bounded interval attains every value between the values at the endpoints at at least one point in the interval. The Mean Value Theorem is similar to the Intermediate Value Theorem except that the MVT says that there is at least one point in the interior of the interval where the first derivative is equal to the slope of the secant line between the endpoints of the interval.

Theorem (Mean Value Theorem)

Let f be a continuous function on [ a , b  ] with continuous derivative on ( a , b  ). Then, there exists at least one number c  in ( a , b  ) for which

  `slope of secant line between ( a, f(a) ) and ( b, f(b) )` = `slope of tangent line at x=c`

That is,

  (f(b)-f(a))/(b-a) = `f '`(c) .

>   

A visual interpretation of the MVT can be obtained from the MeanValueTheorem  command in the Student[Calculus1]  package.

>    MeanValueTheorem(x^3 - x, x=-2..2, output = plot);

[Maple Plot]

In this example there are two points in the interval ( -2, 2 ) where the slope of the secant line from ( -2, -6 ) to ( 2, 6 ) is parallel to the slope of the tangent line to the graph of y = x^3-x . The secant line is shown as a dashed blue line and the two tangent lines are shown in black.

>   

Example 1: A Closer Look at the Hypotheses of the MVT

In lieu of a proof of the MVT, this collection of examples illustrates how the MVT can fail to exist when the hypotheses are not satisfied.

>   

Case 1: Hypotheses not satisfied: Function continuous but not differentiable

Consider the function

>    f1 := abs(x):
f(x) = f1;

f(x) = abs(x)

on the interval [ -2, 5 ]

>    a1 := -2:
b1 :=  5:

The secant line between ( -2, 2 ) and ( 5, 5 ) has slope

>    msec1 := (eval(f1,x=b1)-eval(f1,x=a1))/(b1-a1):
m[secant] = msec1;

m[secant] = 3/7

To see that there are no points in this interval where the tangent line to the graph of y = abs(x)  has slope m = 3/7 , consider the following plot of y = abs(x)  and several lines with slope m = 3/7 .

>    plot( [f1, [[-2,2],[5,5]], seq(msec1*x+c,c=-1..3)], x=a1..b1, color=[red,green,blue$5],
      title="Visual Proof that MVT does not apply to\nf(x)=abs(x) on [-2,5]" );

[Maple Plot]

>   

Algebraically, the derivative of the absolute value function is

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

`f '`(x) = PIECEWISE([-1, x < 0],[undefined, x = 0],[1, 0 < x])

Because the only values of this derivative are +1 and -1, there are no points where `f '`(c) = (f(b)-f(a))/(b-a)  = 3/7 .

This is not a contradiction to the MVT because the absolute value function is not differentiable at x = 0  and so is not differentiable on ( -2, 5 ).

>   

When Maple's MeanValueTheorem  encounters this problem, it responds with an appropriate error message

>    MeanValueTheorem( f1, a1..b1, output=plot );

Error, (in Student:-Calculus1:-MeanValueTheorem) the mean value theorem requires the function to be differentiable on the open interval (a, b)

>   

Case 2: Hypotheses not satisfied: Function not continuous

Consider the function

>    f2 := piecewise( x<1, x+1, x>=1, x-1 ):
f(x) = f2;

f(x) = PIECEWISE([x+1, x < 1],[x-1, 1 <= x])

on the interval [ 0, 2 ]

>    a2 := 0:
b2 := 2:

The secant line between ( 0, 1 ) and ( 2, 1 ) has slope

>    msec2 := (eval(f2,x=b2)-eval(f2,x=a2))/(b2-a2):
m[secant] = msec2;

m[secant] = 0

To see that there are no points in this interval where the tangent line to the graph of y = f(x)  has slope m = 0 , consider the following plot of y = f(x)  and several lines with slope m = 0 .

>    plot( [f2, seq(msec2*x+c/2,c=-2..6)], x=a2..b2, color=[red,blue$4,green,blue$4], discont=true,
      title="Visual Proof that MVT does not apply to\na function with a discontinuity at x=0 on [-2,5]" );

[Maple Plot]

>   

Algebraically, the derivative of this piecewise-defined function is

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

`f '`(x) = PIECEWISE([undefined, x = 1],[1, otherwise])

Because the only values of this derivative are +1, there are no points where `f '`(c) = (f(b)-f(a))/(b-a)  = 0.

This is not a contradiction to the MVT because this piecewise defined function  is not continuous at x = 1 .

>   

When Maple's MeanValueTheorem  encounters this problem, it responds with an appropriate error message

>    MeanValueTheorem( f2, a2..b2, output=plot );

Error, (in Student:-Calculus1:-MeanValueTheorem) the mean value theorem requires the function to be continuous on the closed interval [a, b]

>   

Case 3: Hypotheses satisfied

Consider the function

>    f3 := sin(x)^2:
f(x) = f3;

f(x) = sin(x)^2

on the interval [ 0, 3*Pi/2  ]

>    a3 := 0:
b3 := 3*Pi/2:

The secant line between ( 0, 0 ) and ( 3*Pi/2 , 1 ) has slope

>    msec3 := (eval(f3,x=b3)-eval(f3,x=a3))/(b3-a3):
m[secant] = msec3;

m[secant] = 2/3/Pi

To see that there is at least one point in this interval where the tangent line to the graph of y = f(x)  has slope m = 2/(3*Pi) , consider the following plot of y = f(x)  and several lines with slope m = 2/(3*Pi) .

>    plot( [f3, seq(msec3*x+c/8,c=-8..8)], x=a3..b3, color=[red,blue$8,green,blue$8], discont=true,
      title="Visual Proof that MVT does apply to\nf(x)=sin(x)^2 on [0,3*Pi/2]" );

[Maple Plot]

In this graph there appear to be (at least) two points where a tangent line has the same slope as the secant line. To find these points algebraically, the derivative is

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

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

The MVT guarantees there is at least one solution to the  equation

>    MVTeq := df3 = msec3;

MVTeq := 2*sin(x)*cos(x) = 2/3/Pi

While this transcendental equation is not easily solved by hand, Maple can do the necessary calculations:

>    q1 := solve( MVTeq, x ):
q1;

arctan((-1/12/Pi^2*6^(1/2)*(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(3/2)+1/2*6^(1/2)*(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(1/2))*6^(1/2)*Pi/(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(1/2)), -arctan((1/12/Pi^2*6^(1/2)*(3*Pi^2+(9...
arctan((-1/12/Pi^2*6^(1/2)*(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(3/2)+1/2*6^(1/2)*(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(1/2))*6^(1/2)*Pi/(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(1/2)), -arctan((1/12/Pi^2*6^(1/2)*(3*Pi^2+(9...
arctan((-1/12/Pi^2*6^(1/2)*(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(3/2)+1/2*6^(1/2)*(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(1/2))*6^(1/2)*Pi/(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(1/2)), -arctan((1/12/Pi^2*6^(1/2)*(3*Pi^2+(9...
arctan((-1/12/Pi^2*6^(1/2)*(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(3/2)+1/2*6^(1/2)*(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(1/2))*6^(1/2)*Pi/(3*Pi^2+(9*Pi^4-4*Pi^2)^(1/2))^(1/2)), -arctan((1/12/Pi^2*6^(1/2)*(3*Pi^2+(9...

These are the solutions in [ -Pi , Pi  ]; by periodicity, there are four more solutions in [ Pi , 3*Pi  ]. Numerical evaluation of all eight solutions in [ -Pi , 3*Pi  ] are

>    q2 := evalf([q1, seq(z+2*Pi,z=q1)]):
q2;

[.1069162122, -3.034676442, 1.463880114, -1.677712540, 6.390101520, 3.248508866, 7.747065422, 4.605472768]

and, the values that are in ( 0, 3*Pi/2  ) are

>    MVTc := select( InInterval, q2, [0,evalf(3*Pi/2)] ):
MVTc;

[.1069162122, 1.463880114, 3.248508866, 4.605472768]

Thus, there are four values of c  for `f '`(c) = (f(b)-f(a))/(b-a)  = 2/(3*Pi) .

>   

When Maple's MeanValueTheorem  encounters this problem, it can return either the graph

>    MeanValueTheorem( f3, a3..b3, output=plot );

[Maple Plot]

or the explicit values of c  guaranteed by the MVT

>    q3 := MeanValueTheorem( f3, a3..b3, output=points ):
q3;

[arctan(3/2*Pi-1/2*(9*Pi^2-4)^(1/2)), arctan(3/2*Pi+1/2*(9*Pi^2-4)^(1/2)), arctan(3/2*Pi-1/2*(9*Pi^2-4)^(1/2))+Pi, arctan(3/2*Pi+1/2*(9*Pi^2-4)^(1/2))+Pi]

>    evalf( q3 );

[.1069162124, 1.463880114, 3.248508866, 4.605472768]

>   

Example 2: Using the MeanValueTheorem  Maplet

To MeanValueTheorem  maplet [ Maplet Viewer][ MapleNet] is best suited to finding -- visually, symbolically, and numerically -- all points in an interval where the slope of the tangent line equals the slope of the secant line between the endpoints of the interval. To illustrate, let

>    f2 := x^2 * sqrt( 5-x ):
f(x) = f2;

f(x) = x^2*(5-x)^(1/2)

on the interval [ -5, 5 ]. First, note that the domain of this function is ( -infinity , 5 ]. Moreover, the function is continuous on the closed interval [ -5, 5 ]. The derivative,

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

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

is defined for x in ( -infinity , 5 ); so f is clearly differentiable on the open interval ( -5, 5 ). Thus, the hypotheses of the MVT are satisfied and there will be at least one number c  in ( -5, 5 ) for which

  `f '`(c) = (f(5)-f(-5))/(5-(-5))  =   (0-25*sqrt(10))/10 = -25/sqrt(10) .

The algebraic manipulations to solve this equation are rather tedious. In lieu of these calculations, launch the MeanValueTheorem  maplet [ Maplet Viewer][ MapleNet]. In the top row of the maplet, enter the Function  ( x^2*sqrt(5-x)  ) and endpoints of the interval ( a  = -5  and b  = 5  ). In the Display Options  panel, check the Show function  and Show secant  boxes, then click the Plot  button. Observe that the graph of the function has a vertical tangent line at x = 5 . More relevant to this problem is the observation that there are two locations on the graph of y = f(x)  where the tangent line is parallel to the secant line from ( -5, 25*sqrt(10)  ) to ( 5, 0 ). The maplet finds these points algebraically and symbolically. The algebraic form is rather complicated (you should convince yourself that these roots come from the solution of a fourth-order polynomial); numerically, the two locations are approximately c = -1.47  and c = 4.50 . To have these points identified on the graph, check the Show points  and Show tangent line  boxes in the Display Options  panel, then click the Plot  button. To terminate the maplet, click the Close  button.

>   

Example 3: The MVT and the Highway Patrol

A car travels 203 miles in 3 hours on a highway with speed limit 65mph. Assuming the velocity is continuous for these the entire trip, did the driver ever speed? Did the speed ever exceed the speed limit by at least 10mph?

Solution

Let s = s(t)  denote the distance traveled (in miles) as a function of time, t , measured in hours. The velocity is v  = ds/dt  = `s'`(t) . In terms of the hypotheses of the MVT, the continuity of the velocity means the position, s , is differentiable on ( 0, 3 ) and continuous on [ 0, 3 ]. The MVT guarantees the existence of at least one number c  in ( 0, 3 ) where

  `s'`(c) = (s(3)-s(0))/(3-0)  = (203-0)/(3-0)  = 67.67 mph.

That is, there was at least one time --- actually, by continuity of s , a time interval contained in ( 0, 3 ) --- when the speed exceeded the speed limit of 65 mph.

The MVT has nothing to say about the speed ever exceeding 75mph.

Note

 This system is used on toll roads to give speeding tickets at toll booths in some states.]

>   

Example 4: Geometric and Arithmetic Means

Use the MVT to show that

  sqrt(b)-sqrt(a)  < (b-a)/2/sqrt(a)  for all 0 < a  < b .

Then, show that

  sqrt(a*b)  < (a+b)/2  for all a , b  > 0.

>   

Solution

Let f(x) = sqrt(x)  for all x  >= 0. Let a  and b  be two positive numbers with b  > a . The function f is continuous on [ a , b  ] and differentiable on ( a , b  ). (Recall that `f '`(x) = 1/(2*sqrt(x))  for all x  > 0.) Therefore, the MVT guarantees there is at least one number c  in ( a , b  ) with the property

  `f '`(c) = (f(b)-f(a))/(b-a) .

That is,

  1/(2*sqrt(c)) = (sqrt(b)-sqrt(a))/(b-a) .

Now, sqrt(c)  > sqrt(a)  so that 1/(2*sqrt(c))  < 1/(2*sqrt(a)) . After multiplication by (the positive quantity) ( b-a  ),

  sqrt(b)-sqrt(a) = (b-a)/(2*sqrt(c))  < (b-a)/(2*sqrt(a)) .

This completes the proof of the first inequality.

>   

For the second part of this problem, multiply the first inequality by sqrt(a)  to obtain:

  sqrt(a)*(sqrt(b)-sqrt(a))  < (b-a)/2  

Distributing the multiplication over subtraction yields

  sqrt(a*b)-a  < (b-a)/2  

A little more algebra leaves only the radical on the left-hand side of the inequality

  sqrt(a*b)  < (b-a+2*a)/2  

  `` = (a+b)/2 .

The importance of this result is that the geometric mean  of two positive numbers, sqrt(a*b) , cannot be larger than the arithmetic mean  of the same two numbers, (a+b)/2 . The geometric and arithmetic means are equal only when a = b .

>   

Example 5: Existence of a Unique Root in an Interval

Show that x^3+7*x+4*sin(x)^3-3*sin(2*x) = 1  has exactly one real root.

>   

Solution

This problem will be addressed in two steps. First, the MVT will be used to show that there can be at most one solution. Then, the Intermediate Value Theorem will be used to show that there is at least one solution. Combined, these findings mean there is exactly one solution to this equation.

Define

>    f5 := x^3 + 7*x + 4*sin(x)^3 - 3*sin(2*x):
f(x) = f5;

f(x) = x^3+7*x+4*sin(x)^3-3*sin(2*x)

Suppose the equation f(x) = 1  has more than one solution. The goal is to show that this assumption leads to a contradictory conclusion. In this case, the contradition will be that there is a point between x[1]  and x[2]  where `f '`(x) = 0 .

Let x[1]  and x[2]  be two distinct (i.e., x[1] <> x[2] ) numbers with f(x[1]) = f(x[2])  = 1. Assume x[1]  < x[2] . Note that the function is continuous on [ x[1] , x[2]  ] and differentiable on ( x[1] , x[2]  ). (In fact, the function is continuous and differentiable for all real numbers.) This means the MVT can be applied. As a result, there must be a number c  between x[1]  and x[2]  where

  `f '`(c) = (f(x[2])-f(x[1]))/(x[2]-x[1])  = (1-1)/(x[2]-x[1])  = 0.

(Note that this conclusion could not be made if x[1]  and x[2]  were not assumed to be distinct.)

Now, lets look at the derivative:

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

`f '`(x) = 3*x^2+7+12*sin(x)^2*cos(x)-6*cos(2*x)

`` = 3*x^2+13-12*cos(x)^2+12*cos(x)-12*cos(x)^3

Manual manipulation of this expression continues by writing 13 as 1 + 12, then factoring the trigonometric terms:

    `f '`(x) = 3*x^2+13-12*cos(x)^2+12*cos(x)-12*cos(x)^3  

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

 = 3*x^2+1+12*(1+cos(x))*(1-cos(x)^2)  

 = 3*x^2+1+12*(1+cos(x))^2*(1-cos(x))  

For any value of x , 3*x^2 , ( 1+cos(x) ), and ( 1-cos(x) ) are all positive or zero. When combined as in the formula for the derivative, the addition of 1 is sufficient to conclude `f '`(x)  >= 1 for all x . In particular,

`f '`(x)  > 0 for all x  in [ x[1] , x[2]  ].

This is a direct contradiction of the result obtained by applying the MVT. Because a true statement cannot lead to two inconsistent results, the hypothesis must be false. There cannot be two distinct solutions. Thus, there is at most  one real-valued solution to x^3+7*x+4*sin(x)^3-3*sin(2*x) = 1 .

>   

For the second stage of the problem, the existence of at least  one solution will be confirmed. It is fairly clear that

>    f(0) = eval( f5, x=0 );

f(0) = 0

and

>    f(Pi) = eval( f5, x=Pi );

f(Pi) = Pi^3+7*Pi

Observe that

  f(0)  = 0 <1 < Pi^3+7*Pi = f(Pi)  

Then, because the function f is continuous on [ 0, Pi  ], the Intermediate Value Theorem implies that there must be at least one value of c  in ( 0, Pi  ) for which f(c) = 1 . When combined with the previous result, we have a complete proof that there is exactly one real-valued root of the equation

  x^3+7*x+4*sin(x)^3-3*sin(2*x) = 1 .

Moreover, the root occurs somewhere in the interval ( 0, Pi  ). A plot of the function, and the line y = 1 , confirms these results.

>    plot( [f5,1], x=-2..4 );

[Maple Plot]

From this graph it appears the real-value root is near x = .40 .

>    fsolve( f5=1, x );

.4102280836

>   

Example 6: Preview of Antiderivatives

Theorem

If Diff(f(x),x) = Diff(g(x),x)  for all x  in an interval, then f(x) = g(x)+C  on that interval.

>   

>   

The proof of this theorem involves the Mean Value Theorem. Instead of giving this proof, consider the following illustration of  this result.

>   

Consider the functions

>    f6a := sin(x)^2:
g6a := -cos(x)^2:
f(x) = f6a;
g(x) = g6a;

f(x) = sin(x)^2

g(x) = -cos(x)^2

The first derivatives of these functions are

>    df6a := diff( f6a, x ):
dg6a := diff( g6a, x ):
`f '`(x) = df6a;
`g '`(x) = dg6a;

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

`g '`(x) = 2*sin(x)*cos(x)

Because these derivatives are equal for all real numbers x ,  there must be a constant C  such that   f(x) = g(x)+C  for all real numbers x . The constant C  can be determined by selecting any value for x  where it is easy to evaluate f(x)  and g(x) . For example, with x = Pi/6 ,

  f(Pi/6) = sin(Pi/6)^2  = (1/2)^2 = 1/4  

g(Pi/6) = -cos(Pi/6)^2  = -(sqrt(3)/2)^2 = -3/4  

so that

  C = f(Pi/6)-g(Pi/6)  = 1/4-(-3/4)  = 1.

This is a calculus-based proof of the fundamental trigonometric identity

  sin(x)^2 = 1-cos(x)^2 .

A graphical display of this result is shown below.

>    plot( [f6a,g6a,f6a-g6a], x=-2*Pi..2*Pi, color=[blue,green,red], legend=["y=sin(x)^2", "y=-cos(x)^2", "C=sin(x)^2-cos(x)^2"] );

[Maple Plot]

>   

Lesson Summary

The Mean Value Theorem (MVT) makes sense intuitively. (If you do not agree with this statement, it is likely that you do not understand the geometry of the MVT. Please review this lesson and your textbook; get outside assistance if needed.) Example 1 illustrates why the function is required to be continuous on a closed interval and differentiable on the same interval, except possibly at the endpoints. Finding the location where the tangent line to the graph is parallel to the secant line connecting the endpoints of the graph on the given interval, as in Example 2, is best done with the aid of the MeanValueTheorem maplet [ Maplet Viewer][ MapleNet]. The more interesting applications of the MVT (Examples 3 - 5) use the MVT without finding the location of the points guaranteed by the MVT.

The final example, Example 6, provides a first look at antiderivatives. This will be discussed in greater detail in the Antiderivatives lesson in Unit 4.

>   

What's Next?

This concludes the unit on applications of derivatives. While there are many more applications of derivatives, the ones presented in this unit provide a foundation from which you should be able to understand most other applications.

As usual, there is a collection of online practice problems associated with this lesson. Complete these problems first, then complete the online homework assignment. Then, complete the textbook homework assignment.

As this concludes this unit, there is an online quiz. Quiz 6 contains questions pertaining to the Graphing, Optimzation, and Mean Value Theorem lessons.

To conclude, review the material in the Graphing and Optimization lessons (as well as this lesson) before taking the quiz on the second half of this unit.

>   

>   

>