DerivConcept.mws

Conceptual Introduction to Derivatives

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

Warning, the name changecoords has been redefined

>   

Auxiliary Plotting Commands

>    myTangent := proc( f, pt::name=numeric, domain::range(numeric) )
  local opt, Pf, Ppt, T, x, X, Y;
  if nargs>3 then opt := args[4..-1] else opt := NULL end if;
  x := lhs(pt);
  X := rhs(pt);
  Y := evalf(eval( f, x=X ));
  Pf := plot( f, x=domain ):
  Ppt := pointplot( [X,Y], color=blue ):
  T := sprintf("Graph of y=%a on [%6.3f,%6.3f]",
                f, op(domain) );
  return display( [Pf,Ppt], title=T, opt ):
end proc:

Lesson Overview

We now possess much knowledge about limits and many useful techniques for accurately evaluating limits. Why? How are limits of use?

In this unit we will see one of the main applications of limits -- derivatives. While the Precise Definition of the Derivative is the next lesson, in this lesson we will see two different situations that involve rates of change

>   

Derivative as Slope of Tangent Line

Given the graph of a function, y = f(x) , and a point on the graph, ( x , f(x)  ), it is usually fairly easy to visually identify the tangent line to the graph at the point.

Example 1 - Tangent Line by Zooming

Consider the graph of the function

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

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

at the point (1, 5 ).

>    x1 := 1:
y1 := eval( f1, x=x1 ):

The graph of the function on the interval [ -3, 2 ] and the point confirm that this point is on the graph.

>    h_list := [seq( 2^(3-i), i=1..10 )]:
P1 := [ seq( Tangent( f1, x=x1,
                          x1-h..x1+h/4, output=plot, showtangent=false,
                          title=sprintf("Graph of y=%a on [%6.3f,%6.3f]",
                                        f1, x1-h, x1+h/4),
                          view=[x1-h..x1+h/4,DEFAULT] ),
             h=h_list )]:
P1[1];

[Maple Plot]

Now, look at the graph of the function over shorter and shorter intervals around x = 1 , that is, zoom in on the point ( 1, 5 ) on the graph.

>    for i from 2 to nops(P1) do
  P1[i];
end do;

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

Notice that the graph of the function becomes straighter each time the viewing interval is cut in half. In the last few views the function appears to be a straight line. When this happens, the straight line that appears is the tangent line to the graph of the function at the point. This straightening of the graph of the function is even more apparent when tangent line is included in the plots.

>    P1t := [ seq( Tangent( f1, x=x1,
                           x1-h..x1+h/4, output=plot, showtangent=true,
                           title=sprintf("Graph of y=%a on [%6.3f,%6.3f]",
                                         f1, x1-h, x1+h/4),
                           view=[x1-h..x1+h/4,DEFAULT] ),
              h=h_list )]:
for i from 1 to nops(P1t) do
  P1t[i];
end do;

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

The derivative of a function at a point exists when the graph of the function has a tangent line at that point. The value of the derivative at this point is the slope of the tangent line.

In this case the equation of the tangent line to the graph of   f(x) = 3*x^3+9*x^2-7  at the point ( 1, 5 ) is

>    y = Tangent( f1, x=x1, output=line );

y = 27*x-22

so the slope of the tangent line is

>    m = Tangent( f1, x=x1, output=slope );

m = 27

>   

Note: Why the zooming wasn't done with display  

If the above sequence of plots is rendered with Maple's display  command, the viewing window is set once and does not change from frame to frame.

>    display( P1, insequence=true );

[Maple Plot]

While the smaller pieces of the plot that can be seen do appear to straighten out, this is harder to conclude and much less convincing.

>   

>   

Example 2 - Corners

Consider the graph of the function

>    f2 := sqrt(abs(x^2-4)+9):
f(x) = f2;

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

at the point ( 2, 3 ):

>    x2 := 2:
y2 := eval( f2, x=x2 ):

>   

The graph of the function on the interval [ -3, 7 ] and the point confirm that this point is on the graph.

>    myTangent( f2, x=x2, -3..7, view=[DEFAULT, 0..7] );

[Maple Plot]

Zooming in on the portion of the graph near ( 2, 3 ) leads to the plots

>    P2 := [ seq( myTangent( f2, x=x2, x2-h..x2+h ),
             h=h_list ) ]:
for i from 1 to nops(P2) do
  P2[i];
