# Christopher Walls # Derivatives of Inverse Trigonometric Functions # # This maplet does not work at present because it asks students to evaluate the derivatives at numbers outside the domain. # restart; with(Maplets):with(Maplets[Tools]):with(Maplets[Elements]):with(plots): StartEngine(); randomize(): Derivatives:=Maplet(onstartup=RunWindow(MAIN), Window[MAIN]('title'="Derivatives of Inverse Trig Functions", [ halign=none, [ Button("New Problem", Evaluate('function'="ask")), HorizontalGlue(), Button("Quit",Shutdown()) ], [ "Take the derivative of", HorizontalGlue() ], [ "f(x) =", MathMLViewer['question']('width'=300,'height'=60), HorizontalGlue() ], [ "f '(x) =", TextField['answer']('width'=40), HorizontalGlue() ], [ HorizontalGlue(), Button("Check Answer", Evaluate('function'="check")), HorizontalGlue(), Button("Show Derivative", Evaluate('function'="show")), HorizontalGlue() ], [ Label[Lfa]("f '(a) ="), TextField['answer2']('width'=40), HorizontalGlue() ], [ HorizontalGlue(), Button("Check Answer", Evaluate('function'="check2")), HorizontalGlue(), Button("Show Derivative", Evaluate('function'="show2")), HorizontalGlue() ], [ TextField['reply']('width'=40, 'editable'='false') ], [ "Brought to you by Chris-B-Good" ], [ "Programmer: C. Walls Copyright P. Yasskin 2005" ] ] ) ): card:=rand(0..1): rand1:=rand(1..5): rand3:=rand(1..6): funcs:=[b*arcsin(a*x^n), b*arccos(a*x^n), b*arctan(a*x^n), b*arcsec(a*x^n), b*arccsc(a*x^n), b*arccot(a*x^n)]; ask:=proc() local f,g; global card, rand1, rand3, funcs, a, b, n, correctanswer, correctanswer2; Set('answer'=""); Set('reply'=""); a:=(-1)^card()*rand1(); b:=(-1)^card()*rand1(); n:=rand1(); f:=funcs[rand3()]; Set('question'=MathML[Export]('f'=f)); correctanswer:=diff(f,x); g:=rand1(); Set('Lfa'(caption)=cat("f '(", g, ") =")); correctanswer2:=subs(x=g, correctanswer); end proc: check:=proc() global correctanswer; local useranswer; useranswer:=Get('answer'::anything, corrections=true, update=true): if simplify(correctanswer-useranswer=0) then Set('reply'="Great Googalee Mooglalee!") else Set('reply'="Oops. Once more?") end if; end proc: show:=proc() global correctanswer; Set('answer'=correctanswer); end proc: check2:=proc() global correctanswer2; local useranswer2; useranswer2:=Get('answer2'::anything, corrections=true, update=true): if simplify(correctanswer2-useranswer2=0) then Set('reply'="Wowza!") else Set('reply'="So close!") end if; end proc: show2:=proc() global correctanswer2; Set('answer2'=correctanswer2); end proc: Display( Derivatives );