Difference between revisions of "DifferenceQuotient1"
Jump to navigation
Jump to search
(Created page with '<h2>Answer is a Difference Quotient</h2> <p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> This PG code shows how to require students to simplify a differ…') |
(added historical tag and gave updated problem link) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | {{historical}} |
||
+ | |||
+ | <p style="font-size: 120%;font-weight:bold">This problem has been replaced with [https://openwebwork.github.io/pg-docs/sample-problems/DiffCalc/DifferenceQuotient.html a newer version of this problem]</p> |
||
<h2>Answer is a Difference Quotient</h2> |
<h2>Answer is a Difference Quotient</h2> |
||
− | <p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> |
||
+ | [[File:DifferenceQuotient1.png|300px|thumb|right|Click to enlarge]] |
||
+ | <p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;"> |
||
This PG code shows how to require students to simplify a difference quotient. |
This PG code shows how to require students to simplify a difference quotient. |
||
− | <ul> |
||
− | <li>Download file: [[File:DifferenceQuotient1.txt]] (change the file extension from txt to pg when you save it)</li> |
||
− | <li>File location in NPL: <code>NationalProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1.pg</code></li> |
||
− | </ul> |
||
</p> |
</p> |
||
+ | <!--* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1.pg NationalProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1.pg] --> |
||
+ | * PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1_PGML.pg FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1_PGML.pg] |
||
+ | <br clear="all" /> |
||
<p style="text-align:center;"> |
<p style="text-align:center;"> |
||
[[SubjectAreaTemplates|Templates by Subject Area]] |
[[SubjectAreaTemplates|Templates by Subject Area]] |
||
Line 16: | Line 19: | ||
<tr valign="top"> |
<tr valign="top"> |
||
− | <th> PG problem file </th> |
+ | <th style="width: 50%"> PG problem file </th> |
<th> Explanation </th> |
<th> Explanation </th> |
||
</tr> |
</tr> |
||
Line 43: | Line 46: | ||
loadMacros( |
loadMacros( |
||
− | + | 'PGstandard.pl', |
|
− | + | 'MathObjects.pl', |
|
− | + | 'parserDifferenceQuotient.pl', |
|
+ | 'PGML.pl', |
||
+ | 'PGcourse.pl' |
||
); |
); |
||
− | |||
TEXT(beginproblem()); |
TEXT(beginproblem()); |
||
</pre> |
</pre> |
||
Line 65: | Line 67: | ||
<td style="background-color:#ffffdd;border:black 1px dashed;"> |
<td style="background-color:#ffffdd;border:black 1px dashed;"> |
||
<pre> |
<pre> |
||
− | Context( |
+ | Context('Numeric'); |
− | $limit = DifferenceQuotient( |
+ | $limit = DifferenceQuotient('2*x+h','h'); |
− | $fp = Compute( |
+ | $fp = Compute('2 x'); |
</pre> |
</pre> |
||
</td> |
</td> |
||
Line 85: | Line 87: | ||
<td style="background-color:#ffdddd;border:black 1px dashed;"> |
<td style="background-color:#ffdddd;border:black 1px dashed;"> |
||
<pre> |
<pre> |
||
− | Context()->texStrings; |
||
+ | BEGIN_PGML |
||
− | BEGIN_TEXT |
||
+ | [`` \frac{d}{dx} \big( x^2 \big) = \lim_{h \to 0} \frac{(x+h)^2-x^2}{h} |
||
− | Simplify and then evaluate the limit. |
||
+ | = \lim_{h \to 0} \big(``][_______________]{$limit}[`` \big) = ``] |
||
− | $BR |
||
+ | [_______________]{$fp} |
||
− | $BR |
||
+ | |||
− | \( \displaystyle |
||
+ | END_PGML |
||
− | \frac{d}{dx} \big( x^2 \big) |
||
− | = |
||
− | \lim_{h \to 0} \frac{(x+h)^2-x^2}{h} |
||
− | = |
||
− | \lim_{h \to 0} |
||
− | \big( |
||
− | \) |
||
− | \{ ans_rule(15) \} |
||
− | \( \big) = \) |
||
− | \{ ans_rule(15) \} |
||
− | END_TEXT |
||
− | Context()->normalStrings; |
||
</pre> |
</pre> |
||
<td style="background-color:#ffcccc;padding:7px;"> |
<td style="background-color:#ffcccc;padding:7px;"> |
||
<p> |
<p> |
||
<b>Main Text:</b> |
<b>Main Text:</b> |
||
− | </p> |
||
− | </td> |
||
− | </tr> |
||
− | |||
− | <!-- Answer evaluation section --> |
||
− | |||
− | <tr valign="top"> |
||
− | <td style="background-color:#eeddff;border:black 1px dashed;"> |
||
− | <pre> |
||
− | $showPartialCorrectAnswers = 1; |
||
− | |||
− | ANS( $limit->cmp() ); |
||
− | ANS( $fp->cmp() ); |
||
− | </pre> |
||
− | <td style="background-color:#eeccff;padding:7px;"> |
||
− | <p> |
||
− | <b>Answer Evaluation:</b> |
||
</p> |
</p> |
||
</td> |
</td> |
||
Line 133: | Line 106: | ||
<td style="background-color:#ddddff;border:black 1px dashed;"> |
<td style="background-color:#ddddff;border:black 1px dashed;"> |
||
<pre> |
<pre> |
||
− | Context()->texStrings; |
||
+ | BEGIN_PGML_SOLUTION |
||
− | BEGIN_SOLUTION |
||
− | ${PAR}SOLUTION:${PAR} |
||
Solution explanation goes here. |
Solution explanation goes here. |
||
− | END_SOLUTION |
||
+ | END_PGML_SOLUTION |
||
− | Context()->normalStrings; |
||
− | COMMENT(' |
+ | COMMENT('Uses PGML.'); |
ENDDOCUMENT(); |
ENDDOCUMENT(); |
||
Line 157: | Line 127: | ||
[[Category:Top]] |
[[Category:Top]] |
||
− | [[Category: |
+ | [[Category:Sample Problems]] |
+ | [[Category:Subject Area Templates]] |
Latest revision as of 08:19, 28 June 2023
This problem has been replaced with a newer version of this problem
Answer is a Difference Quotient
This PG code shows how to require students to simplify a difference quotient.
- PGML location in OPL: FortLewis/Authoring/Templates/DiffCalc/DifferenceQuotient1_PGML.pg
PG problem file | Explanation |
---|---|
Problem tagging: |
|
DOCUMENT(); loadMacros( 'PGstandard.pl', 'MathObjects.pl', 'parserDifferenceQuotient.pl', 'PGML.pl', 'PGcourse.pl' ); TEXT(beginproblem()); |
Initialization:
We need to include the macros file |
Context('Numeric'); $limit = DifferenceQuotient('2*x+h','h'); $fp = Compute('2 x'); |
Setup:
The routine |
BEGIN_PGML [`` \frac{d}{dx} \big( x^2 \big) = \lim_{h \to 0} \frac{(x+h)^2-x^2}{h} = \lim_{h \to 0} \big(``][_______________]{$limit}[`` \big) = ``] [_______________]{$fp} END_PGML |
Main Text: |
BEGIN_PGML_SOLUTION Solution explanation goes here. END_PGML_SOLUTION COMMENT('Uses PGML.'); ENDDOCUMENT(); |
Solution: |