Skip to content

Commit 8c7a553

Browse files
committed
clean up
1 parent 174305e commit 8c7a553

File tree

2 files changed

+23
-32
lines changed

2 files changed

+23
-32
lines changed

Contrib/CCCS/CalculusOne/03.6/CCD_CCCS_Openstax_Calc1_C1-2016-002_3_6_224.pg

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
## DBsection(Chain rule (with trigonometric functions))
99
## Date(05/11/2018)
1010
## Institution(Colorado Community College System)
11-
## Author(Eric Fleming)
11+
## Author(Eric Fleming-updated to use Composition_Ans by Brittni Lorton August 2022)
1212
## MO(1)
1313
## KEYWORDS('chain rule', 'trig', 'trigonometric functions', 'tan', 'tangent', 'tan(x)', 'sec', 'secant', 'sec(x)')
1414

@@ -40,7 +40,6 @@ $a=random(2,9,1);
4040
$b=random(2,20,1);
4141
$c=random(2,20,1);
4242

43-
4443
$f=Formula("tan(sec($a x))");
4544

4645
$ans1=Formula("tan(u)");
@@ -50,35 +49,23 @@ $ans3=Formula("$a sec^2(sec($a x)) sec($a x) tan($a x)");
5049
###########################
5150
# Main text
5251

53-
#BEGIN_PGML
52+
BEGIN_PGML
5453

55-
#Decompose [`\displaystyle y=[$f]`] into two functions [`y=f(u)`] and [`u=g(x)`] such that [`y=f(g(x))`]. Then find `\frac{dy}{dx}`.
54+
Decompose [`\displaystyle y=[$f]`] into two functions [`y=f(u)`] and [`u=g(x)`] such that [`y=f(g(x))`]. Then find `\frac{dy}{dx}`.
5655

57-
#[`f(u)=`][_______________] [@ AnswerFormatHelp("formulas") @]*
56+
[`f(u)=`][_______________] [@ AnswerFormatHelp("formulas") @]*
5857

59-
#[`g(x)=`][_______________] [@ AnswerFormatHelp("formulas") @]*
58+
[`g(x)=`][_______________] [@ AnswerFormatHelp("formulas") @]*
6059

61-
#`\frac{dy}{dx}=`[_______________] [@ AnswerFormatHelp("formulas") @]*
60+
END_PGML
6261

63-
#END_PGML
64-
Context()->texStrings;
65-
BEGIN_TEXT
66-
Decompose \( y=$f\) into two functions \(y=f(u)\) and \(u=g(x)\) such that \(y=f(g(x))\). Then find \( \frac{dy}{dx}\).
67-
$BR
68-
$BR
69-
\( f(u) \) = \{ ans_rule(20) \}
70-
\{ AnswerFormatHelp("formulas") \}
71-
$BR
72-
\( g(x) \) = \{ ans_rule(20) \}
73-
$BR
74-
END_TEXT
75-
Context()->normalStrings;
7662
COMPOSITION_ANS( $ans1, $ans2, vars=>['u','x'], showVariableHints=>1);
63+
BEGIN_PGML
64+
65+
`\frac{dy}{dx}=`[_______________]{$ans3} [@ AnswerFormatHelp("formulas") @]*
66+
67+
END_PGML
7768

78-
BEGIN_TEXT
79-
\(\frac{dy}{dx}= \) \{ans_rule(20)\}
80-
END_TEXT
81-
ANS( $ans3->cmp() );
8269

8370
############################
8471
# Solution

Contrib/CCCS/CalculusOne/04.7/CCD_CCCS_Openstax_Calc1_C1-2016-002_4_7_332_334.pg

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,22 +39,26 @@ $showPartialCorrectAnswers = 1;
3939

4040
###########################
4141
# Setup
42+
$ans1=Compute("-b+ax-cx-dx^2");
43+
$ans2=Compute("(a-c)/(2d)");
4244

4345
do{$a=random(4,20,4);
44-
$b=random(2,8,2);
45-
$d=random(5,25,5);
46+
$b=random(2,8,2);}
47+
until($a>$b);
48+
$ans3=Compute(($a-$b)/(2));
49+
50+
do{$d=random(5,25,5);
4651
$e=random(2,8,2);
4752
$f=random(1,3,1);
48-
$g=random(.2,2,.2);
49-
$ans1=Compute("-b+ax-cx-dx^2");
50-
$ans2=Compute("(a-c)/(2d)");
51-
$ans3=Compute(($a-$b)/(2));
53+
$g=random(.2,2,.2);}
54+
until($d>$f);
5255
$ans4=Compute(($d-$f)/(2*$g));
56+
57+
5358
$rev1=Compute("$a*x")->reduce;
5459
$rev2=Compute("$d*x")->reduce;
5560
$cost1=Compute("$b*x+x^2")->reduce;
56-
$cost2=Compute("$e+$f*x+$g*x^2")->reduce;}until($ans3>0 and $ans4>0);
57-
61+
$cost2=Compute("$e+$f*x+$g*x^2")->reduce;
5862

5963
###########################
6064
# Main text

0 commit comments

Comments
 (0)