{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 }{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 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 84 "restart:\nwith(Maple ts): with(Maplets[Elements]):with(Maplets[Tools]):\nStartEngine();" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "randomize():" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1702 "Logdiff:=Maplet(onstartup = RunWindow(MAIN),\nWindo w[MAIN]('title'=\"Logarithmic differentiation\",\n[ halign=none,\n [ \+ Button(\"New Function\", Evaluate('function' = \"ask\")),\n Horizon talGlue(),\n Button(\"Quit\", Shutdown())\n ],\n [ \"Use logarith mic differentiation to find the derivative of\",\n HorizontalGlue() \n ],\n [ HorizontalGlue(),\n \"f(x) =\",\n MathMLViewer[Fn](' value' = MathML[Export](((x-a)^m*(x-b)^n)/((x-c)^p*(x-d)^q)), height=7 5, width=200),\n HorizontalGlue()\n ],\n [ \"Take the log of both sides.\",\n HorizontalGlue()\n ],\n [ \"ln f(x) =\",\n TextFi eld['lnFn']('width'=30),\n HorizontalGlue() \n ],\n [ HorizontalG lue(),\n Button(\"Check\", Evaluate('function' = \"check1\")),\n \+ TextField['reply1']('width'=8, background=white),\n Button(\"Show \", Evaluate('function' = \"show1\")),\n HorizontalGlue() \n ],\n \+ [ \"Find the derivative of both sides. Type df/dx for the derivative \+ of f(x).\",\n HorizontalGlue()\n ],\n [ TextField['LHS']('width'= 8),\n \"=\",\n TextField['RHS']('width'=25),\n HorizontalGlue ()\n ],\n [ HorizontalGlue(),\n Button(\"Check\", Evaluate('funct ion' = \"check2\")),\n TextField['reply2left']('width'=11),\n Te xtField['reply2right']('width'=12),\n Button(\"Show\", Evaluate('fu nction'=\"show2\")),\n HorizontalGlue()\n ],\n [ \"Solve for the \+ derivative of f(x).\",\n HorizontalGlue()\n ],\n [ \"df/dx = \", \n TextField['dFn']('width' =45),\n HorizontalGlue()\n ],\n [ \+ HorizontalGlue(),\n Button(\"Check\", Evaluate('function' = \"check 4\")),\n TextField['reply4']('width'=8),\n Button(\"Show\", Eval uate('function' = \"show4\")),\n HorizontalGlue()\n ],\n [ \"Prog rammers: Greisser & Schepp Copyright P. Yasskin 2005\"\n ] \n] \n )\n): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "randnum:=rand(-9...9):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "randpow:=rand(2..6):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 618 "ask := proc()\nglobal a,m,b,n,c,p,d,q,g, randnum, \+ randpow;\na:=randnum();\nb:=randnum();\nn:=randpow();\nm:=randpow();\n c:=randnum();\nd:=randnum();\np:=randpow();\nq:=randpow();\ng:=(x-a)^m *(x-b)^n/(x-c)^p/(x-d)^q;\nSet(Fn=MathML[Export](g));\nSet(lnFn=\"\"): \nSet(reply1=\"\", 'reply1'(background)=white, 'reply1'(foreground) = \+ black):\nSet(LHS=\"\"):\nSet(RHS=\"\"):\nSet('reply2left'=\"\", 'reply 2left'(background)=white, 'reply2left'(foreground)=black):\nSet('reply 2right'=\"\", 'reply2right'(background)=white, 'reply2right'(foregroun d)=black):\nSet(dFn=\"\"):\nSet('reply4'=\"\", 'reply4'(background)=wh ite, 'reply4'(foreground)=black):\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 432 "c heck1 := proc()\n local user_lnf, lnf;\n global a,b,m,n,c,d,p,q;\n \+ user_lnf := Get(lnFn::algebraic, corrections=true, update=true):\n ln f:=m*ln(x-a)+n*ln(x-b)-p*ln(x-c)-q*ln(x-d);\n if simplify(normal(user _lnf - lnf))<> 0\n then\n Set('reply1'=\"incorrect\", 'reply1'(b ackground)=red, 'reply1'(foreground)=white):\n else\n Set('reply 1'=\" correct \", 'reply1'(background)=green, 'reply1'(foreground)=bla ck):\n end if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 195 "show1 := proc()\n local lnf;\n global a,m;\n lnf:=m*ln(x-a)+n* ln(x-b)-p*ln(x-c)-q*ln(x-d);\n Set(lnFn = lnf):\n Set('reply1'=\"\", 'reply1'(background)=white, 'reply1'(foreground)=black):\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 841 "check2 := proc()\n global a,b,m,n,c,d,p,q;\n \+ local user_lhs,lhs,user_rhs,rhs;\n user_lhs := Get(LHS::algebraic, co rrections=true, update=true):\n lhs:=1/f*df/dx;\n user_rhs := Get(R HS::algebraic, corrections=true, update=true):\n rhs:=m/(x-a)+n/(x-b )-p/(x-c)-q/(x-d);\n if simplify(normal(user_lhs - lhs))= 0 then\n \+ Set('reply2left'=\"left side correct\", 'reply2left'(background)=gree n, 'reply2left'(foreground)=black):\n else\n Set('reply2left'=\"le ft side incorrect\", 'reply2left'(background)=red, 'reply2left'(foregr ound)=white):\n end if;\n if simplify(normal(user_rhs - rhs))= 0 the n\n Set('reply2right'=\"right side correct\", 'reply2right'(backgro und)=green, 'reply2right'(foreground)=black):\n else\n Set('reply2 right'=\"right side incorrect\", 'reply2right'(background)=red, 'reply 2right'(foreground)=white):\n end if;\nend proc:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 342 "show2 := proc()\n global a,b,m,n,c,d,p,q; \n local lhs, rhs;\n lhs:=1/f*df/dx;\n rhs:=m/(x-a)+n/(x-b)-p/(x-c) -q/(x-d);\n Set(LHS = lhs):\n Set(RHS = rhs):\n Set('reply2left'=\" \", 'reply2left'(background)=white, 'reply2left'(foreground)=black):\n Set('reply2right'=\"\", 'reply2right'(background)=white, 'reply2righ t'(foreground)=black):\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 429 "check4 := proc()\n global a,b,m,n,c,d,p,q,g;\n local user_fnl,fnl;\n user _fnl := Get(dFn::algebraic, corrections=true, update=true):\n fnl:=( m/(x-a)+n/(x-b)-p/(x-c)-q/(x-d))*g;\n if simplify(normal(user_fnl - f nl))<> 0\n then\n Set('reply4'=\"incorrect\", 'reply4'(backgroun d)=red, 'reply4'(foreground)=white):\n else\n Set('reply4'=\" co rrect \", 'reply4'(background)=green, 'reply4'(foreground)=black):\n \+ end if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 204 "show 4 := proc()\n global a,b,m,n,c,d,p,q,g;\n local fnl;\n fnl:=(m/(x-a )+n/(x-b)-p/(x-c)-q/(x-d))*g;\n Set(dFn = fnl):\n Set('reply4'=\"\", 'reply4'(background)=white, 'reply4'(foreground)=black):\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "Display(Logdiff);" }}}{EXCHG }{EXCHG }{EXCHG }} {MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }