[npl] / trunk / NationalProblemLibrary / Rochester / setDerivatives22Graphing / S04.05.CurveSketching.PTP09.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/Rochester/setDerivatives22Graphing/S04.05.CurveSketching.PTP09.pg

Fri Jan 14 22:16:56 2011 UTC (2 years, 4 months ago) by jj
File size: 2076 byte(s)
Fixed bug 1785, typo in library tags.


    1 ## Original: /Library/ma122DB/set9/s4_5_7.pg
2
3 ##DESCRIPTION
4 ## Match rational functions with a graph
5 ##ENDDESCRIPTION
6 ##KEYWORDS('curve sketching')
7
8 ## Shotwel cleaned
9 ## lcao , PAID on 11-24-2003
10
11 ## DBsubject('Calculus')
12 ## DBchapter('Applications of Differentiation')
13 ## DBsection('Summary of Curve Sketching')
14 ## Date('6/3/2002')
15 ## Author('')
16 ## Institution('')
17 ## TitleText1('Calculus: Early Transcendentals')
18 ## EditionText1('4')
19 ## AuthorText1('Stewart')
20 ## Section1('4.5')
21 ## Problem1('13')
22
23 DOCUMENT();        # This should be the first executable line in the problem.
24
26 "PGbasicmacros.pl",
28 "PGauxiliaryFunctions.pl",
29 "PGgraphmacros.pl"
30 );
31
32 TEXT(beginproblem());
33 $showPartialCorrectAnswers = 0; 34 35$graph = init_graph(-5,-5,5,5,'axes'=>[0,0],'grid'=>[10,10]);
36
37 $sgn = random(-1,1,2); 38 39$sn = 0.001;
40
41 if ($sgn > 0) 42 { 43$pl = -1 - $sn; 44$pr = -1 + $sn; 45$ql =  2 - $sn; 46$qr =  2 + $sn; 47$f1 = FEQ("1/((x+1)*(x-2)) for x in <-5,$pl> using color:red and weight:2"); 48$f2 = FEQ("1/((x+1)*(x-2)) for x in <$pr,$ql> using color:red and weight:2");
49 $f3 = FEQ("1/((x+1)*(x-2)) for x in <$qr,5> using color:red and weight:2");
50 ($fRef) = plot_functions($graph,$f1,$f2,$f3); 51 } 52 else 53 { 54$pl = -1 - $sn; 55$pr = -1 + $sn; 56$ql =  1 - $sn; 57$qr =  1 + $sn; 58$f1 = FEQ("(1+x**2)/(1-x**2) for x in <-5,$pl> using color:red and weight:2"); 59$f2 = FEQ("(1+x**2)/(1-x**2) for x in <$pr,$ql> using color:red and weight:2");
60 $f3 = FEQ("(1+x**2)/(1-x**2) for x in <$qr,5> using color:red and weight:2");
61 ($fRef) = plot_functions($graph,$f1,$f2,$f3); 62 }; 63 64 BEGIN_TEXT 65 Which function is shown in the following graph?$BR
66 \{image( insertGraph($graph), width=>300, height=>300 )\} 67$BR
68 a.) $$f(x)= \displaystyle \frac{1}{(x+1)(x-2)}$$  $BR$BR
69 b.) $$f(x) = \displaystyle \frac{1+x^2}{1-x^2}$$ $BR$BR
70 Answer: \{pop_up_list(['?','a','b']) \}
71
72 $BR$BR
73 $BBOLD Note:$EBOLD You can click on the graph to make it larger.
74
75 END_TEXT
76
77 if ($sgn > 0) {$ans = 'a'} else {$ans = 'b'}; 78 ANS(str_cmp($ans ) );
79
80 ENDDOCUMENT();        # This should be the last executable line in the problem.
81


 aubreyja at gmail dot com ViewVC Help Powered by ViewVC 1.0.9