[npl] / trunk / NationalProblemLibrary / Rochester / setTrig07Identity / srw7_1_35.pg Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# View of /trunk/NationalProblemLibrary/Rochester/setTrig07Identity/srw7_1_35.pg

Wed Apr 25 20:27:14 2012 UTC (13 months, 3 weeks ago) by jj
File size: 1362 byte(s)
Fixed bug 2339, added additional correct answers.


    1 ##DESCRIPTION
2 ## Algebra: Analytic Trigonometry
3 ##ENDDESCRIPTION
4
5 ##KEYWORDS('algebra', 'analytic trigonometry', 'trigonometric identities')
6
7 ## tcao , PAID on 11-24-2003
8
9 ## DBsubject('Trigonometry')
10 ## DBchapter('Analytic Trigonometry')
11 ## DBsection('Trigonometric Identities')
12 ## Date('6/3/2002')
13 ## Author('')
14 ## Institution('')
15 ## TitleText1('Precalculus')
16 ## EditionText1('3')
17 ## AuthorText1('Stewart, Redlin, Watson')
18 ## Section1('7.1')
19 ## Problem1('33')
20 DOCUMENT();        # This should be the first executable line in the problem.
21
23 "PG.pl",
24 "PGbasicmacros.pl",
25 "PGchoicemacros.pl",
27 "MathObjects.pl",
28 "PGauxiliaryFunctions.pl"
29 );
30
31 TEXT(beginproblem());
32 $showPartialCorrectAnswers = 0; 33 34 35 Context('Numeric'); 36 Context()->variables->add(y=>'Real'); 37 Context()->functions->undefine('sqrt'); 38 Context()->operators->undefine('**','^'); 39 40 BEGIN_TEXT 41 Simplify and write the trigonometric expression in terms of sine and cosine: 42$BR
43 $(1-\cos y)(1+\cos y) = (f(y))^2$
44 $BR 45 $$f(y)=$$ \{ans_rule(20)\}. 46 END_TEXT 47 48 sub mycheck { 49 my ($correct, $student) = @_; 50$student = Formula($student); 51$correct = Formula($correct); 52 return 1 if abs($student)==abs($correct); 53 return 0; 54 } 55 56$ans = Formula("sin(y)");
57 ANS( \$ans->cmp( checker => ~~&mycheck ) );
58
59 ENDDOCUMENT();        # This should be the last executable line in the problem.