{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 262 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times " 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 4 1 0 1 0 2 2 0 1 } {PSTYLE "R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Courier" 1 10 255 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "R3 Font 2 " -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 8 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "" 0 258 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 258 "" 0 "" {TEXT 262 58 "Calculus Exploration 3: Tangen ts as Limits of Secant Lines" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 263 261 "The first section below conta ins the Maple code that you must compile first, in order to run the Se cant Line Movie in the second section. In the third section, you can c reate the individual still frames of the movie, so that you can examin e each one separately." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 30 "Compile Secant Line Movie Code" }}{PARA 0 "" 0 "" {TEXT 256 110 "Click in red area and press [Enter] to compil e code.\nNext, close this section and proceed to the next section." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9737 "restart:\nwith(plottools): \nSecantLineMovie:=proc(expr,time,frame)\nlocal m,i,xleft,xright,yint_ xleft_str,yint_xright_str,\nelapsed_time,time_text,elapsed_time_str,di st_trav,dist_trav_str,\nvelocity,velocity_str,tsf_str,rp,endcolor,endl inestyle,h,h_approx,\nh_txt,h_txt_digit,h_txt_t,t1,t2,y1,y2,sec_xright ,tsf_xright_str,\nf,IN,tif,tsf,maincolor,movie_frame,reversemovie_fram e,SecantLine:\nf:=unapply(expr,x);\nIN:=unapply(unapply(normal(f(x)-D( f)(x)*x),x),f):\ntif:=unapply(IN(f)(t),t):\ntsf:=unapply(D(f)(t),t):\n Digits:=6:\nm:=21:\nfor i from 1 to m do\nxright:=time:\ntime_text:=co nvert(time,string):\nif xright >= 2 then\nsec_xright:=xright + .2:\nel if 1 <= xright and xright < 2 then\nsec_xright:=2:\nelif 0 <= xright a nd xright < 1 then\nsec_xright:=1.4:\nelif -1 <= xright and xright < 0 then\nsec_xright:=0:\nelif -2 <= xright and xright < -1 then \nsec_xr ight:=-.6:\nelif xright < -2 then \nsec_xright:=xright + .2:\nfi:\nh:= (sec_xright-xright)*(1.2)^(-i+1):\nh_approx:=evalf(trunc(100*h)/100,2) :\nif h_approx >= .1 then\nh_txt:=convert(h_approx,string):\nelse\nh_t xt_digit:=trunc(100*h_approx):\nh_txt:=`.0`||h_txt_digit:\nfi:\nt1:=ev alf(xright):\nt2:=evalf(xright+h):\ny1:=evalf(f(xright)):\ny2:=evalf(f (xright+h)):\nyint_xright_str:=convert(evalf(IN(f)(xright),3),string): \ntsf_xright_str:=convert(evalf(D(f)(xright),3),string):\nmaincolor:=n avy:\nendcolor:=red:\nrp[1]:=plot(f(t),t=-3..3.4,y=-3...7,\n#rp[1]:=pl ot(f(t),t=-2..2,y=-8...8,\n labels=[``,``],\n co lor=blue,linestyle=1):\nrp[2]:=plot([[t1,y1],[t2,y1]],linestyle=1,colo r=maincolor):\nrp[3]:=plot([[t2,y1],[t2,y2]],linestyle=1,color=maincol or):\nrp[4]:=plot([[t1,y1],[t2,y2]],linestyle=1,color=maincolor):\nrp[ 5]:=plot(((y2-y1)/(t2-t1))*t+f(t1)-((y2-y1)/(t2-t1))*t1,\n \+ t=t1..5,y=f(t1)...5,color=maincolor):\nif h_approx >= 0.3 then\nh_ txt_t:=(t1+t2)/2:\nelse\nh_txt_t:=t2+0.25:\nfi:\nrp[6]:=plots[textplot ]([h_txt_t,0.3,h_txt],\n font=[HELVETICA,DEFAUL T,10],\n color=maincolor,align=\{ABOVE,CENTER\} ):\nrp[7]:=plots[textplot]([t2+0.05,(y1+y2)/2,\n \+ `f(x + `||h_txt||`) - f(x)`],\n font=[HELVETI CA,DEFAULT,10],\n color=maincolor,align=\{RIGHT \}): \nrp[8]:=plots[textplot]([0,0,``]):\n\n# end movie_frame[i] for \+ i < m\nrp[9]:=plot([[xright,f(xright)],[xright,IN(f)(xright)]],\n \+ linestyle=1,color=red):\n#rp[10]:=plot([[xright,IN(f)(xright)] ,[0,IN(f)(xright)]],\n# linestyle=1,color=red):\nrp[10]:=p lot([[0,IN(f)(xright)],[-f(xright),xright]],\n linestyle= 1,color=red):\nrp[11]:=plot([[0,IN(f)(xright)],[xright,f(xright)]],\n \+ linestyle=1,color=red):\n# movie_frame[i] for i < m\n#rp[ 12]:=plots[textplot]([1.15,6.8,`3`],\nrp[12]:=plots[textplot]([1.15,6. 8,``],\n font=[HELVETICA,DEFAULT,10],\n \+ color=maincolor,align=\{BELOW,RIGHT\}): \+ \n#rp[13]:=plots[textplot]([0.1,6.5,`y = f(x) = -x + 3x + 2`], \nrp[13]:=plots[textplot]([0.1,6.5,``],\n font= [HELVETICA,DEFAULT,12],\n color=maincolor,align =\{RIGHT\}): \nif i < m then\nrp[14]:=plots[textplot]([0.1,5.5,`secant f(x + `||h_txt||`) - f(x)`],\n font=[HELVE TICA,DEFAULT,12],\n color=maincolor,align=\{RIG HT\}): \nrp[15]:=plots[textplot]([0.2,5.3,`slope`],\n \+ font=[HELVETICA,DEFAULT,12],\n color=mai ncolor,align=\{BELOW,RIGHT\}):\nrp[16]:=plots[textplot]([0.8,5.35,`=`] ,\n font=[HELVETICA,DEFAULT,12],\n \+ color=maincolor,align=\{BELOW,RIGHT\}):\n\nrp[17]:=plot([[1 .05,5.2],[2.3,5.2]],linestyle=1,color=maincolor):\nrp[18]:=plots[textp lot]([1.7,5.1,h_txt],\n font=[HELVETICA,DEFAULT ,12],\n color=maincolor,align=\{BELOW,CENTER\}) : \nelif i = m and 0 <= xright then\nrp[14]:=plots[textplot]([0,0,``]) :\nrp[15]:=plots[textplot]([0.2,5.35,`slope`],\n \+ font=[HELVETICA,DEFAULT,12],\n color=endcolor ,align=\{BELOW,RIGHT\}):\nrp[16]:=plots[textplot]([0.8,5.35,`=`],\n \+ font=[HELVETICA,DEFAULT,12], \+ \+ color=endcolor,align=\{BELOW,RIGHT\}):\nrp[17]:=plots[textplot]([ 0,0,``]):\nrp[18]:=plots[textplot]([1.05,5.35,tsf_xright_str],\n \+ font=[HELVETICA,DEFAULT,12],\n \+ color=endcolor,align=\{BELOW,RIGHT\}): \nelif i = m and xright < 0 t hen\nrp[14]:=plots[textplot]([0,0,``]):\nrp[15]:=plots[textplot]([-1.6 ,5.35,`slope`],\n font=[HELVETICA,DEFAULT,12], \n color=endcolor,align=\{BELOW,RIGHT\}):\nrp[1 6]:=plots[textplot]([-1.0,5.35,`=`],\n font=[HE LVETICA,DEFAULT,12], \+ \+ \+ color=endcolor,align=\{BELOW,RIGHT\}):\nrp[17]:=plots[textplot]([0,0 ,``]):\nrp[18]:=plots[textplot]([-0.8,5.35,tsf_xright_str],\n \+ font=[HELVETICA,DEFAULT,12],\n c olor=endcolor,align=\{BELOW,RIGHT\}): \nfi:\nif i = 1 and 0 <= xright \+ then\nrp[19]:=plots[textplot]([1.0,-1.0,\n `Beg in x = `||time_text],\n font=[HELVETICA,DEFAUL T,12],\n color=blue,align=\{CENTER\}):\nelif i \+ = 1 and xright < 0 then \nrp[19]:=plots[textplot]([-1.0,-1.0,\n \+ `Begin x = `||time_text],\n f ont=[HELVETICA,DEFAULT,12],\n color=blue,align= \{CENTER\}):\nelif 1 < i and 0 <= xright then\nrp[19]:=plots[textplot] ([1.0,-1.0,\n `x = `||time_text],\n \+ font=[HELVETICA,DEFAULT,12],\n colo r=blue,align=\{CENTER\}):\nelif 1 < i and xright < 0 then\nrp[19]:=plo ts[textplot]([-1.0,-1.0,\n `x = `||time_text], \n font=[HELVETICA,DEFAULT,12],\n \+ color=blue,align=\{CENTER\}):\nfi:\n# end movie_frame[i] for i < m\nrp[20]:=plot(tsf(t1)*t+tif(t1),t=-4..4,color=red):\n# movie_fr ame[i] for i < m\nif xright = -1 and i = m then\n#rp[21]:=plot(tsf(t1+ .1)*t+tif(t1+.1),t=-4..4,thickness=3,color=red):\nrp[21]:=plot([[-3.5, .01],[3.6,.01]],thickness=2,color=red):\nelse\nrp[21]:=plots[textplot] ([0,0,``]):\nfi:\nrp[22]:=plot([[0,f(xright)],[xright,f(xright)]], \+ color=blue,linestyle=3);\nrp[23]:=plot([[x right,0],[xright,f(xright)]], color=blu e,linestyle=3);\nrp[24]:=plot([[0,y2],[t2,y2]],linestyle=3,color=mainc olor):\nrp[25]:=plot([[t2,0],[t2,y1]],linestyle=3,color=maincolor):\n# end movie_frame[i] for i < m\nif t1 <= 0 and tsf(t1) <= 0 then\n rp[2 6]:=plots[textplot]([t1,f(t1)-2.0,`tangent`],\n \+ font=[HELVETICA,DEFAULT,12],\n color=endcolo r,align=\{BELOW,LEFT\}):\nelif t1 <= 0 and tsf(t1) > 0 then\n rp[26]:= plots[textplot]([t1,f(t1)+2.0,`tangent`],\n fo nt=[HELVETICA,DEFAULT,12],\n color=endcolor,al ign=\{ABOVE,LEFT\}):\nelif t1 > 0 and tsf(t1) <= 0 then\n rp[26]:=plot s[textplot]([t1,f(t1)+2.0,`tangent`],\n font=[ HELVETICA,DEFAULT,12],\n color=endcolor,align= \{ABOVE,RIGHT\}):\nelif t1 > 0 and tsf(t1) > 0 then\n rp[26]:=plots[te xtplot]([t1,f(t1)+2.0,`tangent`],\n font=[HELV ETICA,DEFAULT,12],\n color=endcolor,align=\{AB OVE,CENTER\}):\nfi:\nrp[27]:=plots[textplot]([t2+0.05,tif(t2)+(f(t2)-t if(t2))/2,\n `tangent triangle`],\n \+ font=[HELVETICA,DEFAULT,12],\n c olor=endcolor,align=\{BELOW,RIGHT\}): \nif i =1 then\nmovie _frame[i]:=plots[display](\n [seq(rp[j],j=1..8),\n \+ seq(rp[j],j=12..19),\n seq(rp[j],j=21.. 25)]):\nelif 1 < i and i < m then\nmovie_frame[i]:=plots[display](\n \+ [seq(rp[j],j=1..7),\n seq(rp[j],j=12.. 19),\n seq(rp[j],j=21..25)]):\nelse\nmovie_frame[i]:= plots[display](\n [seq(rp[j],j=1..1),\n \+ seq(rp[j],j=12..23)\n\n # seq(rp[j],j=19..23),\n \+ # seq(rp[j],j=20..23),\n # seq(rp[j],j=2 6..26)\n]):\nfi:\n#reversemovie_frame[m-(i-1)]:=plots[display]([seq(rp [j],j=0..8)]): \nod:\nif frame = 0 then\n# Create Maple movie.\nSecan tLine[frame]:=\n plots[display]([movie_frame[1],movie_frame[1],movie_f rame[1],\n seq(movie_frame[j],j=1..m), \+ \+ \+ \+ movie_frame [m],movie_frame[m],movie_frame[m]],\n #seq(reversemovi e_frame[j],j=1..m),\n insequence = true,\n \+ #scaling=constrained,\n #labels=[``,``],\n \+ xtickmarks=5,ytickmarks=4,\n view=[-3..3.4,- 3..7],\n titlefont=[HELVETICA,DEFAULT,14],\n \+ title=`Slope of Tangent to Curve`):\nelse\n# Create individual \+ frames to export to *.gifs for Java movie.\nSecantLine[frame]:=\n plot s[display]([movie_frame[frame]],\n #scaling=constraine d,\n #labels=[``,``],\n xtickmarks=4,y tickmarks=4,\n view=[-3..3.4,-3..7],\n \+ titlefont=[HELVETICA,DEFAULT,14],\n title=`Slope of T angent to Curve`):\nfi:\nSecantLine[frame]\nend:" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 21 "Run Secant Line Movie" }}{PARA 0 "" 0 "" {TEXT 258 54 "Enter the defining expression for the function f, and " } {TEXT -1 1 "\n" }{TEXT 259 54 "the x_val at which you want to compute \+ the slope of f." }{TEXT -1 1 " " }}{EXCHG {PARA 0 "" 0 "" {TEXT 257 0 "" }{MPLTEXT 1 0 65 "f:=x->x^2: \nx_val:=1:\n'f'(x)=f(x);\nSecantLineM ovie(f(x),x_val,0);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} }{SECT 1 {PARA 3 "" 0 "" {TEXT -1 31 "Create Secant Line Movie Frames " }}{PARA 0 "" 0 "" {TEXT 260 54 "Enter the defining expression for th e function f, and " }{TEXT -1 1 "\n" }{TEXT 261 54 "the x_val at which you want to compute the slope of f." }{TEXT -1 1 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 92 "f:=x->x^2: \nx_val:=1:\nfor j from 1 to 2 1 do\n'f'(x)=f(x);\nSecantLineMovie(f(x),x_val,j):\nod;\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 37 "_____________________________________" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 27 "Filenam e: ExploreCalc03.mws" }}{PARA 0 "" 0 "" {TEXT -1 36 "Copyright 2005, A ll Rights Reserved." }}{PARA 0 "" 0 "" {TEXT -1 44 "Permission is gran ted to use and modify for " }}{PARA 0 "" 0 "" {TEXT -1 37 "academic an d non-commercial purposes." }}{PARA 0 "" 0 "" {TEXT -1 13 "Dr. John Pa is" }}{PARA 0 "" 0 "" {TEXT -1 28 "Mathematics Department-MICDS" }} {PARA 0 "" 0 "" {TEXT -1 45 "E-mail: pais@micds.org or pais@kinetigram .com" }}{PARA 0 "" 0 "" {TEXT -1 33 "URL: http://kinetigram.com/micds " }}{PARA 0 "" 0 "" {TEXT -1 37 "_____________________________________ " }}}{MARK "14 0" 13 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }