IndefiniteIntegrals1

From WeBWorK_wiki
Revision as of 22:08, 1 December 2010 by Pearson (talk | contribs) (Created page with '<h2>Indefinite Integrals and General Antiderivatives</h2> <p style="background-color:#eeeeee;border:black solid 1px;padding:3px;"> This PG code shows how to check answers that a…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Indefinite Integrals and General Antiderivatives

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

  • Download file: File:IndefiniteIntegrals1.txt (change the file extension from txt to pg when you save it)
  • File location in NPL: NationalProblemLibrary/FortLewis/Authoring/Templates/IntegralCalc/IndefiniteIntegrals1.pg

Templates by Subject Area

PG problem file Explanation

Problem tagging data

Problem tagging:

DOCUMENT();

loadMacros(
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl",
"parserFormulaUpToConstant.pl",
);

TEXT(beginproblem());

Initialization:

Context("Numeric");

#
#  Specific antiderivative:
#  Marks correct e^x, e^x + pi, etc
#
$specific = Formula("e^x")->flags(upToConstant=>1);

#
#  General antiderivative
#  Marks correct e^x + C, e^x + C - 3, e^x + K, etc.
#
$general = FormulaUpToConstant("e^x");

Setup:

Context()->texStrings;
BEGIN_TEXT
Enter a specific antiderivative for \( e^x \): 
\{ ans_rule(20) \}
\{ AnswerFormatHelp("formulas") \}
$BR
$BR
Enter the most general antiderivative for \( e^x \): 
\{ ans_rule(20) \}
\{ AnswerFormatHelp("formulas") \}
END_TEXT
Context()->normalStrings;

Main Text:

$showPartialCorrectAnswers = 1;

ANS( $specific->cmp() );
ANS( $general ->cmp() );

Answer Evaluation:

Context()->texStrings;
BEGIN_SOLUTION
${PAR}SOLUTION:${PAR}
Solution explanation goes here.
END_SOLUTION
Context()->normalStrings;

COMMENT('MathObject version.');

ENDDOCUMENT();

Solution:

Templates by Subject Area