Difference between revisions of "IndefiniteIntegrals1"

From WeBWorK_wiki
Jump to navigation Jump to search
(add historical tag and give links to newer problems.)
 
(5 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/IntegralCalc/IndefiniteIntegrals.html a newer version of this problem]</p>
  +
  +
 
<h2>Indefinite Integrals and General Antiderivatives</h2>
 
<h2>Indefinite Integrals and General Antiderivatives</h2>
   
 
[[File:IndefiniteIntegrals1.png|300px|thumb|right|Click to enlarge]]
 
[[File:IndefiniteIntegrals1.png|300px|thumb|right|Click to enlarge]]
<p style="background-color:#eeeeee;border:black solid 1px;padding:3px;">
+
<p style="background-color:#f9f9f9;border:black solid 1px;padding:3px;">
 
This PG code shows how to check answers that are indefinite integrals or general antiderivatives.
 
This PG code shows how to check answers that are indefinite integrals or general antiderivatives.
 
</p>
 
</p>
* Download file: [[File:IndefiniteIntegrals1.txt]] (change the file extension from txt to pg when you save it)
 
  +
* File location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/IntegralCalc/IndefiniteIntegrals1.pg FortLewis/Authoring/Templates/IntegralCalc/IndefiniteIntegrals1.pg]
* File location in NPL: <code>FortLewis/Authoring/Templates/IntegralCalc/IndefiniteIntegrals1.pg</code>
 
  +
* PGML location in OPL: [https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/FortLewis/Authoring/Templates/IntegralCalc/IndefiniteIntegrals1_PGML.pg FortLewis/Authoring/Templates/IntegralCalc/IndefiniteIntegrals1_PGML.pg]
 
   
 
<br clear="all" />
 
<br clear="all" />
Line 17: Line 21:
   
 
<tr valign="top">
 
<tr valign="top">
<th> PG problem file </th>
+
<th style="width: 40%"> PG problem file </th>
 
<th> Explanation </th>
 
<th> Explanation </th>
 
</tr>
 
</tr>
Line 44: Line 48:
   
 
loadMacros(
 
loadMacros(
"PGstandard.pl",
+
'PGstandard.pl',
"MathObjects.pl",
+
'MathObjects.pl',
"AnswerFormatHelp.pl",
+
'parserFormulaUpToConstant.pl',
"parserFormulaUpToConstant.pl",
+
'PGML.pl',
  +
'PGcourse.pl'
 
);
 
);
   
Line 93: Line 97:
 
<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
 
  +
+ Enter a specific antiderivative for [` e^x `]: [____________]{$specific->cmp(upToConstant=>1)}
Enter a specific antiderivative for \( e^x \):
 
  +
\{ ans_rule(20) \}
 
  +
+ Enter the most general antiderivative for [` e^x `]: [____________]{$general}
\{ AnswerFormatHelp("formulas") \}
 
  +
$BR
 
  +
[@ helpLink('formulas') @]*
$BR
 
  +
END_PGML
Enter the most general antiderivative for \( e^x \):
 
\{ ans_rule(20) \}
 
\{ AnswerFormatHelp("formulas") \}
 
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( $specific->cmp(upToConstant=>1) );
 
 
ANS( $general->cmp() );
 
</pre>
 
<td style="background-color:#eeccff;padding:7px;">
 
<p>
 
<b>Answer Evaluation:</b>
 
For the specific antiderivative, we must use <code>upToConstant=>1</code>, otherwise the only answer that will be marked correct will be <code>e^x</code>.
 
 
</p>
 
</p>
 
</td>
 
</td>
Line 137: Line 117:
 
<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('MathObject version.');
 
   
 
ENDDOCUMENT();
 
ENDDOCUMENT();
Line 162: Line 137:
   
 
[[Category:Top]]
 
[[Category:Top]]
[[Category:Authors]]
+
[[Category:Sample Problems]]
  +
[[Category:Subject Area Templates]]

Latest revision as of 06:13, 18 July 2023

This article has been retained as a historical document. It is not up-to-date and the formatting may be lacking. Use the information herein with caution.

This problem has been replaced with a newer version of this problem


Indefinite Integrals and General Antiderivatives

Click to enlarge

This PG code shows how to check answers that are indefinite integrals or general antiderivatives.


Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT();

loadMacros(
  'PGstandard.pl',
  'MathObjects.pl',
  'parserFormulaUpToConstant.pl',
  'PGML.pl',
  'PGcourse.pl'
);

TEXT(beginproblem());

Initialization:

Context("Numeric");

$specific = Formula("e^x");

$general = FormulaUpToConstant("e^x");

Setup: Examples of specific and general antiderivatives:

  • Specific antiderivatives: e^x, e^x + pi
  • General antiderivatives: e^x + C, e^x + C - 3, e^x + K

The specific antiderivative is an ordinary formula, and we check this answer, we will specify that it be a formula evaluated up to a constant (see the Answer Evaluation section below). For the general antiderivative, we use the FormulaUpToConstant() constructor provided by parserFormulaUpToConstant.pl.

BEGIN_PGML
+ Enter a specific antiderivative for [` e^x `]: [____________]{$specific->cmp(upToConstant=>1)}

+ Enter the most general antiderivative for [` e^x `]: [____________]{$general}

[@ helpLink('formulas') @]*
END_PGML

Main Text:

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();

Solution:

Templates by Subject Area