[npl] / trunk / NationalProblemLibrary / UVA-Stew5e / setUVA-Stew5e-C04S01-MaxMinValues / 4-1-55.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/UVA-Stew5e/setUVA-Stew5e-C04S01-MaxMinValues/4-1-55.pg

Wed Jul 18 15:40:35 2007 UTC (5 years, 10 months ago) by jjholt
File size: 1576 byte(s)

1 ## DESCRIPTION
2 ##  Calculus: Maximum and Minimum Values
3 ## ENDDESCRIPTION
4
5 ## KEYWORDS('derivatives', 'minimum', 'maximum')
6 ## Tagged by YL
7
8 ## DBsubject('Calculus')
9 ## DBchapter('Applications of Differentiation')
10 ## DBsection('Maximum and Minimum Values')
11 ## Date('5/29/2005')
12 ## Author('Jeff Holt')
13 ## Institution('UVA')
14 ## TitleText1('Calculus: Early Transcendentals')
15 ## EditionText1('5')
16 ## AuthorText1('Stewart')
17 ## Section1('4.1')
18 ## Problem1('55')
19
20 ## TitleText2('Calculus: Early Transcendentals')
21 ## EditionText2('6')
22 ## AuthorText2('Stewart')
23 ## Section2('4.1')
24 ## Problem2('')
25
26
27 DOCUMENT();        # This should be the first executable line in the problem.
28
30            "PGbasicmacros.pl",
31            "PGchoicemacros.pl",
33            "PGauxiliaryFunctions.pl");
34
35 $a = random(2,8,2); 36$p1 = random(1/2,3,1/2);
37 $p2 = random(4,6,1); 38 39 TEXT(beginproblem()); 40 41$showPartialCorrectAnswers = 1;
42
43 TEXT(EV2(<<EOT));
44 Find the
45 absolute maximum and absolute minimum values of  the function
46 $f(x) = x^a + \frac{a}{x}$
47 on the interval $$[p1,p2]$$.
48 $BR 49 Enter -1000 for any absolute extrema that does not exist. 50$BR
51 Absolute maximum = \{ans_rule(20)\}
52 $BR 53$BR
54 Absolute minimum = \{ans_rule(20)\}
55
56 $BR 57 EOT 58 59$ans1 = (1)**$a +$a/(1);
60 $ans2 = ($p1)**$a +$a/($p1); 61$ans3 = ($p2)**$a +$a/($p2);
62
63 if ($p1 < 1) { 64$ansmin = $ans1; 65 } 66 else { 67$ansmin = $ans2; 68 } 69 70$ansmax = $ans3; 71 72 @answers = (num_cmp($ansmax), num_cmp(\$ansmin));
73