Skip to content

Commit 5efdba3

Browse files
committed
Fix bug 4877, convert to PGML, add solution
1 parent cc5e2bd commit 5efdba3

File tree

1 file changed

+79
-71
lines changed
  • OpenProblemLibrary/ASU-topics/setSecondDerivative

1 file changed

+79
-71
lines changed

OpenProblemLibrary/ASU-topics/setSecondDerivative/4-4-50.pg

+79-71
Original file line numberDiff line numberDiff line change
@@ -15,87 +15,95 @@
1515

1616
DOCUMENT(); # This should be the first executable line in the problem.
1717

18-
loadMacros(
19-
"PGstandard.pl",
20-
"extraAnswerEvaluators.pl",
21-
"PGcourse.pl"
22-
);
18+
loadMacros('PGstandard.pl', 'PGML.pl', 'contextFraction.pl', 'PGcourse.pl');
2319

20+
Context("Numeric");
2421
$a = random(2,7,1);
2522

26-
TEXT(beginproblem());
27-
2823
$showPartialCorrectAnswers = 1;
2924

30-
BEGIN_TEXT
25+
$crit = List(0,3*$a/4);
26+
27+
$maxima = List(String('None'));
28+
$minima = List(3*$a/4);
29+
$inflec = List(0,$a/2);
30+
31+
Context("Interval");
32+
$incr = Compute("(3*$a/4,Inf)");
33+
$decr = Compute("(-Inf,3*$a/4)");
34+
$up=Compute("(-Inf,0) U ($a/2,Inf)");
35+
$down=Interval(0,$a/2);
36+
37+
BEGIN_PGML
38+
(Where a question asks you to list values, separate the values by commas if there are more than one. If there are no values, enter *NONE*.)
3139

3240
Suppose that
33-
\( f(x) = x^4 - $a x^3 \).
34-
$PAR
35-
36-
(A) List all the critical values of \(f(x)\).
37-
Note: If there are no critical values, enter 'NONE'.
38-
$BR
39-
\{ans_rule(50)\}
40-
$PAR
41-
42-
(B) Use interval notation to indicate where \(f(x)\) is increasing.
43-
$BR
44-
$BBOLD Note: $EBOLD Use 'INF' for \(\infty\), '-INF' for \(-\infty\),
45-
and use 'U' for the union symbol.
46-
$BR
47-
Increasing: \{ans_rule(50)\}
48-
$PAR
49-
50-
(C) Use interval notation to indicate where \(f(x)\) is decreasing.
51-
$BR
52-
Decreasing: \{ans_rule(50)\}
53-
$PAR
54-
55-
(D) List the \(x\) values of all local maxima of
56-
\(f(x)\). If there are no local maxima, enter 'NONE'.
57-
$BR
58-
\(x\) values of local maximums = \{ans_rule(30)\}
59-
$PAR
60-
61-
62-
(E) List the \(x\) values of all local minima of
63-
\(f(x)\). If there are no local minima, enter 'NONE'.
64-
$BR
65-
\(x\) values of local minimums = \{ans_rule(30)\}
66-
67-
68-
(F) Use interval notation to indicate where \( f(x) \) is concave up.
69-
$BR
70-
Concave up: \{ans_rule(50)\}
71-
$PAR
72-
73-
(G) Use interval notation to indicate where \( f(x) \) is concave down.
74-
$BR
75-
Concave down: \{ans_rule(50)\}
76-
$PAR
77-
78-
(H) List the \(x\) values of all the inflection points of
79-
\(f\). If there are no inflection points, enter 'NONE'.
80-
$BR
81-
\(x\) values of inflection points = \{ans_rule(30)\}
82-
$PAR
41+
[` f(x) = x^4 - [$a] x^3 `].
42+
43+
(A) List all the critical values of [`f(x)`].
44+
45+
[_]{$crit}{50}
46+
47+
(B) Use interval notation to indicate where [`f(x)`] is increasing. [@ helpLink("interval") @]*
48+
49+
Increasing: [_]{$incr}{50}
50+
51+
(C) Use interval notation to indicate where [`f(x)`] is decreasing.
52+
53+
Decreasing: [_]{$decr}{50}
54+
55+
(D) List the [`x`] values of all local maxima of
56+
[`f(x)`].
57+
58+
[`x`] values of local maximums = [_]{$maxima}{30}
59+
60+
(E) List the [`x`] values of all local minima of
61+
[`f(x)`].
62+
63+
[`x`] values of local minimums = [_]{$minima}{30}
64+
65+
(F) Use interval notation to indicate where [` f(x) `] is concave up.
66+
67+
Concave up: [_]{$up}{50}
68+
69+
(G) Use interval notation to indicate where [` f(x) `] is concave down.
70+
71+
Concave down: [_]{$down}{50}
72+
73+
(H) List the [`x`] values of all the inflection points of
74+
[`f`].
75+
76+
[`x`] values of inflection points = [_]{$inflec}{30}
8377

