Skip to content

Commit d04341f

Browse files
authored
Merge pull request #922 from drdrew42/update-interval
Unify answer blanks for interval
2 parents b4bf124 + 1c1d0c2 commit d04341f

File tree

1 file changed

+14
-25
lines changed

1 file changed

+14
-25
lines changed

OpenProblemLibrary/UCSB/Stewart5_7_8/Stewart5_7_8_59.pg

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,38 +15,27 @@ DOCUMENT();
1515

1616
loadMacros(
1717
"PGstandard.pl",
18-
"PGchoicemacros.pl",
18+
"PGML.pl",
1919
"PGcourse.pl"
2020
);
2121

22-
TEXT(&beginproblem);
2322
$showPartialCorrectAnswers = 1;
24-
$a=random(1,10,1)*random(-1,1,2);
25-
$b=random(1,10,1)*random(-1,1,2);
26-
$c=random(1,10,1)*random(-1,1,2);
23+
Context("Numeric")->variables->are(p => ['Real', limits=>[0,8]]);
2724

28-
BEGIN_TEXT
25+
BEGIN_PGML
2926

30-
$PAR
31-
(a) Find the values of \(p\) for which the following integral converges:
32-
\[\int_{0}^{\,1} {x^p \ln(x)}\, dx\]
27+
[```\int_{0}^{\,1} {x^p \ln(x)}\, dx```]
3328

34-
Input your answer by writing it as an interval. Enter brackets or parentheses in the first and fourth blanks as appropriate, and enter the interval endpoints in the second and third blanks. Use INF and NINF (in upper-case letters) for positive and negative infinity if needed. If the improper integral diverges for all \(p\), type an upper-case "D" in every blank.
29+
a. Find the values of [`p`] for which the integral converges.
30+
31+
The integral converges for all values of [`p`] in the interval: [_]{Interval("(-1,inf)")}
32+
33+
[$HR]*
34+
35+
a. For the values of [`p`] at which the integral converges, evaluate it.
36+
37+
[``\int_{0}^{\,1} {x^p \ln(x)}\, dx =``] [_]{Formula("-1/(p+1)^2")}
3538

36-
$PAR
37-
Values of \(p\) are in the interval \{ans_rule(1)\} \{ans_rule(8)\}, \{ans_rule(8)\} \{ans_rule(1)\}
38-
39-
$PAR$HR$PAR
40-
For the values of \(p\) at which the integral converges, evaluate it.
41-
42-
Integral = \{ans_rule(30)\}
43-
44-
END_TEXT
45-
46-
ANS(str_cmp("("));
47-
ANS(std_num_str_cmp("-1", ["NINF","INF"]));
48-
ANS(std_num_str_cmp("INF", ["NINF","INF"]));
49-
ANS(str_cmp(")"));
50-
ANS(fun_cmp("-1/(p+1)^2", var=>["p"], limits=>[0,8]));
39+
END_PGML
5140

5241
ENDDOCUMENT();

0 commit comments

Comments
 (0)