Module 8 : Differential Calculus
802 : Definition Of The Derivative
O B J E C T I V E
In this project well develop the concept of the derivative, geometrically and algebraically. We'll look at secant lines drawn between two points on the graph of a function and how a family of secant lines through one fixed point lead to the definition of the tangent lines. Finally, we'll compute the the derivative using the definition of the derivative and the difference quotient.
S E T U P
In this project we will use the following command packages. Type and execute this line before beginning the project below. If you re-enter the worksheet for this project, be sure to re-execute this statement before jumping to any point in the worksheet.
> restart; with(plots):
Warning, the name changecoords has been redefined
___________________________________________________________________________________
A. Secant Lines
___________________________________________________________________________________
A secant line is any straight line that passes through two points on the graph of a function. In this section, our task will be to construct and graph a secant line using Maple. In the commands below, we will first define a function and x values a and b which will determine the points (a,f(a)) and (b,f(b)) through which we will later draw the secant.
> f := x -> 20 -10*cos(x) + (x^2)*sin(x);
> a := 1; b:=3;
Next, we compute the slope of the line through the points (a,f(a)) and (b,f(b)) using a familiar formula for the slope between two points and evaluate it as a decimal number.
This is the slope of the secant line!
> m := evalf( f(b) - f(a)) / (b-a);
Next we define the secant line as a function L(x) by solving for y in the point-slope form y - y1 = m(x-x1), and letting x1 = a, y1 = f(a), and m be the slope we just computed. Finally, we graph f(x) and the secant line.
> L := x-> f(a) + m*(x-a);
>
display( plot( {f(x), L(x)}, x=0..8, thickness=2),
plot({[[a.0].[a,f(a)]], [[b,0],[b,f(b)]] }, x=0..8, color=blue));
___________________________________________________________________________________
B. Tangent Lines
___________________________________________________________________________________
While a secant line passes through two distinct points on the graph of a function, a tangent line passes only through a single point of the graph. Although there are an infinite number of straight lines which pass through this single point, there is only one which is momentarily travelling in the same direction as f(x) at the point of impact. One of the main goals of calculus is to find the slope of tangent lines because they give us information about the direction of the curve at each point.
Here is an animation which shows the tangent line to different points on the graph of a function.
> f := x -> x^3 - 4*x^2 + 2*x + 2:
> T := (x,a) -> f(a) + (x - a) * D(f)(a) :
>
display(plot(f(x), x= -2..4, y= -4..8, thickness = 3, color = red),
animate(T(x,t), x=-2..4, t=-1.5..3.5, view = -4.. 8, color = blue));
When the plot is completed, click once anywhere on the graph so that a black border appears around it. You will then see several command buttons appear in the menu bar at top. Click on the recycle (circling arrows) button and then the play (triangle) buttons.
___________________________________________________________________________________
C. Families Of Secant Lines
___________________________________________________________________________________
One of the main goals of calculus is to find the slope of tangent lines. However, its impossible (without knowing the methods of calculus) to compute the slope of a tangent line knowing only the single point of tangency (because the slope formula m = (y2 - y1)/(x2 - x1) requires two points, and if you use the same point twice, both the numerator and denominator are 0.) On the other hand, its easy to compute the slope of secant lines. We'll use what's easy to find to get what is hard to find. Our approach is to estimate the slope of the tangent by computing the slope of secant lines which gradually approach the tangent line.
A diagram will demonstrate this idea. We're going to plot a family of secant lines simultaneously. All of the lines will pass through one fixed point (c,f(c)) where we want to examine the tangent line, and another point of the form(c+ 1/k, f(c+ 1/k)). These other points are approaching 2 closer and closer as k gets larger. Let's see how this looks.
> c := 2; left := c-1; right := c+1;
> f := x-> 20 - 10*cos(x) + (x^2)*sin(x);
> SL := (a,b) -> f(a) + ( (f(b)-f(a)) / (b-a) ) * (x-a);
>
display(plot(f(x), x= 0..8, y= -20..40, color = red, thickness = 3),
plot({SL(c, c + 1/k) $ k =1..8 }, x= 0..8, y = -20..40,color = gold), pointplot([c,f(c)]));
In this way, the family of secant lines through (c,f(c)) and (c+ 1/k, f(c+ 1/k)) get closer and closer to the tangent line. Consequently their slopes approach the slope of the tangent line.
Here is a close-up view of the same thing which will show what's happening a little better.
> display(pointplot([c,f(c)]), plot(f(x), x= left..right, y= 0..40, color =red, thickness = 3), plot({SL(c, c + 1/k) $ k = 1..8 }, x = left..right, y=0..40, color = gold));
As k gets large, the secant lines get closer and closer to being the tangent line at x = 2.
___________________________________________________________________________________
D. Definition of Derivative
___________________________________________________________________________________
Now we'll look at the slope of the tangent line and the derivative from an algebraic view.
> f := x-> x^3 + 1;
Our first task is to find the slope of the tangent for this function at x = 2. To do this, we will compute the slope of a secant line through (2,f(2)) and (2+h,f(2+h)), simplify this expression, take the limit as h approaches 0, and evaluate this result as a decimal number.
The slope of a secant line through (2,f(2)) & (2+h,f(2+h))
> (f(2+h) - f(2) )/h;
Simplify this expression
> simplify( % );
Take the limit as h approaches 0
> limit( %, h = 0);
Evaluate this result as a decimal number
> slope_of_tangent := evalf( %);
The last result was the slope of the tangent line at a particular point on the graph of f(x) - in particular at x = 2. If we follow the same steps, but leave x as an unknown, well get an expression for the slope of the tangent at any point (x,f(x)) on the graph. This expression is called the derivative of f(x) because it is a function in its own right, which is derived from the original function.
The slope of a secant line through (2,f(2)) & (2+h, f(2+h))
> (f(x + h) - f(x) )/ h;
Siimplify this expression
> simplify( %);
Take the limit as h approaches 0 (No need to evaluate an algebraic expression as a decimal.)
> limit( %, h=0);
>