end do;

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

Notice that the graph of the function has a very pronounced corner that does not disappear as the viewing window becomes smaller and smaller. At no pont will the function appear to be a (single) straight line through the point ( 2, 3 ).

The fact that there is a corner in the graph of f(x)  at the point ( 2, 3 ) means there is no tangent line to this function at x = 2 ; this function is not differentiable at x = 2 . This conclusion is confirmed with the Tangent  command as follows:

>    Tangent( f2, x=x2 );

Error, (in Student:-Calculus1:-Tangent) the slope is not defied at the point `x` = 2

Example 3 - Jumps and Cusps

In addition to a corner, derivatives do not exist when the graph has a cusp or a jump at the point in question. Jumps are problematic because the tangent line does not have any jumps and so it is impossible to find a single straight line that approximates the graph of y = f(x)  on both sides of the point.

>    f3a := piecewise( x<1, 1, x>1, 2 ):
f(x) = f3a;

f(x) = PIECEWISE([1, x < 1],[2, 1 < x])

>    x3a := 1:

>    myTangent( f3a, x=1, -1..3 );

[Maple Plot]

>    P3a := [ seq( myTangent( f3a, x=x3a, x3a-h..x3a+h ),
              h=h_list ) ]:
for i from 1 to nops(P3a) do
  P3a[i];
end do;

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

An example with a cusp is.

>    f3b := abs(x)^(1/3):
`f`(x) = f3b;

f(x) = abs(x)^(1/3)

at the point ( 0, 0 ):

>    x3b := 0:
y3b := eval( f3b, x=x3b ):

>    myTangent( f3b, x=x3b, -3..7, view=[-3..7,0..2] );

[Maple Plot]

While there certainly appears to be a sharp point (cusp) at the origin, it is still prudent to zoom in on this point.

>    P3b := [ seq( myTangent( f3b, x=x3b, x3b-h..x3b+h ),
             h=h_list ) ]:
for i from 1 to nops(P3b) do
  P3b[i];
end do;

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

[Maple Plot]

>   

Corners, cusps, and jumps are the pictures you should have in mind when you think about a function that does not have a derivative.

Example 4 - Tangent Line as Limit of Secant Lines

Note that the zooming process is a limit as the viewing window size decreases to zero. An alternate way of looking at tangent lines is to define

  `tangent line to y=f(x) at (x[1],f(x[1]))` = limit(`secant line to y=f(x) through (x[1],f(x[1])) and (x[2],f(x[2])`,x[2] = x[1])

Consider the function

>    f := (x^3-5)*(x^2-1)/(x^2+1):
'f'(x) = f;

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

at the point with x = 2 :

>    x1 := 2;
y1 := eval( f, x=x1 );

x1 := 2

y1 := 9/5

The graph of the function and the point ( 2, 9/5  ) suggests that there should be a tangent line at this point.

>    myTangent( f, x=x1, -2..3 );

[Maple Plot]

We could find the tangent line by zooming. The equation of this tangent line is

>    y = Tangent( f, x=x1, output=line );

y = 204/25*x-363/25

Let's see if we can duplicate this result as the limit of secant lines. To begin, initalize the TangentandSecant  maplet [ Maplet Viewer][ MapleNet].

The graphic panel will display a graph of the function (in red), a sequence of 20 (blue) secant lines through ( 2, 9/5  ) and a second point starting at z = 4  and moving towards x = 2  in steps of -0.1. Clearly, the secant lines converge to the tangent line (in green) as the second point slides back towards x = 2 .

The convergence can be animated:

The slope of each secant line is listed in the Slopes of Secant Lines  panel. Observe that these values decrease from more than 25 down to 8.86. The maplet reports the slope of the tangent line to be 8.16. To obtain even better approximations to the slope of the tangent line, increase the n  parameter.

To conclude, note that the slope reported from the zooming process and the Tangent  command is 204/25 = 8.16 .

>   

The point of these examples is that the tangent line is the straight line that appears when we zoom in on the graph of the function at a single point. The same line can be obtained as the limit of secant lines.

When the graph of a function f has a tangent line at a point ( z , f(z)  ), the slope of that tangent line is the derivative of  f at   z . This derivative can be written in a number of ways, including:

  dy/dx  = `f'`(z)  = m[tan]  = limit(m[sec],h = 0)  = limit((f(c+h)-f(c))/h,h = 0)  