8478
(I) Use all of the preceding information to sketch a
85-
graph of \(f\). When you're finished, enter a "1" in the box
79+
graph of [`f`]. When you're finished, enter a "1" in the box
8680
below.
87-
$BR \{ans_rule(10)\}
8881

89-
END_TEXT
82+
[_]{Real(1)}{10}
83+
84+
END_PGML
85+
86+
# Used in solution
87+
88+
Context("Fraction");
89+
$am3=3*$a;
90+
$am6=6*$a;
91+
$am3d4=Fraction($am3,4);
92+
$ad2=Fraction($a,2);
93+
94+
BEGIN_PGML_SOLUTION
95+
[``\begin{aligned}
96+
f'(x)&=4x^3-[$am3]x^2=x^2(4x-[$am3])\\
97+
f''(x)&=12x^2 - [$am6]x = x(12x-[$am6])
98+
\end{aligned}``]
99+
100+
so [`f'(x)=0`] when [`x=0`] or [``x=[$am3d4]``]. [`f'(x)`] is a polynomial so it is dedefined at every [`x`]. Thus there are two critical values, [`x=0`] and [``x=[$am3d4]``].
101+
102+
[``f'(x)\geq 0``] when [``x\geq [$am3d4]``] and [``f'(x)\leq 0``] when [``x\leq [$am3d4]``]. It follows that [`f(x)`] is increasing on the interval [`([$am3d4],\infty)`] and [`f(x)`] is decreasing on the interval [`(-\infty,[$am3d4])`].
103+
104+
Therefore [`f(x)`] has an absolute minimum at [`x=[$am3d4]`], and it has no local maxima.
90105

91-
ANS(number_list_cmp( "0, 3*$a/4" , strings=>["none"] ));
92-
ANS(interval_cmp("(3*$a/4,INF)"));
93-
ANS(interval_cmp("(-INF,3*$a/4)"));
94-
ANS(number_list_cmp( "none" , strings=>["none"] ));
95-
ANS(number_list_cmp( "3*$a/4" , strings=>["none"] ));
96-
ANS(interval_cmp("(-INF,0)U($a/2,INF)"));
97-
ANS(interval_cmp("(0,$a/2)"));
98-
ANS(number_list_cmp( "0, $a/2" , strings=>["none"] ));
99-
ANS(num_cmp(1));
106+
[`f''(x)=0`] when [`x=0`] and when [`x=[$ad2]`]. [`f''(x)<0`] when [`0<x<[$ad2]`], and [`f''(x)>0`] when [`x<0`] or [`x>[$ad2]`]. Thus [`f(x)`] is concave up on [`(-\infty,0)\cup([$ad2],\infty)`], concave down on [`(0,[$ad2])`], and it has inflection points where the concavity changes at [`x=0`] and [`x=[$ad2]`].
107+
END_PGML_SOLUTION
100108

101-
ENDDOCUMENT(); # This should be the last executable line in the problem.
109+
ENDDOCUMENT(); # This should be the last executable line in the problem.

0 commit comments

Comments
 (0)