|
16 | 16 | ## MO(1) |
17 | 17 | ## KEYWORDS('calculus','integration','integration by parts') |
18 | 18 |
|
19 | | -DOCUMENT(); # This should be the first executable line in the problem. |
| 19 | +DOCUMENT(); # This should be the first executable line in the problem. |
20 | 20 |
|
21 | | -loadMacros( |
22 | | - "PGstandard.pl", |
23 | | - "PGunion.pl", |
24 | | - "MathObjects.pl", |
25 | | - "PGcourse.pl" |
26 | | -); |
| 21 | +loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl'); |
27 | 22 |
|
28 | | -TEXT(beginproblem()); |
29 | | - |
30 | | -################################### |
31 | 23 | # Setup |
32 | 24 |
|
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} "); |
36 | 27 |
|
37 | | -################################### |
38 | | -# Main text |
| 28 | +Context()->flags->set(reduceConstants => 0); |
| 29 | +$antideriv = Formula("1/$a (x e^(${a}x) - 1/$a e^(${a}x))"); |
39 | 30 |
|
40 | | -Context()->texStrings; |
41 | | -BEGIN_TEXT |
| 31 | +BEGIN_PGML |
42 | 32 | Evaluate the indefinite integral. |
43 | | -$PAR |
44 | | -\( \displaystyle\int $integrand \, dx \) |
45 | | - = \{ans_rule(50)\} \( + C\). |
46 | | -END_TEXT |
47 | | -Context()->normalStrings; |
48 | 33 |
|
49 | | -################################### |
50 | | -# Answers |
| 34 | +[``\int [$integrand] \, dx ``]= |
| 35 | +[_]{$antideriv->cmp(upToConstant=>1)}{50} [` + C`]. |
| 36 | +END_PGML |
51 | 37 |
|
52 | | -$showPartialCorrectAnswers = 1; |
53 | | -Context()->flags->set(reduceConstants=>0); |
| 38 | +BEGIN_PGML_SOLUTION |
| 39 | +Calculate the integral using integration by parts. |
54 | 40 |
|
55 | | -$antideriv = Formula( "1/$a (x e^(${a}x) - 1/$a e^(${a}x))"); |
| 41 | +Let [`u=x`] and [`dv=e^{[$a]x}dx`] |
56 | 42 |
|
57 | | -ANS($antideriv->cmp(upToConstant=>1)); |
| 43 | +Then [`du=dx`] and [`v=\frac{1}{[$a]}e^{[$a]x}`]. |
58 | 44 |
|
59 | | -################################### |
| 45 | +[``\int u\,dv=uv-\int v\,du``], so |
60 | 46 |
|
| 47 | +[``\begin{eqnarray}\int xe^{[$a]x}\,dx & = & x\left(\frac{1}{[$a]}e^{[$a]x}\right)-\int \frac{1}{[$a]}e^{[$a]x}\,dx\\ |
| 48 | +& = & \frac{1}{[$a]}\left(xe^{[$a]x}-\int e^[$a]x\,dx\right)+C\\ |
| 49 | +& = & \frac{1}{[$a]}\left(xe^{[$a]x}-\frac{1}{[$a]} e^[$a]x\,dx\right)+C |
| 50 | +\end{eqnarray}``] |
| 51 | +END_PGML_SOLUTION |
61 | 52 |
|
62 | | -; |
63 | 53 | ENDDOCUMENT(); |
0 commit comments