Application Center - Maplesoft

App Preview:

Animation of a secant line converging to a tangent line

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

secant.mws

Secant Line Animation

2000 Joseph F. Conrad, Solano Community College, jconrad@solano.cc.ca.us

This worksheet uses Maple to animate secant lines connecting a given point on a curve to other points on the curve which approach the given point.

This animation illustrates the idea of secant lines "moving" toward a tangent line. It gives beginning calculus students a true picture of this fundamental concept. The user may define his/her own function f , and base point ( a , f ( a )) as well as the number of frames in the animation, n -- the more frames, the smoother the flow of the movie. The secant lines begin with the one connecting ( a , f ( a )) to ( a + h , f ( a + h )) and runs through the n lines determined by linearly reducing the value of h to h / n .

> restart:

We need to open the plots library.

> with(plots):

Warning, the name changecoords has been redefined

Now, define the function.

> f:=x->sin(x):

The values of a , h and n give the fixed x -value, the initial h -value and the number of frames in the animation. h can be any real number, positive or negative, but gives the best results if it's absolute value is relatively small.

> a:=1:

> h:=1:

> n:=20:

The following commands create the various components of the animation.

> Background:=display(pointplot({[a,f(a)],[a,0]},symbol=circle),plot(f(x),x=(a-(h+signum(h)*1))..(a+(h+signum(h)*1)))):

> Mover:=display(seq(pointplot({[a+(n-i)/(n/h),f(a+(n-i)/(n/h))],[a+(n-i)/(n/h),0]},symbol=circle,color=blue),i=0..n-1),insequence=true):

> Secants:=display(seq(plot((f(a+(n-i)/(n/h))-f(a))/(n-i)*(n/h)*(x-a)+f(a),x=(a-(h+signum(h)*1))..(a+(h+signum(h)*1)),color=blue),i=0..n-1),insequence=true):

> Slopes:=display(seq(textplot([a+.25,f(a)+.5,cat("slope = ",convert(evalf((f(a+(n-i)/(n/h))-f(a))/(n-i)*(n/h),5),string))],align=ABOVE,color=BLUE,font=[TIMES,ROMAN,18]),i=0..n-1),insequence=true):

> HValues:=display(seq(textplot([a+.25,f(a)+1,cat("h = ",convert(evalf((n-i)/(n/h),4),string))],color=BLUE,font=[TIMES,ROMAN,18]),i=0..n-1),insequence=true):

Now, we are ready to display the animation. Remember, to run the animation just select the plot and use the animation toolbar or the Animation menu.

> display(Secants,Slopes,Background,Mover,HValues);

[Maple Plot]

You may return to the definitons of f , a , h , and/or n and redo the worksheet. Gradually increasing the value of n gives the students another slant on the limiting process since the larger the n, the closer the final point is to ( a , f ( a )). This worksheet is also simple enough for the students to run on their own and discover some of the derivative rules by varying

the function f .

"While every effort has been made to validate the solutions in this worksheet, Waterloo Maple Inc. and the contributors are not responsible for any errors contained and are not liable for any damages resulting from the use of this material."