[npl] / trunk / NationalProblemLibrary / Rochester / setDerivatives4Trig / s2_4_27a.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/Rochester/setDerivatives4Trig/s2_4_27a.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 145 - (download) (annotate)
Sun Mar 26 22:21:31 2006 UTC (7 years, 2 months ago) by jj
File size: 1560 byte(s)
Initial import

    1 ##DESCRIPTION
    2 ##KEYWORDS('derivatives', 'trigonometry', 'product rule')
    3 ##  Find a derivative of a function involving trigonometric functions,
    4 ##  and evalute it at a given point; requires using product rule
    5 ##ENDDESCRIPTION
    6 
    7 DOCUMENT();        # This should be the first executable line in the problem.
    8 
    9 loadMacros(
   10 "PG.pl",
   11 "PGbasicmacros.pl",
   12 "PGchoicemacros.pl",
   13 "PGanswermacros.pl",
   14 "PGauxiliaryFunctions.pl"
   15 );
   16 
   17 TEXT(beginproblem());
   18 $showPartialCorrectAnswers = 1;
   19 
   20 $pi = arccos(-1);
   21 
   22 $a_n = random(2,12,1);
   23 $a_s = random(-1,1,2);
   24 $a   = $a_n * $a_s;
   25 
   26 $x_d = random(3,6,1);
   27 while ($x_d == 5) {$x_d = random(3,6,1);};
   28 
   29 $q = random(0,1,1);
   30 if ($q == 0) {
   31     $x_n = 1;
   32     $x_s = -1;
   33     $x_sign = '-';
   34     };
   35 if ($q == 1) {
   36     $x_n = 1;
   37     $x_s = 1;
   38     $x_sign = '';
   39     };
   40 if ($q == 2) {
   41     $x_n = $x_d - 1;
   42     $x_s = 1;
   43     $x_sign = '';
   44     };
   45 if ($q == 3) {
   46     $x_n = $x_d + 1;
   47     $x_s = 1;
   48     $x_sign = '';
   49     };
   50 if ($q == 4) {
   51     $x_n = 2 * $x_d - 1;
   52     $x_s = 1;
   53     $x_sign = '';
   54     };
   55 
   56 if ($x_n != 1) { $x_num = $x_n };
   57 if ($x_n == 1) { $x_num = '' };
   58 
   59 $x = $x_s*$x_n*$pi/$x_d;
   60 
   61 $deriv1 =($a*(sin($x)+cos($x))+ $a*$x*(cos($x)-sin($x)));
   62 $funct1 ="($a*(sin(x)+cos(x))+ $a*x*(cos(x)-sin(x)))";
   63 
   64 TEXT(EV2(<<EOT));
   65 Let \[ f(x) = $a x( \sin x + \cos x) \]
   66 $PAR
   67 \( f'( x ) = \)
   68 $PAR
   69 \{ans_rule(45) \}
   70 $PAR
   71 \( f'( $x_sign \frac { $x_num \pi } {$x_d} ) = \)
   72 $PAR
   73 \{ans_rule(45) \}
   74 
   75 EOT
   76 
   77 $ans = $funct1;
   78 ANS(fun_cmp($ans));
   79 
   80 $ans = $deriv1;
   81 ANS(num_cmp($ans));
   82 
   83 ENDDOCUMENT();        # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9