{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 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 2 0 2 0 2 2 0 1 }{PSTYLE "No \+ Name" -1 203 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 1 2 1 1 1 1 }1 1 0 0 0 0 2 0 2 0 2 2 0 1 }{PSTYLE "No Name206" -1 205 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 1 2 1 1 1 1 }1 1 0 0 0 0 2 0 2 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 71 "Matt Pertzborn, Red McGehe e\nMATH 151H\n\n\"AntiDerivative Exercise\" Maplet" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 203 "> " 0 "" {MPLTEXT 1 0 89 "with(Maplets): with(Maplets[Tools]): with(Maplets[Ele ments]): with(plots):\nStartEngine();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "randomize():" }}}{EXCHG {PARA 205 "> " 0 "" {MPLTEXT 1 0 1756 "FindAntiDerivative:= Maplet(onstartup = RunWindow(MAIN),\nWi ndow[MAIN]('title'=\"AntiDerivative Exercise\",\n[ halign=none,\n [ B utton(\"New Function\", Evaluate('function'=\"askquestion\")),\n Ho rizontalGlue(),\n Button(\"Quit\", Shutdown())\n ],\n [ \"The goa l is to find the antiderivative F(x) of the function f(x) =\",\n \+ TextField[function1]('width'=20,'editable'='false'),\n HorizontalG lue()\n ],\n [ \"satisfying the initial condition: F(\",\n TextF ield['xvalue']('width' = 5, 'editable' = 'false'),\n \") = \", \n \+ TextField['yvalue']('width' = 5,'editable' = 'false'),\n Horizont alGlue()\n ],\n [ \"1) Enter the general antiderivative of the funct ion (with constant C):\",\n HorizontalGlue()\n ],\n [ \"F(x) =\", TextField['useranswer']('width'=20),\n HorizontalGlue(),\n Butt on(\"Check Answer\",Evaluate('function' = \"checkanswer\")),\n Text Field[RightorWrong](editable='false','width'=10),\n Button(\"Show A nswer\", Evaluate('function' = \"getanswer\"))\n ],\n [ \"2) Identif y the constant C:\",\n HorizontalGlue()\n ],\n [ \"C = \",\n T extField['userconstant']('width'=20),\n HorizontalGlue(),\n Butt on(\"Check Answer\", Evaluate('function' = \"checkconstant\")), \n \+ TextField[RightorWrongC]('width' = 10,'editable' = 'false'), \n But ton(\"Show Answer\", Evaluate('function' = \"getconstant\"))\n ],\n \+ [ \"3) Identify the particular antiderivative:\",\n HorizontalGlue( )\n ],\n [ \"F(x) =\", \n TextField['userfinal']('width' = 20),\n HorizontalGlue(),\n Button(\"Check Answer\", Evaluate('function ' =\"checkfinalanswer\")), \n TextField[RightorWrongFinal]('width' \+ = 10, 'editable' = 'false'),\n Button(\"Show Answer\", Evaluate('fu nction' = \"getfinalanswer\"))\n ],\n [ \"Programmers: Pertzborn & M cGehee Copyright P. Yasskin 2005\"\n ]\n])):" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1322 "askquestion := proc()\nglobal f, ranswer, rconstant, rfinal;\nlo cal rand5, xval, yval, a,b,c,d,y;\nrand5:=rand(1..5):\na:=rand5();\nb: =rand5();\nc:=rand5();\nd:=rand5();\nif (a=1) then\n f:=2*x+4*b*x^3 \+ \nelif (a=2) then\n f:=b/x^2 \nelif (a=3) then\n f:=cos(x) + b*sin(x ) \nelif (a=4) then\n f:=-b/sqrt(b^2-x^2) \nelif (a=5) then\n f:=-cs c(x)^2\nend if;\nranswer:=int(f,x)+C;\nSet('function1'=f);\nSet('usera nswer'=\"\");\nSet('userconstant'=\"\");\nSet('userfinal'=\"\");\nSet( 'RightorWrong'=\"\");\nSet('RightorWrongC' = \"\");\nSet('RightorWrong Final'=\"\");\nif (a=1) then\n xval := [-2,-1,0,1,2][c];\n rconstant := [-2,-1,1,2,3][d];\n yval := eval(ranswer,[x=xval,C=rconstant]);\n elif (a=2) then\n xval := [1, 1/2, 1/3, -1, -1/2][c];\n rconstant := [0,1,2,3,4][d];\n yval := eval(ranswer,[x=xval,C=rconstant]);\nelif \+ (a=3) then\n xval := [Pi/2,Pi/4,Pi/3,Pi/6,-Pi/2][c];\n yval := [0,1, 2,3,4][d];\n rconstant := solve( yval = eval(ranswer,x=xval), C);\nel if (a=4) then\n xval := [b, b/sqrt(2), b/2, b*sqrt(3)/2, -b][c];\n y val := [Pi/2,Pi/4,Pi/3,Pi/6,-Pi/2][d];\n rconstant := solve( yval = e val(ranswer,x=xval), C);\nelif (a=5) then\n xval := [Pi/2,Pi/4,Pi/3,P i/6,-Pi/2][c];\n yval := [-2,-1,1,2,3][d];\n rconstant := solve( yva l = eval(ranswer,x=xval), C);\nend if;\nSet('xvalue' = xval);\nSet('yv alue' = yval);\nrfinal:=eval(ranswer, C=rconstant);\nend proc:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 347 "checkanswer:=proc()\nglobal ranswer;\nlocal uanswe r;\nuanswer := Get('useranswer'::'anything', corrections=true, update= true);\nif simplify(uanswer - ranswer)=0 then\n Set('RightorWrong' = \+ \"Way to go!\");\nelif simplify(uanswer + C -ranswer)=0 then\n Set('R ightorWrong' = \"You Forgot the C\");\nelse\n Set('RightorWrong' = \" Incorrect.\");\nend if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 273 "checkconstant := proc()\nglobal rconstant;\nlocal uc onstant;\nuconstant := Get('userconstant'::'realcons', corrections=tru e, update=true);\nif simplify(uconstant - rconstant)=0 then\n Set('Ri ghtorWrongC' = \"Excellent!\");\nelse\n Set('RightorWrongC' = \"Wrong .\")\nend if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 264 "checkfinalanswer := proc()\nglobal rfinal;\nlocal ufinal;\nufinal := Get('userfinal'::'anything', corrections=true, update=true);\nif s implify(ufinal - rfinal)=0 then\n Set('RightorWrongFinal' = \"AWESOME !\");\nelse\n Set('RightorWrongFinal' = \"Wrong.\")\nend if;\nend pro c:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "getanswer := proc()\n global ranswer;\nSet('useranswer' = ranswer)\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 81 "getconstant := proc()\nglobal rcons tant;\nSet('userconstant' = rconstant)\nend proc:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 75 "getfinalanswer := proc()\nglobal rfinal;\nSe t('userfinal' = rfinal)\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "Display (FindAntiDerivative);" }}}{EXCHG }}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 1 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }