[npl] / trunk / NationalProblemLibrary / Rochester / setDerivatives12MVT / c3s2p1.pg Repository:
ViewVC logotype

View of /trunk/NationalProblemLibrary/Rochester/setDerivatives12MVT/c3s2p1.pg

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3024 - (download) (annotate)
Fri Jun 29 18:55:12 2012 UTC (10 months, 3 weeks ago) by jj
File size: 2823 byte(s)
Duplicate problems.

    1 ## DESCRIPTION
    2 ##   The Mean Value Theorem
    3 ## ENDDESCRIPTION
    4 
    5 ## KEYWORDS('Mean Value', 'Slope')
    6 ## Tagged by nhamblet
    7 
    8 ## DBsubject('Calculus')
    9 ## DBchapter('Applications of Differentiation')
   10 ## DBsection('The Mean Value Theorem')
   11 ## Date('')
   12 ## Author('')
   13 ## Institution('Rochester')
   14 ## TitleText1('Calculus: Early Transcendentals')
   15 ## EditionText1('6')
   16 ## AuthorText1('Stewart')
   17 ## Section1('4.2')
   18 ## Problem1('12')
   19 
   20 
   21 DOCUMENT();        # This should be the first executable line in the problem.
   22 
   23 loadMacros("PG.pl",
   24            "PGbasicmacros.pl",
   25            "PGchoicemacros.pl",
   26            "PGanswermacros.pl",
   27 "PGauxiliaryFunctions.pl");
   28 
   29 TEXT(beginproblem());
   30 $showPartialCorrectAnswers=1;
   31 
   32 sub f1 {
   33     my $x = shift;
   34     $A3*$x**3 + $A2*$x**2 + $A1*$x +$A0;
   35     }
   36 $discrim = 0;
   37 
   38 while ($discrim == 0 ) {
   39   $A3=  random(1,3,1)*(random(0,1,1) ? 1: -1);
   40   $A2 = non_zero_random(-4,4,1);
   41   $A1 = non_zero_random(-4,4,1);
   42   $A0 = non_zero_random( -4 ,4,1);
   43   $left = random(-4,4,1);
   44   $right = $left + random (1,8,1);
   45 
   46   $avg = (f1($right) - f1($left) ) /($right - $left);
   47   $a= 3*$A3;
   48   $b=2*$A2;
   49   $c = $A1 - $avg;
   50   $discrim = $b**2 - 4*$a*$c;
   51   }
   52 
   53 $poly = nicestring([$A3, $A2, $A1, $A0]);
   54 
   55 $root1 = ( -$b - sqrt($discrim) ) /(2*$a);
   56 $root2 = ( -$b + sqrt($discrim) ) /(2*$a);
   57 TEXT(EV2(<<EOT));
   58 Consider the function
   59 \[ f(x) = $poly\]
   60 Find the average slope of this function on the interval \( ( $left , $right ) \).
   61 \{ans_rule(20) \} $BR
   62 EOT
   63 
   64 if ($left<= $root1 and $root1 <= $right and $left < $root2 and $root2 <= $right) { # both roots are in interval)
   65   TEXT(EV2(<<EOT));
   66 By the Mean Value Theorem, we know there exists a \( c \) in the open interval
   67 \( ( $left, $right ) \) such that \( f'(c) \) is equal to this mean slope.
   68 Find the two values of \( c \) in the interval which work, enter the smaller root first:
   69 
   70 \{ ans_rule(10) \}\(  $LTE \)  \{ ans_rule(10) \}
   71 EOT
   72 
   73     ANS(num_cmp([$avg,num_sort($root1, $root2)], relTol=>.1));
   74     }
   75 elsif ($left<$root1 and $root1<$right ) { #root 1 is in the interval
   76   TEXT(EV2(<<EOT));
   77 By the Mean Value Theorem, we know there exists a \( c \) in the open interval
   78 \( ( $left, $right ) \) such that \( f'(c) \) is equal to this mean slope.
   79 Find the  value of \( c \) in the interval which works
   80 \{ ans_rule(10) \}
   81 EOT
   82   ANS(num_cmp([$avg,$root1], relTol=>.1));
   83   }
   84 elsif ($left<$root2 and $root2<$right ) { #root 1 is in the interval
   85   TEXT(EV2(<<EOT));
   86 By the Mean Value Theorem, we know there exists a \( c \) in the open interval
   87 \( ( $left, $right ) \) such that \( f'(c) \) is equal to this mean slope.
   88 Find the  value of \( c \) in the interval which works
   89 \{ ans_rule(10) \}
   90 EOT
   91   ANS(num_cmp([$avg,$root2], relTol=>.1));
   92   }
   93 else  {
   94   TEXT("Error in formulating problem -- inform instructor please.");
   95   }
   96 
   97 ENDDOCUMENT();        # This should be the last executable line in the problem.

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9