Derivative as Instantaneous Rate of Change

Suppose s = s(t)  records the position at time t  of an object moving in a straight line containing the origin. The average velocity over the time interval [t[1], t[2]]  is

  v[avg]  = Delta*s/(Delta*t)  = (s(t[2])-s(t[1]))/(t[2]-t[1])  .

Thus, the average velocity is simply the slope of the secant line to the graph of y = s(t)  through the points ( t[1] , s(t[1])  ) and ( t[2] , s(t[2])  ). If the average velocity has a limit as t[2]  approaches t[1] , then this limit is the slope of the tangent line to y = s(t)  at t = t[1] . This limit is also known as the instantaneous velocity  at time t = t[1] . That is,

  v(t[1])  = limit(v[avg],t[2] = t[1])  = limit(Delta*s/(Delta*t),h = 0)  = limit((s(t[2])-s(t[1]))/(t[2]-t[1]),t[2] = t[1])  .

An important consequence of this development is that velocity is the (instantaneous) rate of change of position. Similarly, acceleration is the instantaneous rate of change of velocity:

  v(t) = ds/dt    and    a(t) = dv/dt  = d^2*v/(dt^2)  .

Example 5 - An Oscillating Position

An object is traveling in a straight line through the origin in such a manner that its directed distance from the origin is given by

>    f5 := sin( (t^2+1)/200 ):
s(t) = f5;

s(t) = sin(1/200*t^2+1/200)

where t measures time in seconds. Positive and negative distances are on opposite sides of the origin. The graph of the object's motion for the first minute shows that the object passes through the origin 5 times while moving back and forth between two positions s = 1  and s = -1  .

>    plot( f5, t=0..60, title="Object's position during first minute" );

[Maple Plot]

The first time the object reaches position s=1 occurs between t = 10  and t = 20 . Maple finds this time with much more accuracy:

>    t1 := fsolve( f5=1, t ):
t[1] = t1;

t[1] = 17.69630655

>   

The velocity of the object when it passes through the origin is

  v(t[1]) = limit((s(t[2])-s(t[1]))/(t[2]-t[1]),t[2] = t[1])  .

This limit is the limit of the slopes of secant lines for s = sin((t^2+1)/200)  at t = t[1]  = 17.696 seconds. The TangentandSecant  maplet [ Maplet Viewer][ MapleNet] approximates this slope to be .9599512820e-5 = 0.0000096. The Tangent  command provides a nice graph of the position function and the tangent line at the first time the object reaches s=1.

>    Tangent( f5, t=t1, 0..30, output=plot );

[Maple Plot]

 Here the instantaneous velocity is estimated to be

>    v1 := Tangent( f5, t=t1, output=slope ):
v = v1;

v = -.2132587885e-9

Observe that both estimates for the slope of the tangent line are extremely small. Recalling that the time t[1]  is only an approximation, it seems likely that the actual slope at this point will be v = 0 . Upon further consideration this answer seems quite reasonable. Before t = t[1]  the position is positive and increasing so the object is moving to the right. After t = t[1]  the position is positive (at least for a while) and decreasing so the object is moving to the left. In particular, v(15) must be positive and v(20) must be negative. Assuming the velocity is continuous, the Intermediate Value Theorem tells us that there must be a time when the velocity is zero. Intuitively, this should be the time when the object reaches the turnaround point, s = 1 . To verify this calculation, observe that is is possible to explicitly find the time when the object first reaches s = 1 :

>    q1 := solve( f5=1, t ):

>    ispos := s -> evalf(s)>0:

>    t2 := op(select( ispos, [q1] )):
t[1] = t2;

t[1] = (-1+100*Pi)^(1/2)

The slope of the position function at this time is

>    Tangent( f5, t=t2, output=slope );

0

>   

Lesson Summary

In this lesson you have learned several different ways to think about derivatives:

It is also important to recognize that a function does not have a tangent line, and is hence not differentiable, at points where a corner, jump, or cusp occurs..

>   

What's Next?

To test your mastery of the concepts introduced in this section, complete the online homework assignment and the textbook homework assignment. If you wish to develop your skills before attempting the online homework, please utilize the online practice sessions for specific topics provided for this section.

This lesson for derivatives is analogous to the Conceptual Understanding of the Limit lesson in Unit 1. As was done for limits, the next step in our understanding of derivitives is to develop the Precise Definition of the Derivative.

>   

>   

>