{VERSION 4 0 "IBM INTEL NT" "4.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 "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{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 "Title" -1 18 1 {CSTYLE "" -1 -1 "Tim es" 1 18 0 0 0 1 2 1 1 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 } } {SECT 0 {PARA 18 "" 0 "" {TEXT -1 58 "The Relationship Between the Sec ant \nand the Tangent Lines" }}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 14 "In itialization" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "restart:\nwi th(plots):\nwith(plottools):" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 30 "Motivation by a simple example" }}{PARA 0 "" 0 "" {TEXT -1 36 "Consid er a simple quadratic function" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "f := x -> x^2;" }}}{PARA 0 "" 0 "" {TEXT -1 24 "with the followi ng graph" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "plot(f(x),x=-2.. 2);" }}}{PARA 0 "" 0 "" {TEXT -1 33 "The derivative is easy to compute " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "diff(f(x),x);" }{TEXT -1 0 "" }}}{PARA 0 "" 0 "" {TEXT -1 39 "and at the point x=1, we find \+ the slope" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "subs(x=1,%);" } }}{PARA 0 "" 0 "" {TEXT -1 35 "and compute the tangent line at x=1" }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "T := x -> f(1) + 2*(x-1);" } }}{PARA 0 "" 0 "" {TEXT -1 23 "We can plot the tangent" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "plot(T(x),x=-2..2);" }}}{PARA 0 "" 0 "" {TEXT -1 44 "and plot both functions on the same graph..." }} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "plot(\{f(x),T(x)\},x=-2..2); " }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 26 "Now a more general example " }}{PARA 0 "" 0 "" {TEXT -1 73 "Define f(x) to be any function you wa nt (as long as it has a derivative!)" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "f := x -> sin(x);" }}}{PARA 0 "" 0 "" {TEXT -1 26 "Le t a be point of tangency" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "a := 1.0;" }}}{PARA 0 "" 0 "" {TEXT -1 42 "Find the derivative of f(x), call it Df(x)" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "Df := unap ply( diff(f(x),x) , x );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "m := evalf(Df(a));" }}}{PARA 0 "" 0 "" {TEXT -1 51 "Find the equation of the tangent line at the point " }{TEXT 2 3 "x=a" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "T := x -> evalf(f(a))+m*(x-a);" }}}{PARA 0 "" 0 "" {TEXT -1 67 "Let d determine the size of the region around the point of tangency" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "d := 1. 0;" }}}{PARA 0 "" 0 "" {TEXT -1 41 "and plot the function and the tang e line " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "plot(\{f(x),T(x) \},x=a-d..a+d, y=f(a)-d..f(a)+d);" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 41 "We can \"zoom\" in on the point of tangency" }}{PARA 0 "" 0 "" {TEXT -1 31 "Set the size of the plot region" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "d := 10:" }}}{PARA 0 "" 0 "" {TEXT -1 123 "plot the function, tangent line, and the point of tangency.\nEach time the fol lowing is executed, the window reduces in size" }}{PARA 0 "" 0 "" {TEXT -1 69 "allowing us to zoom in. Notice the graphs approach strai ght lines..." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 216 "fplot := pl ot(f(x), x=a-d..a+d, y=f(a)-d..f(a)+d, color=red):\nTplot := plot(T(x) , x=a-d..a+d, y=f(a)-d..f(a)+d, color=blue):\nCplot := circle([a,f(a)] ,d/50,color=green): \ndisplay(\{fplot,Tplot,Cplot\});\nd := d/2.0 :" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 46 "Define a function to do th e zooming for us ..." }}{PARA 0 "" 0 "" {TEXT -1 98 "zoom( ) will depe nd on the function, as well as the point of tangency,\nand the size of the window." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 369 "zoom := pro c(f,a,d)\n local m, Df, T, fplot, Tplot, Cplot,x;\n Df := unapply( d iff(f(x),x) , x );\n m := evalf(Df(a));\n T := x -> evalf(f(a))+m*(x -a);\n fplot := plot(f(x), x=a-d..a+d, y=f(a)-d..f(a)+d, color=red): \n Tplot := plot(T(x), x=a-d..a+d, y=f(a)-d..f(a)+d, color=blue):\n \+ Cplot := circle([a,f(a)],d/50,color=green): \n display(\{fplot,T plot,Cplot\});\nend:" }}}{PARA 0 "" 0 "" {TEXT -1 39 "We must define t he function as a \"rule\"" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 " d := 4.0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 42 "f := x -> sin( x):\nzoom(f,2,d);\nd := d/2.0;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 25 "Define a \"slide\" f unction" }}{PARA 0 "" 0 "" {TEXT -1 97 "Plot the tangent line as a fun ction of the point of tangency, and the\nend points of the intervals" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 344 "slide := proc(f,a,b,c)\n \+ local m, d, Df, T, fplot, Tplot, Cplot, x;\n d := c-b;\n Df := unap ply( diff(f(x),x) , x );\n m := evalf(Df(a));\n T := x -> evalf(f(a) )+m*(x-a);\n fplot := plot(f(x), x=b..c, color=red):\n Tplot := plot (T(x), x=b..c, color=blue):\n Cplot := circle([a,f(a)],d/40,color=bla ck): \n display(\{fplot,Tplot,Cplot\});\nend:" }{TEXT -1 0 "" }} }{PARA 0 "" 0 "" {TEXT -1 21 "Set up the parameters" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "b := -5.0:\nc := 5.0:\nN := 20:\ndx := (c-b )/N:" }}}{PARA 0 "" 0 "" {TEXT -1 44 "Go forwards and backwards along \+ the function" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 119 "for i from \+ 0 to N-1 do\n p[i] := slide(f,b+i*dx,b,c):\nod:\nfor i from N to 2*N \+ do\n p[i] := slide(f,c+(N-i)*dx,b,c):\nod:" }}}{PARA 0 "" 0 "" {TEXT -1 40 "Create an animated sequence of plots ..." }}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 44 "display(seq(p[i],i=0..2*N),insequence=true);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 0 {PARA 3 "" 0 "" {TEXT -1 37 "Watch the secant approach the tangent" }}{PARA 0 "" 0 "" {TEXT -1 77 "Plot the secant line as a function of the limit poin t, the approaching point," }}{PARA 0 "" 0 "" {TEXT -1 33 "and the endp oints of the interval" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 533 "se cant := proc(f,a,b,c,d)\n local Df, mS, mT, S, T, Cplot1, Cplot2,\n \+ fplot, Splot, Tplot, x;\n mS := (f(b)-f(a))/(b-a);\n S := x -> f(a ) + mS*(x-a); \n Df := unapply( diff(f(x),x) , x );\n mT := evalf(Df (a));\n T := x -> evalf(f(a))+mT*(x-a); \n fplot := plot(f(x), x=c.. d, color=red):\n Splot := plot(S(x), x=c..d, color=blue);\n Tplot := plot(T(x), x=c..d, color=black);\n Cplot1 := circle([a,f(a)],(d-c)/1 00,color=black);\n Cplot2 := circle([b,f(b)],(d-c)/100,color=black); \+ \n display(\{fplot,Splot,Tplot,Cplot1,Cplot2\});\nend:" }}}{PARA 0 "" 0 "" {TEXT -1 56 "Create a sequence of plots approaching the tangen t point" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "for i from 0 to 2 0 do\n p[i] := secant(f,0,-2+i*0.1,-4,4):\nod:" }}}{PARA 0 "" 0 "" {TEXT -1 24 "Now animate the sequence" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "display(seq(p[i],i=0..20),insequence=true);" }}}}} {MARK "8" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }