## DESCRIPTION ## Calculus: Functions ## ENDDESCRIPTION ## KEYWORDS('calculus', 'continuity') ## DBsubject('Calculus') ## DBchapter('Limits and Derivatives') ## DBsection('The Derivative as a Function') ## Date('08/01/2007') ## Author('Paul Pearson') ## Institution('University of Rochester') ## TitleText1('Calculus') ## EditionText1('6e') ## AuthorText1('Stewart') ## Section1('2.9') ## Problem1('37,38') DOCUMENT(); loadMacros( "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGgraphmacros.pl", "PGauxiliaryFunctions.pl", "extraAnswerEvaluators.pl" ); TEXT(beginproblem()); \$showPartialCorrectAnswers = 1; \$a=random(1,3,1); \$b=non_zero_random(-3,0,1); \$c=random(-3,2,1); \$m1=non_zero_random(-1,1,0.5); \$m2= - \$m1; \$m3=non_zero_random(-1,1,1); \$m4=non_zero_random(-1,1,1); @slice = NchooseK(3,3); @colors = ("blue", "red", "green"); @sc = @colors[@slice]; #scrambled colors @sa = ('A','B','C')[@slice]; \$f1 = FEQ("sin(10*(x+1)) + \$b for x in [-2,-1) using color:\$sc[0] and weight:2"); \$f2 = FEQ("1 + \$a for x in [-1,-1] using color=\$sc[0] and weight=2"); \$f3 = FEQ("\${m3}/((3*x)**2) + \$b - \${m3}*1/9 for x in (-1,0) using color=\$sc[0] and weight:2"); \$f4 = FEQ("\${m4}/((3*x)**2) + \$b - \${m4}*1/9 for x in (0,1) using color=\$sc[0] and weight:2"); \$f5 = FEQ("\$b/5 for x in [1,1] using color=\$sc[0] and weight=2"); \$f6 = FEQ("\${m1}*(x-3)+\$c for x in (1,3] using color=\$sc[0] and weight=2"); \$f7 = FEQ("\${m2}*(x-3)+\$c for x in [3,4] using color=\$sc[0] and weight=2"); \$graph = init_graph(-3,-6,5,6,'axes'=>[0,0],'grid'=>[8,12]); (\$f1Ref,\$f2Ref,\$f3Ref,\$f4Ref,\$f5Ref,\$f6Ref,\$f7Ref) = plot_functions(\$graph,\$f1,\$f2,\$f3,\$f4,\$f5,\$f6,\$f7); TEXT(EV2(<200, width=>200)); TEXT(EV2(< EOT ANS(interval_cmp("(-2,-1)U(-1,0)U(0,1)U(1,3)U(3,4)")); ENDDOCUMENT();