##DESCRIPTION ##KEYWORDS('derivatives', 'trigonometry', 'product rule') ## Find a derivative of a function involving trigonometric functions, ## and evalute it at a given point; requires using product rule ##ENDDESCRIPTION DOCUMENT(); # This should be the first executable line in the problem. loadMacros( "PG.pl", "PGbasicmacros.pl", "PGchoicemacros.pl", "PGanswermacros.pl", "PGauxiliaryFunctions.pl" ); TEXT(beginproblem()); $showPartialCorrectAnswers = 1; $pi = arccos(-1); $a_n = random(2,12,1); $a_s = random(-1,1,2); $a = $a_n * $a_s; $x_d = random(3,6,1); while ($x_d == 5) {$x_d = random(3,6,1);}; $q = random(0,1,1); if ($q == 0) { $x_n = 1; $x_s = -1; $x_sign = '-'; }; if ($q == 1) { $x_n = 1; $x_s = 1; $x_sign = ''; }; if ($q == 2) { $x_n = $x_d - 1; $x_s = 1; $x_sign = ''; }; if ($q == 3) { $x_n = $x_d + 1; $x_s = 1; $x_sign = ''; }; if ($q == 4) { $x_n = 2 * $x_d - 1; $x_s = 1; $x_sign = ''; }; if ($x_n != 1) { $x_num = $x_n }; if ($x_n == 1) { $x_num = '' }; $x = $x_s*$x_n*$pi/$x_d; $deriv1 =($a*(sin($x)+cos($x))+ $a*$x*(cos($x)-sin($x))); $funct1 ="($a*(sin(x)+cos(x))+ $a*x*(cos(x)-sin(x)))"; TEXT(EV2(<