Skip to content

Commit b634c7b

Browse files
committed
Update Union IBP problem to PGML, and improve randomization
1 parent b28e69f commit b634c7b

File tree

1 file changed

+10
-35
lines changed

1 file changed

+10
-35
lines changed

OpenProblemLibrary/Union/setIntByParts/sc5_6_01.pg

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,48 +16,23 @@
1616
## MO(1)
1717
## KEYWORDS('calculus','integration','integration by parts')
1818

19-
DOCUMENT(); # This should be the first executable line in the problem.
19+
DOCUMENT(); # This should be the first executable line in the problem.
2020

21-
loadMacros(
22-
"PGstandard.pl",
23-
"PGunion.pl",
24-
"MathObjects.pl",
25-
"PGcourse.pl"
26-
);
21+
loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl');
2722

28-
TEXT(beginproblem());
29-
30-
###################################
3123
# Setup
3224

33-
$a = random(2,4,1);
34-
35-
$integrand=Formula(" x e^{$a x} ");
25+
$a = random(2, 9, 1);
26+
$integrand = Formula(" x e^{$a x} ");
3627

37-
###################################
38-
# Main text
28+
Context()->flags->set(reduceConstants => 0);
29+
$antideriv = Formula("1/$a (x e^(${a}x) - 1/$a e^(${a}x))");
3930

40-
Context()->texStrings;
41-
BEGIN_TEXT
31+
BEGIN_PGML
4232
Evaluate the indefinite integral.
43-
$PAR
44-
\( \displaystyle\int $integrand \, dx \)
45-
= \{ans_rule(50)\} \( + C\).
46-
END_TEXT
47-
Context()->normalStrings;
48-
49-
###################################
50-
# Answers
51-
52-
$showPartialCorrectAnswers = 1;
53-
Context()->flags->set(reduceConstants=>0);
54-
55-
$antideriv = Formula( "1/$a (x e^(${a}x) - 1/$a e^(${a}x))");
56-
57-
ANS($antideriv->cmp(upToConstant=>1));
58-
59-
###################################
6033

34+
[``\int [$integrand] \, dx ``]=
35+
[_]{$antideriv->cmp(upToConstant=>1)}{50} [` + C`].
36+
END_PGML
6137

62-
;
6338
ENDDOCUMENT();

0 commit comments

Comments
 (0)