Derivatives of Hyperbolic FunctionsMikayla Barry & Chloe DixonMath 151 Section 201
Fall 2013Instructor: Philip YasskinSeriousNot seriousYou need a footer in the maplet.restart:with(Maplets[Tools]): with(Maplets[Elements]):
StartEngine();randomize():alias(e=exp(1)):ask:=proc()
global fexp, dexp, dhyp, func;
local whichfunc;
whichfunc:=Get(RBsinh):
if whichfunc then
func:=sinh(x);
fexp:= (e^x - e^(-x))/2;
dexp:= (e^x + e^(-x))/2;
dhyp:= cosh(x);
else
func:=cosh(x);
fexp:= (e^x + e^(-x))/2;
dexp:= (e^x - e^(-x))/2;
dhyp:= sinh(x);
end if;
Set(TFfexp="");
Set(TFdexp="");
Set(TFdhyp="");
Set(MRfexp="", MRfexp(background)=white);
Set(MRdexp="", MRdexp(background)=white);
Set(MRdhyp="", MRdhyp(background)=white);
Set(TFreply="", TFreply(background)=white);
end proc:
hintfexp:=proc()
Set(TFreply=" Each hyperbolic function can be written in terms of e^x. Memorize them.");
Set(MRfexp="Hint", MRfexp(background)=Orange);
end proc:checkfexp:=proc()
global fexp, dexp, dhyp;
local userfexp;
userfexp:=Get(TFfexp::anything);
if userfexp = fexp then
Set(MRfexp="Correct", MRfexp(background)=green)
else
Set(MRfexp="Incorrect", MRfexp(background)=red)
end if
end proc:showfexp:=proc()
global fexp, dexp, dhyp;
Set(TFfexp=fexp);
Set(MRfexp="Shown", MRfexp(background)=yellow);
end proc:
hintdexp:=proc()
Set(TFreply=" Use the derivative of e^x and chain rule to differentiate.");
Set(MRdexp="Hint", MRdexp(background)=Orange);
end proc:checkdexp:=proc()
global fexp, dexp, dhyp;
local userdexp;
userdexp:=Get(TFdexp::anything);
if userdexp = dexp then
Set(MRdexp="Correct", MRdexp(background)=green)
else
Set(MRdexp="Incorrect", MRdexp(background)=red)
end if
end proc:showdexp:=proc()
global fexp, dexp, dhyp;
Set(TFdexp=dexp);
Set(MRdexp="Shown", MRdexp(background)=yellow);
end proc:
hintdhyp:=proc()
Set(TFreply=" Each hyperbolic function can be written in terms of e^x. Memorize them.");
Set(MRdhyp="Hint", MRdhyp(background)=Orange);
end proc:checkdhyp:=proc()
global fexp, dexp, dhyp;
local userdhyp;
userdhyp:=Get(TFdhyp::anything);
if userdhyp = dhyp then
Set(MRdhyp="Correct", MRdhyp(background)=green)
else
Set(MRdhyp="Incorrect", MRdhyp(background)=red)
end if
end proc:showdhyp:=proc()
global fexp, dexp, dhyp;
Set(TFdhyp=dhyp);
Set(MRdhyp="Shown", MRdhyp(background)=yellow);
end proc:
HypDeriv:=Maplet(onstartup = Action(RunWindow(MAIN),Evaluate(function = "ask")),
Window[MAIN](title="Derivatives of Hyperbolic Functions",
[ valign=none, inset=0, spacing=0,
[ halign=none,
BoxRow( halign=none, border=true,
caption="Goal: Compute the Derivative of these Hyperbolic Functions: (Select one at a time.)",
HorizontalGlue(),
RadioButton[RBsinh](" f(x) = sinh(x) ", group=funcgp, background=magenta, font=Font(bold,14),true),
HorizontalGlue(),
RadioButton[RBcosh](" f(x) = cosh(x) ", group=funcgp, background=magenta, font=Font(bold,14)),
HorizontalGlue()
),
Button("Quit", Shutdown(), background=pink)
],
[ halign=none, border=true,
caption="Step 1: Write the hyperbolic function in terms of exponential functions:",
"f(x) = ",
TextField[TFfexp](width=25, background=turquoise),
HorizontalGlue(),
Button[BHtfexp]("Hint", Evaluate(function = "hintfexp"), background=Orange),
Button[BCkfexp]("Check", Evaluate(function = "checkfexp"), background=green),
TextField[MRfexp](width=6, editable=false,background=white),
Button[BShfexp]("Show", Evaluate(function = "showfexp"), background=yellow)
],
[ halign=none, border=true,
caption="Step 2: Take the derivative by differentiating the exponential functions:",
"f '(x) =",
TextField[TFdexp](width=25, background=turquoise),
HorizontalGlue(),
Button[BHtdexp]("Hint", Evaluate(function = "hintdexp"), background=Orange),
Button[BCkdexp]("Check", Evaluate(function = "checkdexp"), background=green),
TextField[MRdexp](width=6, editable=false,background=white),
Button[BShdexp]("Show", Evaluate(function = "showdexp"), background=yellow)
],
[ halign=none, border=true,
caption="Step 3: Write in terms of another hyperbolic function:",
"f '(x) =",
TextField[TFdhyp](width=25, background=turquoise),
HorizontalGlue(),
Button[BHtdhyp]("Hint", Evaluate(function = "hintdhyp"), background=Orange),
Button[BCkdhyp]("Check", Evaluate(function = "checkdhyp"), background=green),
TextField[MRdhyp](width=6, editable=false,background=white),
Button[BShdhyp]("Show", Evaluate(function = "showdhyp"), background=yellow)
],
[ TextBox[TFreply](width=60,height=2, editable=false,background=white)
],
[ halign=none, inset=0, spacing=0,
"Instructor: Philip Yasskin",
HorizontalGlue(),
"Programmers: Mikayla Barry & Chloe Dixon",
HorizontalGlue(),
"Copyright: Yasskin 2013"
]
]
),
ButtonGroup[funcgp](onchange=Evaluate(function = "ask"))
):Maplets[Display]( HypDeriv );