{VERSION 5 0 "IBM INTEL NT" "5.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 } {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 "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 2 6 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 2 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" -1 7 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 2 2 2 2 2 1 1 1 3 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 28 "Curve Analysis in Calculu s I" }}{PARA 19 "" 0 "" {TEXT -1 50 "By Sylvain Muise, smuise@student. math.uwaterloo.ca" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 249 "This maplet allows Calc I students to analyze the graph of a function using first and second derivatives. The student can enter a function and have th e maplet show the intervals over which the function is increasing, dec reasing, concave and convex." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 256 96 "To run this maplet, click the \"Execute-Worksh eet\" button in the tool-bar menu (the !!! button)\n" }{TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "restart: with(plots): with(plottools): with(Maplets): with(Map lets[Elements]):" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name cha ngecoords has been redefined\n" }}{PARA 7 "" 1 "" {TEXT -1 43 "Warning , the name arrow has been redefined\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6887 "cal1Maplet := Maplet(\n Window[W1](title=\"Calculu s 1\", menubar=MB1, 'layout' = BL1),\n MenuBar[MB1](Menu(\"File\", Me nuItem(\"Close\", Shutdown()))),\n BoxLayout[BL1](inset=0,\n BoxCo lumn(inset=0, spacing=0,\n Plotter[P1]()\n ),\n BoxColumn(i nset=0, spacing=0,\n BoxRow(inset=0, spacing=0,\n \"f(x)= \",\n TextField[F](\"-3*x^5+5*x^3 - 1.5*x\")\n ),\n B oxRow(inset=0, spacing=0,\n \"Domain: x= \",\n TextField [NEGX](3,\"-1.2\"),\n \" to \",\n TextField[POSX](3,\"1. 2\")\n ),\n Button[func](\"Show Function\", onclick=Evaluate (P1 = 'showFunc(F, NEGX, POSX)')),\n Button[conUp](\"Show Concave Up\", onclick=Evaluate(P1 = 'showConUp1(F, NEGX, POSX)')),\n But ton[conDown](\"Show Concave Down\", onclick=Evaluate(P1 = 'showConDown 1(F, NEGX, POSX)')),\n Button[inc](\"Show Increasing\", onclick=E valuate(P1 = 'showInc1(F, NEGX, POSX)')),\n Button[dec](\"Show De creasing\", onclick=Evaluate(P1 = 'showDec1(F, NEGX, POSX)')),\n \+ Button[max](\"Show Max Points\", onclick=Evaluate(P1 = 'showMax1(F, NE GX, POSX)')),\n Button[min](\"Show Min Points\", onclick=Evaluate (P1 = 'showMin1(F, NEGX, POSX)')),\n Button[all](\"Show All\", on click=Evaluate(P1 = 'showAll(F, NEGX, POSX)'))\n )\n )\n):\n\nshow Func := proc(f, negX, posX) option remember:\n plot(f,x=negX..posX, c olor=black, thickness=3):\nend proc:\nshowConUp1 := proc(f, negX, posX ) option remember:\n display(showConUp(f, negX, posX), showFunc(f, ne gX, posX)):\nend proc:\nshowConDown1 := proc(f, negX, posX) option rem ember:\n display(showConDown(f, negX, posX), showFunc(f, negX, posX)) :\nend proc:\nshowInc1 := proc(f, negX, posX) option remember:\n disp lay(showInc(f, negX, posX), showFunc(f, negX, posX)):\nend proc:\nshow Dec1 := proc(f, negX, posX) option remember:\n display(showDec(f, neg X, posX), showFunc(f, negX, posX)):\nend proc:\nshowMax1 := proc(f, ne gX, posX) option remember:\n display(showMax(f, negX, posX), showFunc (f, negX, posX)):\nend proc:\nshowMin1 := proc(f, negX, posX) option r emember:\n display(showMin(f, negX, posX), showFunc(f, negX, posX)): \nend proc:\n\nshowConUp := proc(f, negX, posX) option remember:\n lo cal d2, sols, i, n, polys, j, delta, X1, X2, Y1, Y2, p:\n d2 := diff( f,x$2);\n sols := findRoots(d2, negX, posX);\n if not member(evalf(n egX), sols) then\n sols := [evalf(negX), op(sort(sols))]:\n end if :\n if not member(evalf(posX), sols) then\n sols := [op(sort(sols) ), evalf(posX)]:\n end if:\n n := 100: polys := []:\n for j from 1 \+ to (nops(sols) - 1) do\n if evalf(subs(x = (sols[j] + sols[j+1])/2, d2)) > 0 then\n delta := (sols[j+1] - sols[j]) / n:\n X2 := sols[j]:\n for i from 1 to n do\n X1 := evalf(X2): Y1 := \+ evalf(subs(x = X1, f)):\n X2 := evalf(sols[j] + i * delta): Y2 \+ := evalf(subs(x=X2,f)):\n p[i] := polygonplot([[X1, 0],[X1, Y1] ,[X2, Y2],[X2, 0]], color=cyan, style=patchnogrid):\n end do:\n \+ polys := [op(polys), seq(p[i],i=1..n)]:\n end if:\n end do:\n \+ if nops(polys) = 0 then\n return NULL:\n end if:\n display(seq(p olys[i],i=1..nops(polys))):\nend proc:\n\nshowConDown := proc(f, negX, posX) option remember:\n local d2, sols, i, n, polys, j, delta, X1, \+ X2, Y1, Y2, p:\n d2 := diff(f,x$2);\n sols := findRoots(d2, negX, po sX);\n if not member(evalf(negX), sols) then\n sols := [evalf(negX ), op(sort(sols))]:\n end if:\n if not member(evalf(posX), sols) the n\n sols := [op(sort(sols)), evalf(posX)]:\n end if:\n n := 100: \+ polys := []:\n for j from 1 to (nops(sols) - 1) do\n if evalf(subs (x = (sols[j] + sols[j+1])/2, d2)) < 0 then\n delta := (sols[j+1] - sols[j]) / n:\n X2 := sols[j]:\n for i from 1 to n do\n \+ X1 := evalf(X2): Y1 := evalf(subs(x=X1,f)):\n X2 := evalf (sols[j] + i * delta): Y2 := evalf(subs(x=X2,f)):\n p[i] := pol ygonplot([[X1, 0],[X1, Y1],[X2, Y2],[X2, 0]], color=green, style=patch nogrid):\n end do:\n polys := [op(polys), seq(p[i],i=1..n)]: \n end if:\n end do:\n if nops(polys) = 0 then\n return NULL: \n end if:\n display(seq(polys[i],i=1..nops(polys))):\nend proc:\n\n showInc := proc(f, negX, posX) option remember:\n local d1, sols, i, \+ lines, j:\n d1 := diff(f,x);\n sols := findRoots(d1, negX, posX);\n \+ if not member(evalf(negX), sols) then\n sols := [evalf(negX), op(s ort(sols))]:\n end if:\n if not member(evalf(posX), sols) then\n \+ sols := [op(sort(sols)), evalf(posX)]:\n end if:\n lines := []:\n f or j from 1 to (nops(sols) - 1) do\n if evalf(subs(x=(sols[j]+sols[ j+1])/2,d1)) > 0 then\n lines := [op(lines), plot(f, x=sols[j]..s ols[j+1], color=blue, thickness=3)]:\n end if:\n end do:\n if nop s(lines) = 0 then\n return NULL:\n end if:\n display(seq(lines[i] ,i=1..nops(lines))):\nend proc:\n\nshowDec := proc(f, negX, posX) opti on remember:\n local d1, sols, i, lines, j:\n d1 := diff(f,x);\n so ls := findRoots(d1, negX, posX);\n if not member(evalf(negX), sols) t hen\n sols := [evalf(negX), op(sort(sols))]:\n end if:\n if not m ember(evalf(posX), sols) then\n sols := [op(sort(sols)), evalf(posX )]:\n end if:\n lines := []:\n for j from 1 to (nops(sols) - 1) do \n if evalf(subs(x=(sols[j] + sols[j+1])/2,d1)) < 0 then\n lin es := [op(lines), plot(f, x=sols[j]..sols[j+1], color=orange, thicknes s=3)]:\n end if:\n end do:\n if nops(lines) = 0 then\n return \+ NULL:\n end if:\n display(seq(lines[i],i=1..nops(lines))):\nend proc :\n\nshowMax := proc(f, negX, posX) option remember:\n local d1, d2, \+ sols, i, p:\n d1 := diff(f,x);\n d2 := diff(f,x$2);\n sols := findR oots(d1, negX, posX);\n p := []:\n for i from 1 to nops(sols) do\n \+ if evalf(subs(x=sols[i],d2)) < 0 then\n p := [op(p), line([sols [i],0],[sols[i],subs(x=sols[i], f)],color=blue,thickness=3)]:\n end if:\n end do:\n if nops(p) = 0 then\n return NULL:\n end if:\n \+ display(seq(p[i],i=1..nops(p))):\nend proc:\n\nshowMin := proc(f, neg X, posX) option remember:\n local d1, d2, sols, i, p:\n d1 := diff(f ,x);\n d2 := diff(f,x$2);\n sols := findRoots(d1, negX, posX);\n p \+ := []:\n for i from 1 to nops(sols) do\n if evalf(subs(x=sols[i],d 2)) > 0 then\n p := [op(p), line([sols[i],0],[sols[i],subs(x=sols [i], f)],color=red,thickness=3)]:\n end if:\n end do:\n if nops(p ) = 0 then\n return NULL:\n end if:\n display(seq(p[i],i=1..nops( p))):\nend proc:\n\nshowAll := proc(f, negX, posX) option remember:\n \+ display(showMin(f, negX, posX), showMax(f, negX, posX), showConDown(f , negX, posX), showConUp(f, negX, posX), showDec(f, negX, posX), showI nc(f, negX, posX)):\nend proc:\n\nfindRoots := proc(f, negX, posX) opt ion remember:\n local n, i, delta, li, X1, X2, sol, IN, j:\n n := 10 0:\n li := []:\n delta := (evalf(posX) - evalf(negX)) / n:\n X2 := \+ evalf(negX):\n for i from 1 to n do\n X1 := evalf(X2): X2 := evalf (negX + i * delta):\n sol := fsolve(f = 0, x = X1 .. X2):\n if t ype(sol, numeric) then\n if not member(sol, li) then\n li \+ := [ op(li), evalf(sol)]:\n end if:\n end if:\n end do:\n li ;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Display(cal 1Maplet);" }}{PARA 6 "" 1 "" {TEXT -1 38 "Initializing Java runtime en vironment." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "1 0 0" 78 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }