# Derivative of the Inverse Function # Lisa Cangelose & Sonia Bendjemil # # ################################## # # Header For All Maplets restart: with(Maplets[Elements]):with(Maplets[Tools]): StartEngine(); randomize(): lightorange:="#FFB300": lightcyan:="#DDFFFF": lightblue:="#CFCFFF": lightgreen:="#CCFFCC": darkgreen:="#00C000": ColorBkgd:=wheat: ColorDefaultMenu:=lightcyan: ColorHelpMenu:=lightorange: ColorFileMenu:=pink: ColorFooter:=lightcyan: ColorNewButton:=magenta: # or Make, Save, Enter Problem ColorReturnButton:=magenta: ColorCloseButton:=pink: # or Quit, Clear, Reset, Cancel ColorHintButton:=lightorange: # or Syntax ColorPrevButton:=turquoise: # or Update ColorEnterButton:=turquoise: ColorSimplifyButton:=lightorange: ColorCheckButton:=green: ColorShowButton:=lightorange: ColorPlotButton:=gold: ColorPlotButtonFrgd:=black: ColorPlotFrame:=gold: ColorTableBkgd:=lightgreen: ColorCalculatorBkgd:=gold: ColorBlackBox:=black: ColorBlackBoxFrgd:=yellow: ColorMessage:=white: ColorMessageFrgd:=black: ColorInput:=turquoise: ColorInputFrgd:=black: ColorCorrect:=green: ColorCorrectFrgd:=black: ColorIncorrect:=red: ColorIncorrectFrgd:=white: ColorWarning:=yellow: ColorWarningFrgd:=black: ColorShow:=lightorange: ColorShowFrgd:=black: ColorHint:=lightorange: ColorHintFrgd:=black: # or Info, Syntax ColorDisable:=wheat: ColorDisableFrgd:=black: FontFooter:=Font("helvetica",10): FontSymbol:=Font("symbol",12): FontBig:=Font("times",20): LIBLogo:=cat(libname,"/M4C/M4C.png"): Logo:="M4C.png": #LIBLogo:=cat(libname,"/M4C/WebALT_logo.png"): #Logo:="WebALT_logo.png": # ################################## # # English Translation Table For All Maplets TEXTLprogrammers:= "Programmers: D.B. Meade & P.B. Yasskin": TEXTLcopyright:= "© Copyright: Maplets for Calculus 2006-10": #"© Copyright: WebALT 2006-07": TEXTLversion:= "M4C v1.3 July 2010": TEXTBQuit:= "Quit": TEXTBClose:= "Close": TEXTBCheck:= "Check": TEXTBShow:= "Show": TEXTBShowAll:= "Show All Steps": TEXTBCheckAns:= "Check Answer": TEXTBShowAns:= "Show Answer": TEXTBInstructions:= "Instructions": TEXTBHint:= "Hint": TEXTBHints:= "Hints": TEXTBSyntax:= "Syntax": TEXTBHintSyntax:= "Hints and Syntax": TEXTBPrev:= "Preview": TEXTBUpdate:= "Update": TEXTBDerivation:= "Derivation": TEXTBNewProblem:= "New Problem": TEXTBNewFunction:= "New Function": TEXTBNewGraph:= "New Graph": TEXTBNewEquation:= "New Equation": TEXTBNewLimit:= "New Limit": TEXTBNewDerivative:= "New Derivative": TEXTBNewIntegral:= "New Integral": TEXTBNewSequence:= "New Sequence": TEXTBNewSeries:= "New Series": TEXTBNewDiffEq:= "New Differential Equation": TEXTBNewCurve:= "New Curve": TEXTBEnterProblem:= "Enter Problem": TEXTBEnterFunction:= "Enter Function": TEXTBEnterGraph:= "Enter Graph": TEXTBEnterEquation:= "Enter Equation": TEXTBEnterLimit:= "Enter Limit": TEXTBEnterDerivative:= "Enter Derivative": TEXTBEnterIntegral:= "Enter Integral": TEXTBEnterSequence:= "Enter Sequence": TEXTBEnterSeries:= "Enter Series": TEXTBEnterDiffEq:= "Enter Differential Equation": TEXTBMake:= "Modify or Make Your Own Problem": TEXTBSaveClose:= "Save Problem and Close": TEXTBAskQuestion:= "Ask Question": TEXTBNextQuestion:= "Next Question": TEXTBHowtoAnswer:= "How to Answer": TEXTBEnter:= "Enter": TEXTBOK:= "OK": TEXTBAccept:= "Accept": TEXTBReturn:= "Return": TEXTBClear:= "Clear": TEXTBClearSelections:= "Clear Selections": TEXTBClearAll:= "Clear All Steps": TEXTBReset:= "Reset": TEXTBRestart:= "Restart": TEXTBCancel:= "Cancel": TEXTBPlot:= "Plot": TEXTBPlotIt:= "Plot It": TEXTBAnimate:= "Animate": TEXTBPlay:= "Play": TEXTBPause:= "Pause": TEXTBForward:= "Forward": TEXTBReverse:= "Reverse": TEXTBStep:= "Step": TEXTBUpdatePlot:= "Update Plot": TEXTBZoomIn:= "Zoom In": TEXTBZoomOut:= "Zoom Out": TEXTBPlotSetup:= "Plot Setup": TEXTBRefresh:= "Refresh": TEXTBCalculate:= "Calculate": TEXTBSimplify:= "Simplify": TEXTBFactor:= "Factor": TEXTBExpand:= "Expand": TEXTBNormalize:= "Normalize": TEXTBCombine:= "Combine": TEXTBRationalize:= "Rationalize": TEXTBSort:= "Sort": TEXTBDecimal:= "Decimal": TEXTBExact:= "Exact": TEXTCorrect:= " correct ": TEXTIncorrect:= "incorrect": TEXTAlmost:= " almost ": TEXTWarning:= " warning ": TEXTShown:= " shown ": TEXTSlower:= "Slower": TEXTFaster:= "Faster": TEXTEnterFormula:= " Enter Formula:": TEXTEvaluate:= " Evaluate:": TEXTApproximate:= " Approximate:": TEXTand:= " and ": TEXTor:= " or ": TEXTThus:= " Thus ": TEXTSo:= " So ": TEXTType:= " Type ": TEXTfor:= " for ": TEXTat:= " at ": TEXTorcheck:= " or check: ": TEXTvertical:= "vertical": TEXThorizontal:= "horizontal": TEXTleft:= "left": TEXTright:= "right": TEXTless:= "less": TEXTgreater:= "greater": TEXTCBDNE:= "does not exist": TEXTCBNone:= "None": TEXTCB11scaling:= "1-1 scaling": TEXTdefault:= " default ": TEXTCBDoNotShow:= "Do not show this window again.": TEXTRBNumeric:= "Numeric": TEXTRBSymbolic:= "Symbolic": TEXTRBTrue:= "True": TEXTRBFalse:= "False": TEXTRBT:= "T": TEXTRBF:= "F": TEXTRBOn:= "On": TEXTRBOff:= "Off": TEXTRed:= "Red": TEXTGreen:= "Green": TEXTBlue:= "Blue": TEXTCyan:= "Cyan": TEXTMagenta:= "Magenta": TEXTYellow:= "Yellow": TEXTRedR:= "R": TEXTGreenG:= "G": TEXTBlueB:= "B": TEXTRBPlot1:= "Plot # 1": TEXTRBPlot2:= "Plot # 2": TEXTRBPlot3:= "Plot # 3": TEXTRBPlot4:= "Plot # 4": TEXTRBPlot5:= "Plot # 5": TEXTRBPlot6:= "Plot # 6": TEXTRBconverge:= "converge": TEXTRBdiverge:= "diverge": TEXTRBconverges:= "converges": TEXTRBdiverges:= "diverges": TEXTRBdiverges2:= "diverges ": TEXTRBconvergent:= "Convergent": TEXTRBdivergent:= "Divergent": TEXTtitlePROBLEM:= "Modify or Make Your Own Problem": TEXTtitlePREVIEW:= "Preview": TEXTtitleHINT:= "Hint": TEXTtitleSYNTAX:= "Syntax": TEXTtitlePlotSetup:= "Plot Setup": TEXTCapGoal:= "Goal:": TEXTCapProbStat:= "Problem Statement:": TEXTCapSyntaxTutorial:= "Syntax Tutorial:": TEXTCapEnter:= "Enter:": TEXTCapSpecify:= "Specify:": TEXTCapTrueFalse:= "True or False?": TEXTCapCalculator:= "Calculator": TEXTCapPlot:= "Plot": TEXTCapLegend:= "Legend": TEXTCapEvaluate:= "Evaluate:": TEXTCapDataTable:= "Data Table": TEXTCapVis:= "Visualization": TEXTCapAnim:= "Animation": TEXTCapPreviewer:= "Previewer": TEXTCapHorRng:= "Horizontal Range:": TEXTxmin:= "xmin =": TEXTxmax:= "xmax =": TEXTCapVertRng:= "Vertical Range:": TEXTymin:= "ymin =": TEXTymax:= "ymax =": TEXTPlotWait:= #Use ColorHint " Please be patient while the plot is generated.": TEXTAnimWait:= " Please be patient while the animation is generated.": TEXTRotatePlot:= " You may rotate the plot with your mouse.": TEXTreplyNoCheck:= " You must enter an expression to be checked.": TEXTreplyNoCheckBoth:= " You must answer both questions before checking.": TEXTreplyNoChecks:= " You must answer all %a questions before checking.": TEXTreplyNoPrev:= " You must enter an expression to be previewed.": TEXTreplyNoSimplify:= " You must enter an expression to be simplified.": TEXTreplyNoFactor:= " You must enter an expression to be factored.": TEXTreplyNoExpand:= " You must enter an expression to be expanded.": TEXTreplyNoNormalize:= " You must enter an expression to be normalized.": TEXTreplyNoModify:= " You must enter an expression to be modified.": TEXTreplyNoPlot:= " Please select a plot.": TEXTreplyNoSelection:= " Please select an answer.": TEXTreplyNoSaveProblem:= " You must fill in all the boxes before saving the problem.": TEXTreplyNoSaveSettings:= " You must fill in all the boxes before saving the settings.": TEXTreplyNoSlider:= " Set the slider to a number between %a and %a": TEXTreplySideEqWrong:= " The %a side of your equation is wrong.": TEXTreplyBothSideEqWrong:= " Both sides of your equation are wrong.": TEXTreplySideIneqWrong:= " The %a side of your inequality is wrong.": TEXTreplyBothSideIneqWrong:= " Both sides of your inequality are wrong.": TEXTreplyNoConst:= " You forgot to add a constant of integration.": TEXTreplyManyConst:= " Your answer should have only one constant of integration.": TEXTreplyMinusErr:= " You have a minus sign error.": DNEset:= {"", undefined, Undefined, UNDEFINED, divergent, Divergent, DIVERGENT, diverges, Diverges, DIVERGES, dne, DNE, doesnotexist, DoesNotExist}: TEXTM_File:= "File": TEXTM_Fns:= "Functions": TEXTCBMI_polygen:= "Polynomials (Generalized)": TEXTCBMI_exp:= "Exponentials": TEXTCBMI_log:= "Logarithms": TEXTCBMI_trig:= "Trigonometric": TEXTCBMI_invtrig:= "Inverse Trigonometric": TEXTCBMI_hyper:= "Hyperbolic": TEXTCBMI_invhyper:= "Inverse Hyperbolic": TEXTCBMI_simpsubst:= "Allow Simple Substitutions": TEXTM_Rules:= "Rules": TEXTCBMI_prod:= "Product Rule": TEXTCBMI_quot:= "Quotient Rule": TEXTCBMI_power:= "Power Rule": TEXTCBMI_chain:= "Chain Rule": TEXTM_Methods:= "Methods": TEXTCBMI_subst:= "Substitution": TEXTCBMI_parts:= "Integration by Parts": TEXTCBMI_trigpow:= "Trigonometric Powers": TEXTCBMI_trigsubst:= "Trigonometric Substitution": TEXTCBMI_trigident:= "Trigonometric Identity": TEXTCBMI_parfrac:= "Partial Fractions": TEXTCBMI_impfrac:= "Improper Fraction": TEXTRBproper:= "only proper integrals": TEXTRBimproper:= "allow improper integrals": TEXTM_RulesProb:= "Rules per Problem": TEXTreply_manyrules:= " Problems which involve too many rules tend to become rather messy.": TEXTM_MaxTerms:= "Max # Terms": TEXTreply_manyterms:= " Problems with large numbers of terms tend to become rather messy.": TEXTM_TermsPoly:= "Terms in Polynomial": TEXTM_PowerProp:= "Power Properties": TEXTCBMI_neg:= "Allow Negatives": TEXTCBMI_frac:= "Allow Fractions": TEXTreply_largepower:= " Problems with large degree polynomials tend to become rather messy.": TEXTM_Help:= "Help": TEXTmenu_start:= "Getting Started": TEXTmenu_custom:= "Customized Problems": TEXTmenu_manip:= "Manipulating Functions": TEXTmenu_about:= "About this maplet": great:=[ " Bullseye.", " Right on the mark.", " Great.", " That's absolutely right.", " Awesome. You're unstoppable.", " Correct.", " WOW, nailed that one.", " You got it!", " YES! Right on.", " Way to go.", " Don't stop now.", " I knew you could do it!", " Perfect. You're unstoppable.", " Radical Dude.", " Power house.", " Sweet! Keep on Rockin'.", " You rock!", " You got those mad skills.", " Awesome!", " Wowzers! That was great!", " Awesome man!", " Good job! You really know what you are doing.", " You're awesome kid.", " Tearing it up.", " Right on the money.", " High Five!!!!!", " Cool Beans.", " What a nerd!", " You're so money.", " You're a genius.", " You hit the nail on the head.", " Excellent!", " If I had a cookie, I'd give it to you.", " You're a winner.", " That's a winner.", " Whoop! Way to go.", " That's the way, ah ha ah ha, I like it.", " Oh yeah!", " You're the bomb!", " That was fantastic!", " Oh Snap!", NULL ]: nextgeneric:=[ " Keep it up.", " Keep going.", NULL ]: nextprob:=[ " On to the next problem.", " Try another problem.", " You're ready for another problem.", NULL ]: nextquest:=[ " On to the next question.", " Try another question.", " You're ready for another question.", NULL ]: nextpart:=[ " On to the next part.", " Try another part.", " You're ready for another part.", NULL ]: nextstep:=[ " On to the next step.", " Try another step.", " You're ready for another step.", NULL ]: nexteq:=[ " On to the next equation.", " Try another equation.", " Solve another equation.", " You're ready for another equation.", NULL ]: nextfn:=[ " On to the next function.", " Try another function.", " You're ready for another function.", NULL ]: nextlim:=[ " On to the next limit.", " Try another limit.", " Compute another limit.", " You're ready for another limit.", " Find another limit.", NULL ]: nextderiv:=[ " On to the next derivative.", " Try another derivative.", " Compute another derivative.", " You're ready for another derivative.", " Differentiate another function.", NULL ]: nextinteg:=[ " On to the next integral.", " Try another integral.", " Compute another integral.", " You're ready for another integral.", " Integrate another function.", NULL ]: nextdiffeq:=[ " On to the next differential equation.", " Try another differential equation.", " You're ready for another differential equation.", " Analyze another differential equation.", NULL ]: nextseq:=[ " On to the next sequence.", " Try another sequence.", " Find the limit of another sequence.", " You're ready for another sequence.", NULL ]: nextser:=[ " On to the next series.", " Try another series.", " Sum another series.", " You're ready for another series.", NULL ]: almost:=[ " Close.", " Oh so close.", " Close call. ", " Near miss.", " Not quite good enough for government work.", " Ooooh...close.", " Yikes! Really close. You'll get it next time.", " Close, but no cigar.", " Slightly off.", " Off by a hair.", " Almost there.", " Almost got it.", NULL ]: sorry:=[ " Sorry, that's not right.", " Nope, but don't give up.", " Not quite, it's a little off.", " Bummer, thought you would get it this time.", " If you need help, please ask a human.", " I don't know where you went wrong.", " Sorry, killer problem.", " No, but don't blow it off.", " D'oh!", " That's whack.", " Thought you would get it this time.", " Nice try, but your answer is wrong.", " Ask your neighbor for help.", " Brutal kid.", " That won't fly.", " So close and yet so far.", " So, that was just practice.", " A swing and a miss.", " Better luck next time.", " Oops.", " Tilt. Play again.", " I know you can do better.", " Sorry Charlie.", " Tisk, tisk. It's a tough one.", " It takes a lot of wrongs to make a right.", " Even Einstein didn't get everything right.", " Today's not your lucky day.", " Don't quit your day job.", " You're colder than a polar bear's toenail.", op(almost), NULL ]: trygeneric:=[ " Fix your answer and check it again.", " Give it another try.", " Try again.", " Please try again.", NULL ]: tryhint:=[ " Try the hints and answer again.", " Read the hints and try again.", " Study the hints and answer again.", NULL ]: tryhelp:=[ " Try the Help menu and answer again.", " Look at the Help menu and try again.", NULL ]: showgeneric:=[ " OK That's just practice. But try doing it yourself.", " That's fine for practice. Try doing it yourself.", " Think about it and enter an answer yourself.", " Next time, compute an answer yourself.", " So that was practice. Try doing it yourself.", NULL ]: showhint:=[ " Next time, try the hints.", " Read the hints and enter an answer yourself.", NULL ]: showhelp:=[ " Next time, read the Help menu.", " Read the Help and enter an answer yourself.", NULL ]: # ################################## # Procs for all maplets. GetVersion:=proc() local S, S1, S3, S4; options `Copyright 2009-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; uses StringTools; S:=interface(version); S:=map( Trim, Split( S, "," ) ); S1:=Split(S[1], " " ); S3:=Split(S[3], " " ); S4:=Split(S[-1], " " ); sprintf("%s (%s)", S[2],S3[-1]); end proc: # ################################## # # Customize For Each Maplets with(plots):with(plottools): with(RandomTools): alias(e=exp(1)): nextlocal:=[ NULL ]: trylocal:=[ NULL ]: showlocal:=[ NULL ]: nexts1:=[ #Keep what is appropriate. This is for all but the last check. op(nextgeneric), #op(nextprob), op(nextquest), #op(nextpart), op(nextstep), #op(nextlocal), NULL ]: nexts2:=[ #Keep what is appropriate. This is for the last check. op(nextgeneric), op(nextprob), #op(nextquest), #op(nexteq), op(nextfn), #op(nextlim), op(nextderiv), #op(nextinteg), #op(nextdiffeq), #op(nextseq), #op(nextser), #op(nextlocal), NULL ]: trys:=[ #Keep what is appropriate. op(trygeneric), op(tryhint), #op(tryhelp), #op(trylocal), NULL ]: shows:=[ #Keep what is appropriate. op(showgeneric), op(showhint), #op(showhelp), #op(showlocal), NULL ]: randgreat:=rand(1..nops(great)): randnext1:=rand(1..nops(nexts1)): randnext2:=rand(1..nops(nexts2)): randalmost:=rand(1..nops(almost)): randsorry:=rand(1..nops(sorry)): randtry:=rand(1..nops(trys)): randshow:=rand(1..nops(shows)): # ################################## # # English Translation Table For Deriv of Inverse Function TEXTLasstprogrammer:= "Assistant Programmers: Lisa Cangelose & Sonia Bendjemil": TEXTtitleMAIN:= "Derivatives of Inverse Functions": TEXTcapDefInv:= "Definition: Let g(x) be the inverse function of f(x) where:": TEXTLGoal:= "Compute g '(a), the derivative of g, at a =": TEXTcap1:= "Step 1 - Find b where g(a) = b and f(b) = a.": TEXTcap2:= "Step 2 - Find f '(x) and f '(b).": TEXTcap3:= "Step 3 - Find g '(a)": TEXTBPlotf:= "Plot f(x)": TEXTBPlotg:= "Plot g(x)": TEXTBPlota:= "Plot ( a, g(a) )": TEXTBPlotb:= "Plot ( b, f(b) )": TEXTBPlottan:= "Plot tangent": TEXTLftan:= "to f(x) at b": TEXTLgtan:= "to g(x) at a": TEXTBUnplotf:= "Unplot f(x)": TEXTBUnplotg:= "Unplot g(x)": TEXTBUnplota:= "Unplot ( a, g(a) )": TEXTBUnplotb:= "Unplot ( b, f(b) )": TEXTBUnplottan:= "Unplot tangent": TEXTblue:= " blue": TEXTblack:= " black": TEXTred:= " red": TEXTbrown:= " brown": TEXTtantof:= "tangent to f(x)": TEXTtantog:= "tangent to g(x)": TEXTsyntaxexp:= " Enter the exponential function as exp(x) or e^x.": TEXTsyntaxtrig:= " Enter angles in radians as multiples of Pi.": TEXTsyntaxinvtrig:= " Type arcsin for the inverse of sin.\n Type arccos for the inverse of cos.": TEXTreplyH:= " Since f(g(x)) = x, the chain rule says: f'(g(x)) g'(x) = 1\nConsequently, g'(x) = 1/f'(g(x)) or g'(a) = 1/f'(g(a)).": TEXTreplyHa:= " Since f(g(x)) = x, the chain rule says: f'(g(x)) g'(x) = 1\n Consequently, g'(a) = 1/f'(g(a))\n or g'( %a ) = 1/f'(g( %a )).": TEXTreplyHb:= " Solve the equation: f(b) = a or %a.": TEXTreplyHfp:= " Simply differentiate f(x).": TEXTreplyHfpb:= " Substitute x = b = %a into f '(x).": TEXTreplyHgpa:= " Since f(g(x)) = x, the chain rule says: f'(g(x)) g'(x) = 1\nConsequently, g'(a) = 1/f'(b) or g'( %a ) = 1/f'( %a ).": # ################################## rand1:=rand(1..3): rand2:=rand(2..3): funcs:=[n2*x, x/n2, x^3/n1^3, n1*x^(1/3), n1*sqrt(x), n1/sqrt(x), sqrt(x)/n1, n1*e^x, e^x/n1, e^(n1*x), e^(x/n1), ln(x/n1), ln(n1*x), ln(x)/n1, n1*ln(x), n1*sin(x), n1*cos(x)]; randfunc:=rand(1..nops(funcs)): A[1]:=[n2, 2*n2, 3*n2, 4*n2, 1, 1/2, 2]: B[1]:=[1, 2, 3, 4, 1/n2, 1/(2*n2), 2/n2]: minis[1]:=[-5, -3*n2, -4*n2, -5*n2, -2, -1, -2.5]: maxis[1]:=[5, 3*n2, 4*n2, 5*n2, 2, 1, 2.5]: A[2]:=[1, 2, 3, 4, 1/n2, 1/(2*n2), 2/n2]: B[2]:=[n2, 2*n2, 3*n2, 4*n2, 1, 1/2, 2]: minis[2]:=[-5, -3*n2, -4*n2, -5*n2, -2, -1, -2.5]: maxis[2]:=[5, 3*n2, 4*n2, 5*n2, 2, 1, 2.5]: A[3]:=[1, 8, 27, 1/n1^3, 8/n1^3, 27/n1^3]: B[3]:=[n1, 2*n1, 3*n1, 1, 2, 3]: minis[3]:=[-5, -10, -35, -2, -10/n1, -35/n1^2]: maxis[3]:=[5, 10, 35, 2, 10/n1, 35/n1^2]: A[4]:=[n1, 2*n1, 3*n1, 1, 2, 3]: B[4]:=[1, 8, 27, 1/n1^3, 8/n1^3, 27/n1^3]: minis[4]:=[-5, -10, -35, -2, -10/n1, -35/n1^2]: maxis[4]:=[5, 10, 35, 2, 10/n1, 35/n1^2]: A[5]:=[2*n1, 3*n1, 4*n1, 5*n1, 6*n1, n1/2, n1/3, 1, 2, 3]: B[5]:=[4, 9, 16, 25, 36, 1/4, 1/9, 1/n1^2, 4/n1^2, 9/n1^2]: minis[5]:=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]: maxis[5]:=[6, 12, 20, 30, 40, 2, 2, 2, 5, 12/n1]: A[6]:=[n1/2, n1/3, n1/4, n1/5, n1/6, 2*n1, 3*n1, 1, 2, 3]: B[6]:=[4, 9, 16, 25, 36, 1/4, 1/9, n1^2, n1^2/4, n1^2/9]: minis[6]:=[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]: maxis[6]:=[6, 12, 20, 30, 40, 3*n1, 4*n1, 1.5*n1^2, 3, 4]: A[7]:=[2/n1, 3/n1, 4/n1, 5/n1, 6/n1, 1, 2, 1/2, 1/3]: B[7]:=[4, 9, 16, 25, 36, n1^2, 4*n1^2, n1^2/4, n1^2/9]: minis[7]:=[0, 0, 0, 0, 0, 0, 0, 0, 0]: maxis[7]:=[5, 12, 20, 30, 40, 1.5*n1^2, 5*n1^2, n1^2/2, .75+.25*n1]: A[8]:=[n1, n1*e, n1/e, n1*e^2, 2*n1, 3*n1, 4*n1]: B[8]:=[0, 1, -1, 2, ln(2), ln(3), ln(4)]: minis[8]:=[-2, -2, -2, -2, -2, -2, -2]: maxis[8]:=[1.5*n1, 4*n1, 1, 12*n1, 3*n1, 4*n1, 5*n1]: A[9]:=[1/n1, e/n1, 1/(e*n1), e^2/n1, 2/n1, 3/n1, 6/n1]: B[9]:=[0, 1, -1, 2, ln(2), ln(3), ln(6)]: minis[9]:=[-2, -2, -2, -2, -2, -2, -2]: maxis[9]:=[2, 4/n1, 1, 12/n1, 3/n1, 4/n1, 8/n1]: A[10]:=[1, e^n1, 1/e^n1, e^(2*n1), e, e^2, 2]: B[10]:=[0, 1, -1, 2, 1/n1, 2/n1, ln(2)/n1]: minis[10]:=[-2, -2, -2, -2, -2, -2, -2]: maxis[10]:=[2, 3^n1, 1, 3^(2*n1), 5, 12, 3]: A[11]:=[1, e^(1/n1), 1/e^(1/n1), e^(2/n1), e, e^2, 2]: B[11]:=[0, 1, -1, 2, n1, 2*n1, n1*ln(2)]: minis[11]:=[-2, -2, -2, -2, -2, -2, -2]: maxis[11]:=[2, 3^(1/n1), 1, 3^(2/n1), 5, 12, 3]: A[12]:=[0, 1, -1, 2, ln(2), ln(3), ln(4)]: B[12]:=[n1, n1*e, n1/e, n1*e^2, 2*n1, 3*n1, 4*n1]: minis[12]:=[-2, -2, -2, -2, -2, -2, -2]: maxis[12]:=[1.5*n1, 4*n1, 1, 12*n1, 3*n1, 4*n1, 5*n1]: A[13]:=[0, 1, -1, 2, ln(2), ln(3), ln(6)]: B[13]:=[1/n1, e/n1, 1/(e*n1), e^2/n1, 2/n1, 3/n1, 6/n1]: minis[13]:=[-2, -2, -2, -2, -2, -2, -2]: maxis[13]:=[2, 4/n1, 1, 12/n1, 3/n1, 4/n1, 8/n1]: A[14]:=[0, 1, -1, 2, 1/n1, 2/n1, ln(2)/n1]: B[14]:=[1, e^n1, 1/e^n1, e^(2*n1), e, e^2, 2]: minis[14]:=[-2, -2, -2, -2, -2, -2, -2]: maxis[14]:=[2, 3^n1, 1, 3^(2*n1), 5, 12, 3]: A[15]:=[0, 1, -1, 2, n1, 2*n1, n1*ln(2)]: B[15]:=[1, e^(1/n1), 1/e^(1/n1), e^(2/n1), e, e^2, 2]: minis[15]:=[-2, -2, -2, -2, -2, -2, -2]: maxis[15]:=[2, 3^(1/n1), 1, 3^(2/n1), 5, 12, 3]: expfunc:=[8,9,10,11,12,13,14,15]: A[16]:=[n1/2, n1*sqrt(2)/2, n1*sqrt(3)/2, -n1/2, -n1*sqrt(2)/2, -n1*sqrt(3)/2]: sinfunc:=16: B[16]:=[Pi/6, Pi/4, Pi/3, -Pi/6, -Pi/4, -Pi/3]: minis[16]:=[-Pi, -Pi, -Pi, -Pi, -Pi, -Pi]: maxis[16]:=[Pi, Pi, Pi, Pi, Pi, Pi]: A[17]:=[n1*sqrt(3)/2, n1*sqrt(2)/2, n1/2, -n1*sqrt(3)/2, -n1*sqrt(2)/2, -n1/2]: cosfunc:=17: B[17]:=[Pi/6, Pi/4, Pi/3, 5*Pi/6, 3*Pi/4, 2*Pi/3]: minis[17]:=[-Pi, -Pi, -Pi, -Pi, -Pi, -Pi]: maxis[17]:=[Pi, Pi, Pi, Pi, Pi, Pi]: for i from 1 to 17 do randpoint[i]:=rand(1..nops(A[i])); end do: As:=[a,b,c,p,q,r,s,t,u,v,w,z]: Bs[1]:=map(x->x/n2,As): Bs[2]:=map(x->n2*x,As): Bs[3]:=map(x->n1*x^(1/3),As): Bs[4]:=map(x->x^3/n1^3,As): Bs[5]:=map(x->x^2/n1^2,As): Bs[6]:=map(x->n1^2/x^2,As): Bs[7]:=map(x->n1^2*x^2,As): Bs[8]:=map(x->ln(x/n1),As): Bs[9]:=map(x->ln(n1*x),As): Bs[10]:=map(x->ln(x)/n1,As): Bs[11]:=map(x->n1*ln(x),As): Bs[12]:=map(x->n1*e^x,As): Bs[13]:=map(x->e^x/n1,As): Bs[14]:=map(x->e^(n1*x),As): Bs[15]:=map(x->e^(x/n1),As): Bs[16]:=map(x->arcsin(x/n1),As): Bs[17]:=map(x->arccos(x/n1),As): randpoints:=rand(1..12): New_Function:=proc() global n1, rand1, n2, rand2, randfunc, whichfunc, funcs, f, randpoint, randpoints, whichpoint, A, B, As, Bs, pta, ptb, fp, fpb, gpa, p0, pf, pg, pa, pb, pftan, pgtan, unpf, unpg, unpa, unpb, unpftan, unpgtan, maxi, mini, numerical, bOK, fpOK; local p1; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; n1:=rand1(); n2:=rand2(); whichfunc:=randfunc(); f:=funcs[whichfunc]; numerical:=Get(RB1); if numerical then whichpoint:=randpoint[whichfunc](); pta:=A[whichfunc][whichpoint]; ptb:=B[whichfunc][whichpoint]; mini:=minis[whichfunc][whichpoint]; maxi:=maxis[whichfunc][whichpoint]; else whichpoint:=randpoints(); pta:=As[whichpoint]; ptb:=Bs[whichfunc][whichpoint]; mini:=-Pi; maxi:=Pi; end if; fp:=convert(diff(f,x),radical); fpb:=simplify(eval(fp, x=ptb)); gpa:=simplify(1/fpb); Set(fMML(value)=MathML[Export]('f'(x)=f)): Set(TFa=pta): bOK:=false; fpOK:=false; Set(BHinta(enabled)=true, BHinta(background)=ColorHintButton); Set(TFb="", TFb(enabled)=true, TFb(background)=ColorInput): Set(BHintb(enabled)=true, BHintb(background)=ColorHintButton); Set(Bbck(enabled)=true, Bbck(background)=ColorCheckButton); Set(TFbck="", TFbck(background)=ColorMessage, TFbck(foreground)=ColorMessageFrgd): Set(Bbsh(enabled)=true, Bbsh(background)=ColorShowButton); Set(TFfp="", TFfp(enabled)=true, TFfp(background)=ColorInput): Set(BHintfp(enabled)=true, BHintfp(background)=ColorHintButton); Set(Bfpck(enabled)=true, Bfpck(background)=ColorCheckButton); Set(TFfpck="", TFfpck(background)=ColorMessage, TFfpck(foreground)=ColorMessageFrgd): Set(Bfpsh(enabled)=true, Bfpsh(background)=ColorShowButton); Set(TFfpb="", TFfpb(enabled)=false, TFfpb(background)=ColorDisable): Set(BHintfpb(enabled)=false, BHintfpb(background)=ColorDisable); Set(Bfpbck(enabled)=false, Bfpbck(background)=ColorDisable); Set(TFfpbck="", TFfpbck(background)=ColorMessage, TFfpbck(foreground)=ColorMessageFrgd): Set(Bfpbsh(enabled)=false, Bfpbsh(background)=ColorDisable); Set(TFgpa="", TFgpa(enabled)=false, TFgpa(background)=ColorDisable): Set(BHintgpa(enabled)=false, BHintgpa(background)=ColorDisable); Set(Bgpack(enabled)=false, Bgpack(background)=ColorDisable); Set(TFgpack="", TFgpack(background)=ColorMessage, TFgpack(foreground)=ColorMessageFrgd): Set(Bgpash(enabled)=false, Bgpash(background)=ColorDisable); Set(reply="", reply(background)=ColorMessage, reply(foreground)=ColorMessageFrgd): if whichfunc in expfunc then Set(reply=TEXTsyntaxexp, reply(background)=ColorHint, reply(foreground)=ColorHintFrgd) end if; if whichfunc in [sinfunc,cosfunc] then Set(reply=`if`(numerical,TEXTsyntaxtrig,TEXTsyntaxinvtrig), reply(background)=ColorHint, reply(foreground)=ColorHintFrgd) end if; if numerical then Set(Plotf(enabled)=true, Plotf(background)=ColorPlotButton); Set(Plotg(enabled)=true, Plotg(background)=ColorPlotButton); Set(Plota(enabled)=true, Plota(background)=ColorPlotButton); Set(Plotb(enabled)=true, Plotb(background)=ColorPlotButton); Set(Plotftan(enabled)=true, Plotftan(background)=ColorPlotButton); Set(Lftan(enabled)=true, Lftan(background)=ColorPlotButton); Set(Plotgtan(enabled)=true, Plotgtan(background)=ColorPlotButton); Set(Lgtan(enabled)=true, Lgtan(background)=ColorPlotButton); else Set(Plotf(enabled)=true, Plotf(background)=ColorPlotButton); Set(Plotg(enabled)=true, Plotg(background)=ColorPlotButton); Set(Plota(enabled)=false, Plota(background)=ColorDisable); Set(Plotb(enabled)=false, Plotb(background)=ColorDisable); Set(Plotftan(enabled)=false, Plotftan(background)=ColorDisable); Set(Lftan(enabled)=false, Lftan(background)=ColorDisable); Set(Plotgtan(enabled)=false, Plotgtan(background)=ColorDisable); Set(Lgtan(enabled)=false, Lgtan(background)=ColorDisable); end if; Set(Plotf(caption)=TEXTBPlotf); Set(Plotg(caption)=TEXTBPlotg); Set(Plota(caption)=TEXTBPlota); Set(Plotb(caption)=TEXTBPlotb); Set(Plotftan(caption)=TEXTBPlottan); Set(Plotgtan(caption)=TEXTBPlottan); unpf:=false; unpg:=false; unpa:=false; unpb:=false; unpftan:=false; unpgtan:=false; p0:=plot(x, x=mini..maxi, y=mini..maxi, linestyle=DASH, color=black); pf:=p0; pg:=p0; pa:=p0; pb:=p0; pftan:=p0; pgtan:=p0; Set(myplot=display([p0, pf, pg, pa, pb, pftan, pgtan], scaling=constrained)); end proc: Plot_f:=proc() global whichfunc, sinfunc, cosfunc, p0, pf, pg, pa, pb, pftan, pgtan, pta, ptb, mini, maxi, unpf; local newmin, newmax; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if unpf then pf:=p0; Set(Plotf(caption)=TEXTBPlotf); unpf:=false; else newmin:=piecewise(whichfunc=cosfunc, 0, whichfunc=sinfunc, -Pi/2, mini); newmax:=piecewise(whichfunc=sinfunc, Pi/2, maxi); pf:=plot([x, convert(f,surd), x=newmin..newmax], x=mini..maxi, y=mini..maxi, color=blue, thickness=2); Set(Plotf(caption)=TEXTBUnplotf); unpf:=true; end if; Set(myplot=display([p0, pf, pg, pa, pb, pftan, pgtan], scaling=constrained)); end proc: Plot_g:=proc() global whichfunc, sinfunc, cosfunc, p0, pf, pg, pa, pb, pftan, pgtan, pta, ptb, mini, maxi, unpg; local newmin, newmax; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if unpg then pg:=p0; Set(Plotg(caption)=TEXTBPlotg); unpg:=false; else newmin:=piecewise(whichfunc=cosfunc, 0, whichfunc=sinfunc, -Pi/2, mini); newmax:=piecewise(whichfunc=sinfunc, Pi/2, maxi); pg:=plot([convert(f,surd), x, x=newmin..newmax], x=mini..maxi, y=mini..maxi, color=red, thickness=2); Set(Plotg(caption)=TEXTBUnplotg); unpg:=true; end if; Set(myplot=display([p0, pf, pg, pa, pb, pftan, pgtan], scaling=constrained)); end proc: Plot_a:=proc() global p0, pf, pg, pa, pb, pftan, pgtan, pta, ptb, mini, maxi, unpa; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if unpa then pa:=p0; Set(Plota(caption)=TEXTBPlota); unpa:=false; else pa:=disk([pta, ptb], (maxi-mini)/60, color=red); Set(Plota(caption)=TEXTBUnplota); unpa:=true; end if; Set(myplot=display([p0, pf, pg, pa, pb, pftan, pgtan], scaling=constrained)); end proc: Plot_b:=proc() global p0, pf, pg, pa, pb, pftan, pgtan, pta, ptb, mini, maxi, unpb; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if unpb then pb:=p0; Set(Plotb(caption)=TEXTBPlotb); unpb:=false; else pb:=disk([ptb, pta], (maxi-mini)/60, color=blue); Set(Plotb(caption)=TEXTBUnplotb); unpb:=true; end if; Set(myplot=display([p0, pf, pg, pa, pb, pftan, pgtan], scaling=constrained)); end proc: Plot_ftan:=proc() global p0, pf, pg, pa, pb, pftan, pgtan, pta, ptb, mini, maxi, fpb, unpftan; local ftan; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if unpftan then pftan:=p0; Set(Plotftan(caption)=TEXTBPlottan); unpftan:=false; else ftan:=pta+fpb*(x-ptb); pftan:=plot(ftan, x=mini..maxi, y=mini..maxi, color=black); Set(Plotftan(caption)=TEXTBUnplottan); unpftan:=true; end if; Set(myplot=display([p0, pf, pg, pa, pb, pftan, pgtan], scaling=constrained)); end proc: Plot_gtan:=proc() global p0, pf, pg, pa, pb, pftan, pgtan, pta, ptb, mini, maxi, gpa, unpgtan; local gtan; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if unpgtan then pgtan:=p0; Set(Plotgtan(caption)=TEXTBPlottan); unpgtan:=false; else gtan:=ptb+gpa*(x-pta); pgtan:=plot(gtan, x=mini..maxi, y=mini..maxi, color=brown); Set(Plotgtan(caption)=TEXTBUnplottan); unpgtan:=true; end if; Set(myplot=display([p0, pf, pg, pa, pb, pftan, pgtan], scaling=constrained)); end proc: Hint:=proc() global pta; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(reply=TEXTreplyH, reply(background)=ColorHint, reply(foreground)=ColorHintFrgd): end proc: Hint_a:=proc() global f, pta; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(reply=sprintf(TEXTreplyHa, pta, pta), reply(background)=ColorHint, reply(foreground)=ColorHintFrgd): end proc: Hint_b:=proc() global f, pta; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(reply=sprintf(TEXTreplyHb, eval(f,x=b)=pta), reply(background)=ColorHint, reply(foreground)=ColorHintFrgd): end proc: Check_b:=proc() global ptb, f, pta, bOK, fpOK; local user_b; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if Get(TFb)="" then Set(reply=TEXTreplyNoCheck, reply(background)=ColorHint, reply(foreground)=ColorHintFrgd); return; end if; user_b:=Get(TFb::algebraic, corrections=true, update=true): if simplify(normal(ptb - user_b))=0 then Set(TFbck=TEXTCorrect, TFbck(background)=ColorCorrect, TFbck(foreground)=ColorCorrectFrgd): Set(reply=cat(great[randgreat()],nexts1[randnext1()]), reply(background)=ColorCorrect, reply(foreground)=ColorCorrectFrgd): bOK:=true; if fpOK then Set(TFfpb(enabled)=true, TFfpb(background)=ColorInput): Set(BHintfpb(enabled)=true, BHintfpb(background)=ColorHintButton); Set(Bfpbck(enabled)=true, Bfpbck(background)=ColorCheckButton); Set(Bfpbsh(enabled)=true, Bfpbsh(background)=ColorShowButton); end if; else Set(TFbck=TEXTIncorrect, TFbck(background)=ColorIncorrect, TFbck(foreground)=ColorIncorrectFrgd): Set(reply=cat(sorry[randsorry()], sprintf(TEXTreplyHb, subs(x=b,f)=pta)), reply(background)=ColorIncorrect, reply(foreground)=ColorIncorrectFrgd): end if; end proc: Show_b:=proc() global ptb, bOK, fpOK; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(TFb=ptb): Set(TFbck=TEXTShown, TFbck(background)=ColorShow, TFbck(foreground)=ColorShowFrgd): Set(reply=shows[randshow()], reply(background)=ColorShow, reply(foreground)=ColorShowFrgd): bOK:=true; if fpOK then Set(TFfpb(enabled)=true, TFfpb(background)=ColorInput): Set(BHintfpb(enabled)=true, BHintfpb(background)=ColorHintButton); Set(Bfpbck(enabled)=true, Bfpbck(background)=ColorCheckButton); Set(Bfpbsh(enabled)=true, Bfpbsh(background)=ColorShowButton); end if; end proc: Hint_fp:=proc() options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(reply=TEXTreplyHfp, reply(background)=ColorHint, reply(foreground)=ColorHintFrgd): end proc: Check_fp:=proc() global fp, x, bOK, fpOK; local user_fp; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if Get(TFfp)="" then Set(reply=TEXTreplyNoCheck, reply(background)=ColorHint, reply(foreground)=ColorHintFrgd); return; end if; user_fp:=Get(TFfp::algebraic, corrections=true, update=true): if simplify(normal(fp - user_fp))=0 then Set(TFfpck=TEXTCorrect, TFfpck(background)=ColorCorrect, TFfpck(foreground)=ColorCorrectFrgd): Set(reply=cat(great[randgreat()],nexts1[randnext1()]), reply(background)=ColorCorrect, reply(foreground)=ColorCorrectFrgd): fpOK:=true; if bOK then Set(TFfpb(enabled)=true, TFfpb(background)=ColorInput): Set(BHintfpb(enabled)=true, BHintfpb(background)=ColorHintButton); Set(Bfpbck(enabled)=true, Bfpbck(background)=ColorCheckButton); Set(Bfpbsh(enabled)=true, Bfpbsh(background)=ColorShowButton); end if; else Set(TFfpck=TEXTIncorrect, TFfpck(background)=ColorIncorrect, TFfpck(foreground)=ColorIncorrectFrgd): Set(reply=cat(sorry[randsorry()], TEXTreplyHfp), reply(background)=ColorIncorrect, reply(foreground)=ColorIncorrectFrgd): end if; end proc: Show_fp:=proc() global fp, x, bOK, fpOK; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(TFfp=fp): Set(TFfpck=TEXTShown, TFfpck(background)=ColorShow, TFfpck(foreground)=ColorShowFrgd): Set(reply=shows[randshow()], reply(background)=ColorShow, reply(foreground)=ColorShowFrgd): fpOK:=true; if bOK then Set(TFfpb(enabled)=true, TFfpb(background)=ColorInput): Set(BHintfpb(enabled)=true, BHintfpb(background)=ColorHintButton); Set(Bfpbck(enabled)=true, Bfpbck(background)=ColorCheckButton); Set(Bfpbsh(enabled)=true, Bfpbsh(background)=ColorShowButton); end if; end proc: Hint_fpb:=proc() global ptb; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(reply=sprintf(TEXTreplyHfpb, ptb), reply(background)=ColorHint, reply(foreground)=ColorHintFrgd): end proc: Check_fpb:=proc() global fpb, x, pta; local user_fpb; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if Get(TFfpb)="" then Set(reply=TEXTreplyNoCheck, reply(background)=ColorHint, reply(foreground)=ColorHintFrgd); return; end if; user_fpb:=Get(TFfpb::algebraic, corrections=true, update=true): if simplify(normal(fpb - user_fpb))=0 then Set(TFfpbck=TEXTCorrect, TFfpbck(background)=ColorCorrect, TFfpbck(foreground)=ColorCorrectFrgd): Set(reply=cat(great[randgreat()],nexts1[randnext1()]), reply(background)=ColorCorrect, reply(foreground)=ColorCorrectFrgd): Set(TFgpa(enabled)=true, TFgpa(background)=ColorInput): Set(BHintgpa(enabled)=true, BHintgpa(background)=ColorHintButton); Set(Bgpack(enabled)=true, Bgpack(background)=ColorCheckButton); Set(Bgpash(enabled)=true, Bgpash(background)=ColorShowButton); else Set(TFfpbck=TEXTIncorrect, TFfpbck(background)=ColorIncorrect, TFfpbck(foreground)=ColorIncorrectFrgd): Set(reply=cat(sorry[randsorry()], sprintf(TEXTreplyHfpb, ptb)), reply(background)=ColorIncorrect, reply(foreground)=ColorIncorrectFrgd): end if; end proc: Show_fpb:=proc() global fpb, x; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(TFfpb=fpb): Set(TFfpbck=TEXTShown, TFfpbck(background)=ColorShow, TFfpbck(foreground)=ColorShowFrgd): Set(reply=shows[randshow()], reply(background)=ColorShow, reply(foreground)=ColorShowFrgd): Set(TFgpa(enabled)=true, TFgpa(background)=ColorInput): Set(BHintgpa(enabled)=true, BHintgpa(background)=ColorHintButton); Set(Bgpack(enabled)=true, Bgpack(background)=ColorCheckButton); Set(Bgpash(enabled)=true, Bgpash(background)=ColorShowButton); end proc: Hint_gpa:=proc() global pta; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(reply=sprintf(TEXTreplyHgpa, pta, ptb), reply(background)=ColorHint, reply(foreground)=ColorHintFrgd): end proc: Check_gpa:=proc() global gpa, x; local user_gpa; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; if Get(TFgpa)="" then Set(reply=TEXTreplyNoCheck, reply(background)=ColorHint, reply(foreground)=ColorHintFrgd); return; end if; user_gpa:=Get(TFgpa::algebraic, corrections=true, update=true): if simplify(normal(gpa - user_gpa))=0 then Set(TFgpack=TEXTCorrect, TFgpack(background)=ColorCorrect, TFgpack(foreground)=ColorCorrectFrgd): Set(reply=cat(great[randgreat()],nexts2[randnext2()]), reply(background)=ColorCorrect, reply(foreground)=ColorCorrectFrgd): else Set(TFgpack=TEXTIncorrect, TFgpack(background)=ColorIncorrect, TFgpack(foreground)=ColorIncorrectFrgd): Set(reply=cat(sorry[randsorry()], trys[randtry()]), reply(background)=ColorIncorrect, reply(foreground)=ColorIncorrectFrgd): end if; end proc: Show_gpa:=proc() global gpa, x; options `Copyright 2004-10, Philip B. Yasskin and Douglas B. Meade, Maplets for Calculus`; Set(TFgpa=gpa): Set(TFgpack=TEXTShown, TFgpack(background)=ColorShow, TFgpack(foreground)=ColorShowFrgd): Set(reply=shows[randshow()], reply(background)=ColorShow, reply(foreground)=ColorShowFrgd): end proc: Derivative_Inverse:=Maplet(onstartup=RunWindow(MAIN), Window[MAIN]( title=TEXTtitleMAIN, defaultbutton=BHint, [ halign=none, background=ColorBkgd, inset=0, spacing=0, [ background=ColorBkgd, Button(TEXTBNewFunction, Evaluate(function="New_Function"), background=ColorNewButton), RadioButton[RB1](TEXTRBNumeric, value=true, group=BG1, background=ColorBkgd), RadioButton[RB2](TEXTRBSymbolic, value=false, group=BG1, background=ColorBkgd), HorizontalGlue(), Button[BHint](TEXTBHint, Evaluate(function="Hint"), background=ColorHintButton), Button(TEXTBQuit, Shutdown(), background=ColorCloseButton) ], BoxRow( background=ColorBkgd, BoxColumn( halign=none, background=ColorBkgd, inset=0, spacing=0, [ halign=none, background=ColorBkgd, inset=0, spacing=0, border=true, caption=TEXTcapDefInv, MathMLViewer[fMML](value=MathML[Export]('f'(x)='f'(x)), width=200, height=30),#"f(x) = f" [ background=ColorBkgd, Button[Plotf](TEXTBPlotf, Evaluate(function="Plot_f"), width=100, enabled=false, background=ColorDisable, foreground=ColorPlotButtonFrgd), Button[Plotg](TEXTBPlotg, Evaluate(function="Plot_g"), width=100, enabled=false, background=ColorDisable, foreground=ColorPlotButtonFrgd) ] ], [ halign=none, background=ColorBkgd, border=true, caption=TEXTCapGoal, TEXTLGoal, TextField[TFa](width=10, editable=false, background=ColorMessage), HorizontalGlue(), Button[BHinta](TEXTBHint, Evaluate(function="Hint_a"), enabled=false, background=ColorDisable), "", Button[Plota](TEXTBPlota, Evaluate(function="Plot_a"), width=120, enabled=false, background=ColorDisable, foreground=ColorPlotButtonFrgd) ], [ halign=none, background=ColorBkgd, border=true, caption=TEXTcap1, "b =", TextField[TFb](width=7, enabled=false, background=ColorDisable), HorizontalGlue(), Button[BHintb](TEXTBHint, Evaluate(function="Hint_b"), enabled=false, background=ColorDisable), Button[Bbck](TEXTBCheck, Evaluate(function="Check_b"), enabled=false, background=ColorDisable), TextField[TFbck](width=6, editable=false, background=ColorMessage), Button[Bbsh](TEXTBShow, Evaluate(function="Show_b"), enabled=false, background=ColorDisable), "", Button[Plotb](TEXTBPlotb, Evaluate(function="Plot_b"), width=120, enabled=false, background=ColorDisable, foreground=ColorPlotButtonFrgd) ], [ halign=none, background=ColorBkgd, inset=0, spacing=0, border=true, caption=TEXTcap2, [ halign=none, background=ColorBkgd, inset=0, spacing=0, [ halign=none, background=ColorBkgd, "f '(x) =", TextField[TFfp](width=14, enabled=false, background=ColorDisable), HorizontalGlue(), Button[BHintfp](TEXTBHint, Evaluate(function="Hint_fp"), enabled=false, background=ColorDisable), Button[Bfpck](TEXTBCheck, Evaluate(function="Check_fp"), enabled=false, background=ColorDisable), TextField[TFfpck](width=6, editable=false, background=ColorMessage), Button[Bfpsh](TEXTBShow, Evaluate(function="Show_fp"), enabled=false, background=ColorDisable) ], [ halign=none, background=ColorBkgd, "f '(b) =", TextField[TFfpb](width=14, enabled=false, background=ColorDisable), HorizontalGlue(), Button[BHintfpb](TEXTBHint, Evaluate(function="Hint_fpb"), enabled=false, background=ColorDisable), Button[Bfpbck](TEXTBCheck, Evaluate(function="Check_fpb"), enabled=false, background=ColorDisable), TextField[TFfpbck](width=6, editable=false, background=ColorMessage), Button[Bfpbsh](TEXTBShow, Evaluate(function="Show_fpb"), enabled=false, background=ColorDisable) ] ], [ valign=none, spacing=0, background=ColorBkgd, VerticalGlue(), Button[Plotftan](TEXTBPlottan, Evaluate(function="Plot_ftan"), width=120, enabled=false, background=ColorDisable, foreground=ColorPlotButtonFrgd),# foreground=gray Label[Lftan](TEXTLftan, enabled=false, background=ColorDisable, foreground=ColorPlotButtonFrgd, width=120) ] ], [ halign=none, background=ColorBkgd, border=true, caption=TEXTcap3, "g '(a) =", TextField[TFgpa](width=14, enabled=false, background=ColorDisable), HorizontalGlue(), Button[BHintgpa](TEXTBHint, Evaluate(function="Hint_gpa"), enabled=false, background=ColorDisable), Button[Bgpack](TEXTBCheck, Evaluate(function="Check_gpa"), enabled=false, background=ColorDisable), TextField[TFgpack](width=6, editable=false, background=ColorMessage), Button[Bgpash](TEXTBShow, Evaluate(function="Show_gpa"), enabled=false, background=ColorDisable), "", [ valign=none, inset=0, spacing=0, background=ColorBkgd, Button[Plotgtan](TEXTBPlottan, Evaluate(function="Plot_gtan"), width=120, enabled=false, background=ColorDisable, foreground=ColorPlotButtonFrgd),# foreground=gray Label[Lgtan](TEXTLgtan, enabled=false, background=ColorDisable, foreground=ColorPlotButtonFrgd, width=120) ] ], BoxRow( background=ColorBkgd, TextBox[reply](width=60, height=3, editable=false, background=ColorMessage), Label(Image(Logo)), Label(Image(LIBLogo)) ) ), BoxColumn( halign=none, background=ColorBkgd, inset=0, spacing=0, [ halign=none, background=ColorBkgd, inset=0, spacing=0, border=true, caption=TEXTCapPlot, Plotter[myplot](width=300, height=300) ], BoxColumn( halign=none, valign=none, background=ColorBkgd, inset=0, spacing=0, border=true, caption=TEXTCapLegend, [ halign=none, background=ColorBkgd, HorizontalGlue(), "f(x)", TextField(TEXTblue, width=4, font=FontBig, background=ColorMessage, foreground=blue), HorizontalGlue(), TEXTtantof, TextField(TEXTblack, width=4, font=FontBig, background=ColorMessage, foreground=black), HorizontalGlue() ], [ halign=none, background=ColorBkgd, HorizontalGlue(), "g(x)", TextField(TEXTred, width=4, font=FontBig, background=ColorMessage, foreground=red), HorizontalGlue(), TEXTtantog, TextField(TEXTbrown, width=4, font=FontBig, background=ColorMessage, foreground=brown), HorizontalGlue() ] ) ) ), BoxColumn( halign=none, background=ColorFooter, inset=0, spacing=0, [ background=ColorFooter, inset=0, spacing=0, Label(TEXTLprogrammers, font=FontFooter), HorizontalGlue(), Label(TEXTLcopyright, font=FontFooter), HorizontalGlue(), Label(TEXTLversion, font=FontFooter) ], [ background=ColorFooter, inset=0, spacing=0, Label(TEXTLasstprogrammer, font=FontFooter), HorizontalGlue(), Label(GetVersion(), font=FontFooter) ] ) ]), ButtonGroup[BG1](onchange=Evaluate(function="New_Function")) ): Maplets[Display]( Derivative_Inverse );