{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 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 1 18 0 0 0 0 0 0 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 }{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 "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {PARA 256 "" 0 "" {TEXT 256 89 "Calculus Exploration 7: Max Ar ea of Box within a Parabola & Basic Curve Analysis Maplets " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 257 118 "The following is the Maple code for the Max Area of Box within a Parabola Maplet an d the Basic Curve Analysis Maplet. " }{TEXT -1 0 "" }{TEXT 258 81 "Ins tructions for each exploration are contained in the title line of each maplet." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 33 "Max Area of Box within a Parabola" }}{EXCHG {PARA 0 "" 0 "" {TEXT 260 36 "Click in red area and press [Enter]." }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 9909 "# Area Maximization Maplet\n# C opyright 2002 Waterloo Maple Inc.\n# \n# The Area Maximization maplet \+ is designed to give the user an intuitive understanding of optimizatio n problems. It provides an interactive demonstration of the following problem typically studied in calculus.\n# \n# Given a parabola with r eal roots, find the rectangle between the parabola and the x-axis that has maximal area.\n# \n# The user enters the expression for a parabol a in the uppermost text area. The user experiments with the value of \+ the width of the box by entering values in the text region to try to a pproach the optimum by trial and error. \n# \n# When the user clicks \+ the Optimize button, the optimal solution is displayed both numericall y and graphically.\n# \n# To run this maplet, click the Execute (!!!) \+ button in the context bar.\n# \nrestart; \nAreaMaximiztionMaplet:= mo dule()\n############################################################\n \nexport parabArea, parabRoots, parabInitialDraw, parabDraw,parabOptWi dth,runAreaMaximization:\nlocal helpStr:\n\n########################## ##################################\nhelpStr:=\n\"The Area Maximization maplet is designed to give you an intuitive understanding of optimiza tion problems. It provides an interactive demonstration of the follow ing problem typically studied in calculus.\n\nGiven a parabola with re al roots, find the rectangle between the parabola and the x-axis that \+ has maximal area.\n\nEnter the expression for a parabola in the upperm ost text area. Experiment with the value of the width of the box by e ntering values in the text region to try to approach the optimum by tr ial and error. To display the optimal solution both numerically and g raphically, click the 'Optimize' button.\":\n\n\n##################### #######################################\n#computes the area of a recta ngle of width width embedded between a parabola f and \n#the x-axis\n \n parabArea := proc(fun, width)\n local cent, f, wid;\n \n \+ f:=parse(fun):\n f:=unapply(f,x):\n wid:=parse(width):\n if t ype(wid, constant) and Im(wid)=0 and evalf(wid)>=0 then \n cen t:=solve(diff(f(x),x)=0,x);\n evalf(abs(wid*f(cent+wid/2.0)), 4); \n else error \"Width must be a real, non-negative constant\";\n \+ end if;\n end proc:\n\n############################################# ###############\n#computes the roots of parabola f and returns them in ascending order\n\n parabRoots := proc(f)\n local Roots;\n if \+ type(f(x),quadratic) then \n Roots:=solve(f(x)=0,x);\n if I m(Roots[1])=0 and \n Im(Roots[2])=0 \n then\n \+ [min(Roots), max(Roots)];\n else error \"The parabola must \+ intersect the x-axis\";\n end if;\n else error \"Entered funct ion must be quadratic\";\n end if;\n end proc:\n\n################ ############################################\n#draws parabola \n\n p arabInitialDraw := proc(fun)\n local Roots ,f;\n f:=parse(fun): \n f:=unapply(f,x):\n Roots:=parabRoots(f);\n plot(f, Roots[1 ]-1..Roots[2]+1, thickness=3);\n end proc: \n\n###################### ######################################\n#draws parabola f along with t he embedded rectangle of width width\n\n parabDraw := proc(fun, wid) \n local cent, d, rec1, graph, Roots,width,f;\n\n f:=parse(fun): \n f:=unapply(f,x):\n width:=parse(wid):\n if type(width, con stant) and Im(width)=0 and evalf(width)>=0 then\n Roots:=parabRoo ts(f);\n if evalf(width) <= evalf(abs(Roots[2]-Roots[1])) then \n cent := (Roots[1]+Roots[2])/2.0;\n d := width/2.0;\n \+ rec1 := plottools[rectangle]([cent-d, 0],[cent+d, f(cent+d)], col or=green, thickness=2);\n graph := plot(f, Roots[1]-1..Roots[2] +1, thickness=3):\n plots[display](rec1, graph);\n else er ror \"This box does not fit between the parabola and the x-axis\"\n \+ end if;\n else error \"Width must be real and non-negative\";\n \+ end if;\n end proc:\n\n########################################### #################\n#computes the width of a box embedded between parab ola f and the x-axis having\n#maximal area\n\n parabOptWidth := proc( fun)\n local Roots, wCrits, wOpt, areaOpt, cent,f;\n \n f:=pa rse(fun):\n f:=unapply(f,x):\n Roots:=parabRoots(f);\n cent:= solve( diff(f(x),x)=0, x);\n areaOpt := wOpt*f(cent+wOpt/2);\n w Crits := solve( diff(areaOpt,wOpt)=0, wOpt );\n max(wCrits[1], wCri ts[2]);\n end proc: \n\n############################################ ################\nrunAreaMaximization :=proc()\nlocal maplet:\nuse Map lets:-Elements in\nmaplet := Maplet( 'onstartup'=RunWindow('mainWin'), \n\nFont['F2']('family'=\"Default\", 'bold'='true', 'size'=14),\n\n M enuBar['MB'](\n\n Menu(\"File\", \n MenuItem(\"Optimize\", 'on click'=A3),\n MenuSeparator(),\n MenuItem(\"Close\", 'onclic k'=Shutdown())\n ), # end Menu/File\n\n Menu(\"Help\", \n M enuItem(\"Using this Maplet\", 'onclick'=RunWindow('helpWin'))\n ) \+ # end menu/Help\n\n ), # end MenuBar \n\n\n Window['mainWin' ]('menubar'='MB',\n title=\"Explore the maximum area of a bo x within a parabola intersecting the x-axis. Also, use the derivative to solve it by hand.\",\n\n BoxRow \n ('backgroun d'=\"#DDFFFF\",\n\n BoxColumn\n ('background'= \"#DDFFFF\", \n\n BoxRow('background'=\"#DDFFFF\", 'cap tion'=\"Enter a parabola\",\n border='true', \n \+ TextField[F](\"9-x^2\", 'background'=\"#EEFFFF\") \n \+ ), # end BoxRow\n\n BoxRow('background '=\"#DDFFFF\", 'border'='true', 'caption'=\"Plot Window\",\n \+ Plotter[PL1]('background'=\"#EEFFFF\")\n ) # end BoxRow\n\n ), # end BoxColumn\n\n BoxCol umn('background'=\"#DDFFFF\",\n\n BoxColumn('backgroun d'=\"#DDFFFF\", caption=\"Experimentation\", border=true,\n\n \+ BoxRow('background'=\"#DDFFFF\",\n BoxCe ll( halign='left', \"Guess the width of the biggest box \" ), \n \+ BoxCell( halign='left', TextField[W](3, 'value'=\" \",' background'=\"#EEFFFF\") ),\n BoxCell(), \n \+ BoxCell(Button(\"Plot Box\", onclick='A2', 'background'= \"#CCFFFF\")) \n ), # end BoxRow\n\n \+ BoxRow('background'=\"#DDFFFF\",\n Box Cell( halign='left', \"Area of this box \" ), \n \+ BoxCell( halign='left', TextField[AREA1](value=0, not editable, 10, \n 'background'=\"#EEFFFF\") ) \n \+ ) # end BoxRow\n ), # end BoxColumn\n\n \+ BoxColumn('background'=\"#DDFFFF\", caption=\"Optimizati on\", border=true,\n\n BoxRow('background'=\"#DDFFFF \",\n BoxCell(halign='left', \"Width of the bigge st box \" ),\n BoxCell( halign='center', \n \+ MathMLViewer[WIDTH](height=50, width=150, 'backg round'=\"#EEFFFF\" ))\n ), # end BoxRow\n \+ \n Box Row('background'=\"#DDFFFF\",\n BoxCell( halign=' left', \"Area of the biggest box \" ),\n BoxCell( halign='left', TextField[AREA2](value=0, not editable, 10, \n \+ 'background'=\"#EEFFFF\" ))\n \+ ), # end BoxRow\n\n BoxRow('background'=\"#DDFFFF \",\n BoxCell( halign='left', Button( \"Optimize\" , onclick=A3, 'background'=\"#CCFFFF\") \+ )\n ) # end BoxRow\n\n ), # end Bo xColumn \n\n BoxRow('background'= \"#DDFFFF\", 'spacing'=10, 'inset'=10,\n Button(\"Pl ot Parabola\", 'background'=\"#CCFFFF\", 'onclick'=A1 ),\n \+ Button(\"Close\", 'background'=\"#CCFFFF\", Shutdown() )\n \+ ) # end BoxRow\n\n ) # end BoxColumn\n \+ )\n )\n ,\n\n Window['helpWin']( 'resizabl e'='false',\n 'title'=\"Using the Area Maximization Maplet\",\n \+ BoxColumn('border'='true', 'inset'=0, 'spacing'=5,\n 'background' =\"#CCFFFF\",\n BoxCell(\n TextBox('height'=13, 'width'=42 ,\n 'background'=\"#DDFFFF\", 'foreground'=\"#333399\", 'font '='F2',\n 'editable'='false',\n 'value'=helpStr\n \+ ) # end TextBox\n ), # end BoxCell\n BoxRow('inset'=0, \+ 'spacing'=0, 'background'=\"#CCFFFF\",\n Button(\"Close\", 'bac kground'=\"#CCFFFF\", \n CloseWindow('helpWin'))\n ) # e nd BoxRow\n ) # end BoxColumn\n ), # end helpWin\n\n Action[ 'A1']\n ( Evaluate\n ( 'waitforresult'='false','target'= 'PL1','function' = 'parabInitialDraw',\n Argument('F',quoted text='true')\n )\n ),\n \n Action['A2']\n ( E valuate\n ( 'waitforresult'='false','target'='AREA1',\n \+ 'function'='parabArea',\n Argument('F',quotedtext='true' ),\n Argument('W',quotedtext='true')\n ),\n \+ Evaluate\n ( 'waitforresult'='false','target'='PL1', \n \+ 'function'='parabDraw',\n Argument('F',quotedtext='true' ),\n Argument('W',quotedtext='true')\n )\n ),\n \n Action['A3']\n ( Evaluate\n ( 'target'='TF1',' function' = 'parabOptWidth',\n Argument('F',quotedtext='true ')\n ),\n Evaluate\n ( 'target'='WIDTH','funct ion' = 'MathML:-Export(TF1)' \n ),\n Evaluate\n \+ ( 'target'='AREA2' ,'function'= 'parabArea',\n Argument('F ',quotedtext='true'),\n Argument('TF1',quotedtext='true')\n \+ ), \n Evaluate\n ( 'target'='PL1' ,'function '= 'parabDraw',\n Argument('F',quotedtext='true'),\n \+ Argument('TF1',quotedtext='true')\n ) \n \+ ),\n TextField['TF1'](1)\n \n\n): # end Maplet\n\nMap lets:-Display(maplet):\n\nend use:\nend proc:\n\nend module: # end Map let\nAreaMaximiztionMaplet:-runAreaMaximization();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 20 "B asic Curve Analysis" }}{EXCHG {PARA 0 "" 0 "" {TEXT 259 36 "Click in r ed area and press [Enter]." }{TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22965 "# Curve Analysis Maplet\n# Copyright 2002 Waterloo Maple Inc.\n# \n# The Curve Analysis maplet allows the user to analyz e the graph of a function using first and second derivatives. \n# \n# The user enters a function. The maplet displays the intervals over w hich the function is increasing, decreasing, concave or convex, or the local maximum and minimum points. \n# \n# Additionally, the user can view a plot of all intervals and points.\n# \n# To run this maplet, c lick the Execute (!!!) button in the context bar.\n# \nDigits:=5:\nCur veAnalysisMaplet := module()\n\nexport DisplayOptions, PlotOptions, sh owFunc, showConUp, showConDown, showInc, showDec, showMax, showMin, Ca lc1Maplet, showConUp1, showConDown1, showInc1, showDec1, showMax1, sho wMin1, DisplayMax, DisplayMin, DisplayConcaveUp, DisplayConcaveDown, D isplayInc, DisplayDec, showAll, showTangent, findRoots, maplet; \n\nlo cal helpStr;\n\n###################################################### ######\n\nhelpStr := \n\"The Curve Analysis maplet allows you to analy ze the graph of a function using first and second derivatives.\n \nEnt er a continuous function and its domain. To display the function, sel ect Show the Function and click the 'Show' button. \n\nTo display the maximum and minimum points of this function, select Show the Local Ma xima or Show the Local Minima and click the 'Show' button. \n\nTo dis play the intervals over which the function is increasing or decreasing , select Show the Increasing Intervals or Show the Decreasing Interval s and click the 'Show' button. \n\nTo display the intervals over which the function is concave or convex, select Show the Concave Up Interva ls or Show the Concave Down Intervals and click the 'Show' button. \n \nTo view a plot of all intervals and points, click the 'Plot All' but ton.\":\n\n########################################################### #\n\nDisplayOptions:= proc()\n\nif Maplets:-Tools:-Get('TBh2'(value)) \+ then \n DisplayMax(Maplets:-Tools:-Get(F::algebraic), \n \+ Maplets:-Tools:-Get(NEGX::algebraic), \n Maplets:-Tools :-Get(POSX::algebraic));\n\nelif Maplets:-Tools:-Get('TBh3'(value)) th en \n DisplayMin(Maplets:-Tools:-Get(F::algebraic), \n \+ Maplets:-Tools:-Get(NEGX::algebraic), \n Maplets:-Tools:- Get(POSX::algebraic));\n\nelif Maplets:-Tools:-Get('TBh4'(value)) then \n DisplayInc(Maplets:-Tools:-Get(F::algebraic), \n M aplets:-Tools:-Get(NEGX::algebraic), \n Maplets:-Tools:-G et(POSX::algebraic));\n\nelif Maplets:-Tools:-Get('TBh5'(value)) then \+ \n DisplayDec(Maplets:-Tools:-Get(F::algebraic), \n Map lets:-Tools:-Get(NEGX::algebraic), \n Maplets:-Tools:-Get (POSX::algebraic));\n\nelif Maplets:-Tools:-Get('TBh6'(value)) then \n DisplayConcaveUp(Maplets:-Tools:-Get(F::algebraic), \n \+ Maplets:-Tools:-Get(NEGX::algebraic), \n Map lets:-Tools:-Get(POSX::algebraic));\n\nelif Maplets:-Tools:-Get('TBh7' (value)) then \n DisplayConcaveDown(Maplets:-Tools:-Get(F::algebraic ), \n Maplets:-Tools:-Get(NEGX::algebraic), \n \+ Maplets:-Tools:-Get(POSX::algebraic));\n\nend if;\n end proc: \n\n######################################################## ####\n\nPlotOptions:= proc()\n\nif Maplets:-Tools:-Get('TBh1'(value)) \+ then\n showFunc(Maplets:-Tools:-Get(F::algebraic), \n M aplets:-Tools:-Get(NEGX::algebraic), \n Maplets:-Tools:-Ge t(POSX::algebraic));\n\nelif Maplets:-Tools:-Get('TBh2'(value)) then \+ \n showMax1(Maplets:-Tools:-Get(F::algebraic), \n Maple ts:-Tools:-Get(NEGX::algebraic), \n Maplets:-Tools:-Get(PO SX::algebraic));\n\nelif Maplets:-Tools:-Get('TBh3'(value)) then \n \+ showMin1(Maplets:-Tools:-Get(F::algebraic), \n Maplets:-T ools:-Get(NEGX::algebraic), \n Maplets:-Tools:-Get(POSX::a lgebraic));\n\nelif Maplets:-Tools:-Get('TBh4'(value)) then \n show Inc1(Maplets:-Tools:-Get(F::algebraic), \n Maplets:-Tools:- Get(NEGX::algebraic), \n Maplets:-Tools:-Get(POSX::algebrai c));\n\nelif Maplets:-Tools:-Get('TBh5'(value)) then \n showDec1(Map lets:-Tools:-Get(F::algebraic), \n Maplets:-Tools:-Get(NEGX ::algebraic), \n Maplets:-Tools:-Get(POSX::algebraic));\n\n elif Maplets:-Tools:-Get('TBh6'(value)) then\n showConUp1(Maplets:-T ools:-Get(F::algebraic), \n Maplets:-Tools:-Get(NEGX::alg ebraic), \n Maplets:-Tools:-Get(POSX::algebraic));\n\neli f Maplets:-Tools:-Get('TBh7'(value)) then \n showConDown1(Maplets:-T ools:-Get(F::algebraic), \n Maplets:-Tools:-Get(NEGX::a lgebraic), \n Maplets:-Tools:-Get(POSX::algebraic));\n \nend if;\nend proc: \n \n######################################### ###################\nuse Maplets:-Elements in\n\nmaplet := Maplet('ons tartup'=RunWindow('mainWin'),\n\n##################################### #######################\n\n Font['F1']('family'=\"Default\", 'bold'='f alse', 'size'=12),\n Font['F2']('family'=\"Default\", 'bold'='true', ' size'=14),\n\n######################################################## ####\n\n MenuBar[MB1](\n Menu(\"File\",\n \+ MenuItem(\"Show\", 'onclick'='A1'), \n MenuSeparator() ,\n MenuItem(\"Plot All\", 'onclick'='A3'),\n \+ MenuItem(\"Clear\", 'onclick'='A4'),\n MenuSepara tor(),\n MenuItem(\"Close\", Shutdown())\n \+ ), # end menu/File\n \n Menu(\"Help\", \+ \n MenuItem(\"Using this Maplet\", 'onclick'=RunWindow( 'helpWin'))\n ) # end menu/Help\n ), # end Men uBar \n\n############################################################ \n\n Window[mainWin](title=\"Basic Curve Analysis: Explore using thi s maplet and then use derivatives to find local max/min points by hand .\", height=480, width=800, menubar=MB1, 'layout' = BL1,\n\n BoxLayou t[BL1](inset=0, 'background'=\"#DDFFFF\", \n \n BoxColumn(i nset=0, spacing=0, 'background'=\"#DDFFFF\",\n'caption'=\"Plot Window \", 'border'=true,\n Plotter[P1]('background'=\"#EEFFFF\")\n ) , # end BoxColumn for Plotter\n\n BoxColumn(inset=0, spacing=0, 'bac kground'=\"#DDFFFF\", \n\n BoxRow(inset=0, 'caption'=\"Enter a differentiable function and its domain:\", \n 'border '='true', spacing=0, 'background'=\"#DDFFFF\",\n \n Label (\"Function \", 'font' = 'F1'),\n TextField[F](\"sin(x)\", 'wid th'=15, 'background'=\"#EEFFFF\"),\n Label(\" x = \", 'font' = \+ 'F1'),\n BoxCell(TextField[NEGX](width=6,\"-4*Pi\", 'background '=\"#EEFFFF\")),\n Label(\" to \", 'font' = 'F1'),\n Box Cell(TextField[POSX](width=6,\"4*Pi\", 'background'=\"#EEFFFF\"))\n \+ \n ), # end BoxRow\n\n BoxRow('inset'=0, 'spacing'=0, 'ba ckground'=\"#DDFFFF\",\n BoxColumn('inset'=0, 'spacing'=0, 'ba ckground'=\"#DDFFFF\",\n \n RadioButton['TBh 1'](\"Show the Function\", 'background'=\"#DDFFFF\",'group'='BG1', 'v alue'='true'), # end RadioButton\n RadioButton['TBh2'](\" Show the Local Maxima\", 'background'=\"#DDFFFF\",'group'='BG1'\n \+ ), # end RadioButton\n RadioButton['TBh3'](\"Sho w the Local Minima\", 'background'=\"#DDFFFF\",'group'='BG1'\n \+ ) # end RadioButton \n\n ), # end BoxColumn\n\n BoxCo lumn('inset'=0, 'spacing'=0, 'background'=\"#DDFFFF\",\n\n \+ RadioButton['TBh4'](\"Show the Increasing Intervals\", 'background'= \"#DDFFFF\", 'group'='BG1'), \n # end RadioButton \n \+ RadioButton['TBh5'](\"Show the Decreasing Intervals\", 'ba ckground'=\"#DDFFFF\", 'group'='BG1'),\n # end RadioBu tton\n RadioButton['TBh6'](\"Show the Concave Up Interval s\", 'background'=\"#DDFFFF\",'group'='BG1'), \n # end RadioButton \n RadioButton['TBh7'](\"Show the Concave Do wn Intervals\", 'background'=\"#DDFFFF\",'group'='BG1') \n \+ # end RadioButton\n\n ) # end BoxColumn\n ), # end Box Row\n\n BoxRow('background'=\"#DDFFFF\", \n\n Button(\"Plot \+ your choice\", 'onclick'='A1', 'background'=\"#EEFFFF\", \n \+ 'font' = 'F1'\n ), # end Show button\n\n###### ############################ Moved the Plot All Button \n Button[all ](\"Plot All\", 'onclick'='A3', 'font' = 'F1',\n 'bac kground'=\"#EEFFFF\") # end Plot All button\n\n ), # end Box Row \n \n BoxRow('caption'=\"Points and Intervals\", border=tr ue, inset=0, spacing=0, 'background'=\"#DDFFFF\",\n MathML Viewer['T1']( 'background'=\"#EEFFFF\")\n ), # end BoxRow\n\n BoxRow('background'=\"#DDFFFF\",\n\n \n But ton[clear](\"Clear\", 'onclick'='A4', 'font' = 'F1',\n \+ 'background'=\"#EEFFFF\"), # end Clear button\n\n Button [close](\"Close\", Shutdown(), 'font' = 'F1',\n 'back ground'=\"#EEFFFF\") # end Close button \n ) # end BoxRow\n ) # end BoxColumn\n) # end BoxLayout\n), # end Window \n\n####### #####################################################\n\n Window['hel pWin']( 'resizable'='false',\n 'title'=\"Using the Curve Analysis M aplet\",\n BoxColumn('border'=true, 'background'=\"#DDFFFF\", 'inse t'=0, 'spacing'=4,\n\n BoxRow('inset'=0, 'spacing'=0, 'background '=\"#DDFFFF\", \n\n TextBox('height'=22, 'width'=36, 'backgroun d'=\"#DDFFFF\", 'font'='F2',\n 'editable'='false', 'value'=he lpStr, 'foreground'=\"#333399\"\n ) # end TextBox\n\n ), # end BoxRow\n\n BoxRow('inset'=0, 'spacing'=0, 'background'=\"#DD FFFF\", \n Button(\"Close\", 'font'='F1', 'background'=\"#CCFFF F\", CloseWindow('helpWin') )\n ) # end BoxRow\n\n ) # end Box Column\n ), # end helpWin\n\n######################################## ####################\n\nButtonGroup['BG1'](),\n\nAction['A1'](Evaluate ('T1'='DisplayOptions'), \n Evaluate('P1'='PlotOptions')\n ), # end A1\n\nAction['A3'](Evaluate(P1='showAll(F, NEGX, P OSX)'), \n SetOption('T1'=\"\")\n ), # end A2\n \nAction['A4'](SetOption('F'=\"\"), \n SetOption('NEGX'=\" \"), \n SetOption('POSX'=\"\"), \n SetOption(' T1'=\"\"),\n Evaluate('P1' = plot(undefined, x = 0..10))\n ) # end A3\n):\n\nend use:\n############################## ##############################\n\n#################################### ########################\n\nshowFunc := proc(f, negX, posX) option rem ember:\n plot(f, x=negX..posX, color=black, thickness=3):\nend proc: \n\nshowConUp1 := proc(f, negX, posX) option remember:\n plots[displa y](showConUp(f, negX, posX), showFunc(f, negX, posX)):\nend proc:\n\ns howConDown1 := proc(f, negX, posX) option remember:\n plots[display]( showConDown(f, negX, posX), showFunc(f, negX, posX)):\nend proc:\n\nsh owInc1 := proc(f, negX, posX) option remember:\n plots[display](showI nc(f, negX, posX), showFunc(f, negX, posX)):\nend proc:\n\nshowDec1 := proc(f, negX, posX) option remember:\n plots[display](showDec(f, neg X, posX), showFunc(f, negX, posX)):\nend proc:\n\nshowMax1 := proc(f, \+ negX, posX) option remember:\n plots[display](showMax(f, negX, posX), showFunc(f, negX, posX)):\nend proc:\n\nshowMin1 := proc(f, negX, pos X) option remember:\n plots[display](showMin(f, negX, posX), showFunc (f, negX, posX)):\nend proc:\n\n###################################### ######################\n\nshowConUp := proc(f, negX, posX) option reme mber:\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, posX);\n \n if not member(evalf(negX), sols) then\n sols := [evalf(negX), op(sort(sol s))]:\n end if:\n \n if not member(evalf(posX), sols) then\n sol s := [op(sort(sols)), evalf(posX)]:\n end if:\n \n n := 100: polys \+ := []:\n \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 := eval f(sols[j] + i * delta): Y2 := evalf(subs(x=X2,f)):\n p[i] := pl ots[polygonplot]([[X1, 0],[X1, Y1],[X2, Y2],[X2, 0]], color=plum, styl e=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 plots[display](seq(polys[i],i=1..nops(polys))):\n end proc:\n\n######################################################### ###\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, posX);\n if not member(evalf(negX), \+ sols) then\n sols := [evalf(negX), op(sort(sols))]:\n end if:\n i f not member(evalf(posX), sols) then\n sols := [op(sort(sols)), eva lf(posX)]:\n end if:\n n := 100: polys := []:\n for j from 1 to (no ps(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] := plots[polygonplot]([[X1, 0],[X1, Y1],[ X2, Y2],[X2, 0]], color=pink, style=patchnogrid):\n end do:\n \+ polys := [op(polys), seq(p[i],i=1..n)]:\n end if:\n end do:\n i f nops(polys) = 0 then\n return NULL:\n end if:\n plots[display]( seq(polys[i],i=1..nops(polys))):\nend proc:\n\n####################### #####################################\n\nshowInc := 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), s ols) then\n sols := [evalf(negX), op(sort(sols))]:\n end if:\n if not member(evalf(posX), sols) then\n sols := [op(sort(sols)), eval f(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 \+ lines := [op(lines), plot(f, x=sols[j]..sols[j+1], color=blue, thickne ss=3)]:\n end if:\n end do:\n if nops(lines) = 0 then\n return NULL:\n end if:\n plots[display](seq(lines[i],i=1..nops(lines))):\n end proc:\n\n######################################################### ###\n\nshowDec := proc(f, negX, posX) option remember:\n local d1, so ls, i, lines, j:\n d1 := diff(f,x);\n sols := findRoots(d1, 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 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 lines := [op(lines), plot(f, x=s ols[j]..sols[j+1], color=red, thickness=3)]:\n end if:\n end do:\n if nops(lines) = 0 then\n return NULL:\n end if:\n plots[displa y](seq(lines[i],i=1..nops(lines))):\nend proc:\n\n#################### ########################################\n\nshowMax := proc(f, negX, p osX) option remember:\n local d1, d2, sols, i, p:\n d1 := diff(f,x); \n d2 := diff(f,x$2);\n sols := DisplayMax(f, negX, posX);\n p := [ ]:\n for i from 1 to nops(sols) do\n if evalf(subs(x=sols[i][1],d2 )) < 0 then\n p := [op(p), plottools[line]([sols[i][1],0],[sols[i ][1],subs(x=sols[i][1], f)], color=blue, thickness=3)]:\n end if:\n end do:\n if nops(p) = 0 then\n return NULL:\n end if:\n plots [display](seq(p[i],i=1..nops(p))):\nend proc:\n\n##################### #######################################\n\nshowMin := proc(f, negX, po sX) option remember:\n local d1, d2, sols, i, p:\n d1 := diff(f,x); \n d2 := diff(f,x$2);\n sols := DisplayMin(f, negX, posX);\n p := [ ]:\n for i from 1 to nops(sols) do\n if evalf(subs(x=sols[i][1],d2 )) > 0 then\n p := [op(p), plottools[line]([sols[i][1],0],[sols[i ][1],subs(x=sols[i][1], f)],color=red,thickness=3)]:\n end if:\n e nd do:\n if nops(p) = 0 then\n return NULL:\n end if:\n plots[di splay](seq(p[i],i=1..nops(p))):\nend proc:\n\n######################## ####################################\n\nDisplayMax:=proc(f, negX, posX )\nlocal Max, CritPoints, i, Diffunc;\nMax:=[]:\nCritPoints:=Student:- Calculus1:-CriticalPoints(f, x=negX..posX):\nDiffunc:=diff(f, x):\nif \+ CritPoints = [] then\n CritPoints:=Student:-Calculus1:-CriticalPoints (f, numeric, x=negX..posX):\nend if;\nif CritPoints <> [] then\nfor i \+ from 1 to nops(CritPoints) do\n if i<>nops(CritPoints) and evalf(sub s(x=(CritPoints[i+1]+CritPoints[i])/2, Diffunc))<0 then\n Max:=[ op(Max), [CritPoints[i], value(subs(x=CritPoints[i], f))]];\n elif i =nops(CritPoints) and evalf(subs(x=((posX+CritPoints[nops(CritPoints)] )/2), Diffunc))<0 then\n Max:=[op(Max), [CritPoints[i], value(su bs(x=CritPoints[i], f))]];\nend if;\nend do;\nend if;\nMax;\nend proc: \n\n############################################################\n\nDi splayMin:=proc(f, negX, posX)\nlocal Min, CritPoints, i, Diffunc;\nMin :=[]:\nCritPoints:=Student:-Calculus1:-CriticalPoints(f, x=negX..posX) :\nDiffunc:=diff(f, x):\nif CritPoints = [] then\n CritPoints:=Studen t:-Calculus1:-CriticalPoints(f, numeric, x=negX..posX):\nend if;\nif C ritPoints <> [] then\nfor i from 1 to nops(CritPoints) do\n if i<>no ps(CritPoints) and evalf(subs(x=(CritPoints[i+1]+CritPoints[i])/2, Dif func))>0 then\n Min:=[op(Min), [CritPoints[i], value(subs(x=Crit Points[i], f))]];\n elif i=nops(CritPoints) and evalf(subs(x=((posX+ CritPoints[nops(CritPoints)])/2), Diffunc))>0 then\n Min:=[op(Mi n), [CritPoints[i], value(subs(x=CritPoints[i], f))]];\nend if;\nend d o;\nend if;\nMin;\nend proc:\n\n###################################### ######################\n\nDisplayInc:=proc(f, negX, posX)\nlocal Inc, \+ Points, d1, i;\nInc:=[]:\nd1:=diff(f, x):\nPoints:=Student:-Calculus1: -CriticalPoints(f, x=negX..posX):\nif Points = [] then\n Points:=Stu dent:-Calculus1:-CriticalPoints(f, numeric, x=negX..posX):\nend if; \n if Points <> [] then\n for i from 1 to nops(Points) do\n if i=1 and evalf(subs(x=((Points[i]+negX)/2), d1))>0 and negX <> Points[1] then \+ \n Inc:=[op(Inc), [negX, Points[i]]]; \n elif evalf(subs(x=P oints[i]+0.1, d1))>0 and i <> nops(Points) then\n Inc:=[op(Inc), [Points[i],Points[i+1]]];\n elif i=nops(Points) and evalf(subs(x=(( posX+Points[nops(Points)])/2), d1))>0 and Points[i]<> posX then \n Inc:=[op(Inc), [Points[i], posX]];\nend if;\nend do;\ne nd if; \nInc;\nend proc:\n\n########################################## ##################\n\nDisplayDec:=proc(f, negX, posX)\nlocal Dec, Poin ts, d1, i;\nDec:=[]:\nd1:=diff(f, x):\nPoints:=Student:-Calculus1:-Cri ticalPoints(f, x=negX..posX):\nif Points = [] then\n Points:=Student :-Calculus1:-CriticalPoints(f, numeric, x=negX..posX):\nend if; \nif P oints <> [] then \n for i from 1 to nops(Points) do\n if i=1 and ev alf(subs(x=((Points[1]+negX)/2), d1))<0 and negX <> Points[1] then \n Dec:=[op(Dec), [negX, Points[i]]]; \n elif evalf(subs(x=Poin ts[i]+0.1, d1))<0 and i <> nops(Points) then\n Dec:=[op(Dec), [P oints[i], Points[i+1]]];\n elif i=nops(Points) and evalf(subs(x=((po sX+Points[nops(Points)])/2), d1))<0 and posX <> Points[i ] then\n Dec:=[op(Dec), [Points[i], posX]];\nend if;\nend do;\ne nd if;\nDec; \nend proc:\n\n########################################## ##################\n\nDisplayConcaveUp:=proc(f, negX, posX)\nlocal Con caveUp, Points, d1, i;\nConcaveUp:=[]:\nd1:=diff(f, x$2):\nPoints:=Stu dent:-Calculus1:-InflectionPoints(f, x=negX..posX):\nfor i from 1 to n ops(Points) do\n if i=1 and evalf(subs(x=((Points[1]+negX)/2), d1))> 0 and negX <> Points[1] then \n if type(Points[i], RootOf) the n\n ConcaveUp:=[op(ConcaveUp), [negX, evalf(Points[i])]];\n \+ else \n ConcaveUp:=[op(ConcaveUp), [negX, Poin ts[i]]];\n end if; \n elif evalf(subs(x=Points[i]+0.1, d1))> 0 and i <> nops(Points) then\n if type(Points[i], RootOf) then \n ConcaveUp:=[op(ConcaveUp), [evalf(Points[i]), evalf(Point s[i+1])]];\n else\n ConcaveUp:=[op(ConcaveUp), [Point s[i], Points[i+1]]];\n end if; \n elif i=nops(Points) and eva lf(subs(x=((posX+Points[i])/2), d1))>0 and posX <> Points[i] then\n \+ if type(Points[i], RootOf) then\n ConcaveUp:=[op(Concav eUp), [evalf(Points[i]), posX]];\n else\n ConcaveUp:= [op(ConcaveUp), [Points[i], posX]];\n end if; \nend if;\nend d o;\nif nops(Points)=0 then\n Points:=Student:-Calculus1:-Critica lPoints(f, x=negX..posX); \n if evalf(subs(x=((posX+Points[1])/2), \+ d1))>0 then\n ConcaveUp:=[negX, posX];\nend if;\nend if;\nConcav eUp; \nend proc:\n\n################################################## ##########\n\nDisplayConcaveDown:=proc(f, negX, posX)\nlocal ConcaveDo wn, Points, d1, i;\nConcaveDown:=[]:\nd1:=diff(f, x$2):\nPoints:=Stude nt:-Calculus1:-InflectionPoints(f, x=negX..posX):\nfor i from 1 to nop s(Points) do\n if i=1 and evalf(subs(x=((Points[1]+negX)/2), d1))<0 \+ and negX <> Points[1] then \n if type(Points[i], RootOf) then\n ConcaveDown:=[op(ConcaveDown), [negX, evalf(Points[i])]];\n \+ else\n ConcaveDown:=[op(ConcaveDown), [negX, Points[i]]]; \+ \n end if;\n elif evalf(subs(x=Points[i]+0.1, d1))<0 and i <> nops(Points) then\n if type(Points[i], RootOf) then\n Co ncaveDown:=[op(ConcaveDown), [evalf(Points[i]), evalf(Points[i+1])]]; \n else\n ConcaveDown:=[op(ConcaveDown), [Points[i], Poin ts[i+1]]];\n end if; \n elif i=nops(Points) and evalf(subs(x=( (posX+Points[nops(Points)])/2), d1))<0 and posX <> Point s[i] then\n if type(Points[i], RootOf) then \n ConcaveDow n:=[op(ConcaveDown), [evalf(Points[i]), posX]];\n else\n \+ ConcaveDown:=[op(ConcaveDown), [Points[i], posX]];\n end if;\ne nd if;\nend do;\nif nops(Points)=0 then\n Points:=Student:-Calcu lus1:-CriticalPoints(f, x=negX..posX); \n if evalf(subs(x=((posX+Po ints[1])/2), d1))<0 then\n ConcaveDown:=[negX, posX];\nend if;\n end if;\nConcaveDown;\nend proc:\n\n################################## ##########################\n\nshowTangent := proc(f, negX, posX);\nplo ts[display](Student:-Calculus1:-MeanValueTheorem(f, x=negX..posX, show function=false, showpoints=false, showline=false, title=` `, tangentop tions=[thickness=3, color=green], tangentlength=0.5), showFunc(f, negX , posX));\nend proc:\n\n############################################## ##############\n\nshowAll := proc(f, negX, posX) option remember:\n p lots[display](showMin(f, negX, posX), showMax(f, negX, posX), showConD own(f, negX, posX), showConUp(f, negX, posX), showDec(f, negX, posX), \+ showInc(f, negX, posX)):\nend proc:\n\n############################### #############################\n\nfindRoots := proc(f, negX, posX) opti on remember:\n local n, i, delta, li, X1, X2, sol, IN, j:\n n := 100 :\n li := []:\n delta := (evalf(posX) - evalf(negX)) / n:\n X2 := e valf(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 type(s ol, numeric) then\n if not member(sol, li) then\n li := [ \+ op(li), sol]:\n end if:\n end if:\n end do:\n li;\nend proc: \nMaplets:-Display(maplet);\nend module:\n############################ ################################\n#CurveAnalysisMaplet:-Calc1Maplet(): \n#Maplets:-Display(CurveAnalysisMaplet:-maplet):" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "2 2" 66 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }