[npl] / trunk / NationalProblemLibrary / Union / setDervBasic / 3-4-01b-def.pg Repository:
ViewVC logotype

Diff of /trunk/NationalProblemLibrary/Union/setDervBasic/3-4-01b-def.pg

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

Revision 881 Revision 882
6## Tagged by tda2d 6## Tagged by tda2d
7 7
8## DBsubject('Calculus') 8## DBsubject('Calculus')
9## DBchapter('Limits and Derivatives') 9## DBchapter('Limits and Derivatives')
10## DBsection('Definition of the Derivative') 10## DBsection('Definition of the Derivative')
11## Date('') 11## Date('8/23/07')
12## Author('') 12## Author('')
13## Institution('Union College') 13## Institution('Union College')
14## TitleText1('') 14## TitleText1('')
15## EditionText1('') 15## EditionText1('')
16## AuthorText1('') 16## AuthorText1('')
17## Section1('') 17## Section1('')
18## Problem1('') 18## Problem1('')
19 19
20DOCUMENT(); 20DOCUMENT(); # This should be the first executable line in the problem.
21 21
22loadMacros( 22loadMacros(
23 "PG.pl", 23 "PGstandard.pl",
24 "PGbasicmacros.pl",
25 "PGchoicemacros.pl",
26 "PGanswermacros.pl",
27 "PGauxiliaryFunctions.pl",
28 "PGunion.pl", # Union College utilities 24 "PGunion.pl", # Union College utilities
25 "MathObjects.pl",
29 "PGcourse.pl", # Customization file for the course 26 "PGcourse.pl", # Customization file for the course
30); 27);
31 28
32TEXT(beginproblem()); 29TEXT(beginproblem);
33BEGIN_PROBLEM(); 30
31###################################
32# Setup
34 33
35$a = random(2, 3, 1); 34$a = random(2, 3, 1);
36$b = random(-7,-2,1); 35$b = random(-7,-2,1);
37 36
37$f=Formula("$b x^{$a}");
38###################################
39# Main text
40
41Context()->texStrings;
38BEGIN_TEXT 42BEGIN_TEXT
39Use the definition of derivative to find \( f'(x) \) for \( f(x) = $b x^{$a}\). 43Let \( f(x) = $f\). Use the definition of derivative to find \( f'(x) \).
40$PAR 44$PAR
41\( f'(x) \) = \{ans_rule(20) \} 45\( f'(x) \) = \{ans_rule(20) \}
42END_TEXT 46END_TEXT
47Context()->normalStrings;
43 48
44$exp=$a-1; 49###################################
45$coeff=$a*$b; 50# Answers
46$ans = "$coeff(x^$exp)";
47ANS(fun_cmp($ans));
48 51
49END_PROBLEM(); 52
53$ans=$f->D('x');
54ANS(Formula($ans)->cmp);
55
56#$exp=$a-1;
57#$coeff=$a*$b;
58#$ans = "$coeff(x^$exp)";
59#ANS(Formula($ans)->cmp);
60
61# Could also code as ANS(Formula("$coeff(x^$exp)")->cmp);
62###################################
63
50ENDDOCUMENT(); 64ENDDOCUMENT();
51

Legend:
Removed from v.881  
changed lines
  Added in v.882

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9