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

Diff of /trunk/NationalProblemLibrary/maCalcDB/setDerivatives12MVT/c3s2p1.pg

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 3023 Revision 3024
1#DESCRIPTION 1# This file is just a pointer to the file
2#KEYWORDS('derivatives', 'mean value theorem') 2#
3## tsuda tagged and PAID on 2-20-2004 3# "Library/Rochester/setDerivatives12MVT/c3s2p1.pg"
4#
5# You may want to change your problem set to use that problem
6# directly, especially if you want to make a copy of the problem
7# for modification.
4 8
5## DBsubject('Calculus') 9DOCUMENT();
6## DBchapter('Applications of Differentiation') 10includePGproblem("Library/Rochester/setDerivatives12MVT/c3s2p1.pg");
7## DBsection('The Mean Value Theorem') 11ENDDOCUMENT();
8## Date('6/3/2002')
9## Author('')
10## Institution('')
11## TitleText1('Calculus: Early Transcendentals')
12## EditionText1('6')
13## AuthorText1('Stewart')
14## Section1('4.2')
15## Problem1('12')
16 12
17# Validate mean value theorem in special cases 13## These tags keep this problem from being added to the NPL database
18#ENDDESCRIPTION 14##
15## DBsubject('ZZZ-Inserted Text')
16## DBchapter('ZZZ-Inserted Text')
17## DBsection('ZZZ-Inserted Text')
19 18
20DOCUMENT(); # This should be the first executable line in the problem.
21
22loadMacros("PG.pl",
23 "PGbasicmacros.pl",
24 "PGchoicemacros.pl",
25 "PGanswermacros.pl",
26"PGauxiliaryFunctions.pl",
27"PGcourse.pl");
28
29TEXT(beginproblem());
30$showPartialCorrectAnswers=1;
31
32sub f1 {
33 my $x = shift;
34 $A3*$x**3 + $A2*$x**2 + $A1*$x +$A0;
35 }
36$discrim = 0;
37
38while ($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$root1 = ( -$b - sqrt($discrim) ) /(2*$a);
54$root2 = ( -$b + sqrt($discrim) ) /(2*$a);
55TEXT(EV2(<<EOT));
56Consider the function
57\[ f(x) = !{$A3}x^3 ? {$A2}x^2 ? {$A1}x ? {$A0} \]
58Find the average slope of this function on the interval \( ( $left , $right ) \).
59\{ans_rule(20) \} $BR
60EOT
61
62if ($left<= $root1 and $root1 <= $right and $left < $root2 and $root2 <= $right) { # both roots are in interval)
63 TEXT(EV2(<<EOT));
64By the Mean Value Theorem, we know there exists a \( c \) in the open interval
65\( ( $left, $right ) \) such that \( f'(c) \) is equal to this mean slope.
66Find the two values of \( c \) in the interval which work, enter the smaller root first:
67
68\{ ans_rule(10) \}\( $LTE \) \{ ans_rule(10) \}
69EOT
70
71 ANS(num_cmp([$avg,num_sort($root1, $root2)], relTol=>.1));
72 }
73elsif ($left<$root1 and $root1<$right ) { #root 1 is in the interval
74 TEXT(EV2(<<EOT));
75By the Mean Value Theorem, we know there exists a \( c \) in the open interval
76\( ( $left, $right ) \) such that \( f'(c) \) is equal to this mean slope.
77Find the value of \( c \) in the interval which works
78\{ ans_rule(10) \}
79EOT
80 ANS(num_cmp([$avg,$root1], relTol=>.1));
81 }
82elsif ($left<$root2 and $root2<$right ) { #root 1 is in the interval
83 TEXT(EV2(<<EOT));
84By the Mean Value Theorem, we know there exists a \( c \) in the open interval
85\( ( $left, $right ) \) such that \( f'(c) \) is equal to this mean slope.
86Find the value of \( c \) in the interval which works
87\{ ans_rule(10) \}
88EOT
89 ANS(num_cmp([$avg,$root2], relTol=>.1));
90 }
91else {
92 TEXT("Error in formulating problem -- inform instructor please.");
93 }
94
95ENDDOCUMENT(); # This should be the last executable line in the problem.

Legend:
Removed from v.3023  
changed lines
  Added in v.3024

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9