we have a seemingly simple problem with computing an integral. The webwork pg files gives one answer but a Matlab check gives another. I'd bet the webwork code has an error that I'm missing but I need some help finding it.
Webwork gives −23442.8571428571" role="presentation">−23442.8571428571
Matlab gives
>> c=-6;d=2;cc=3;liml2=-3;limu2=3;
>> ans2 = ((c^2)/(2*cc+1))*(limu2^(2*cc+1) - liml2^(2*cc+1))+ (d^2)*(limu2-liml2) +((2*d*c)/(cc + 1))*(limu2^(cc+1)-liml2^(cc+1))
ans2 = 2.2519e+04
>> ans2 = ((c^2)/(2*cc+1))*(limu2^(2*cc+1) - liml2^(2*cc+1))+ (d^2)*(limu2-liml2) +((2*d*c)/(cc + 1))*(limu2^(cc+1)-liml2^(cc+1))
ans2 = 2.2519e+04
The pg file seems simple enough
DOCUMENT(); # This should be the first executable line in the problem.
loadMacros(
#"PGbasicmacros.pl",
#"PGanswermacros.pl",
#"PGauxiliaryFunctions.pl",
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl",
"PGcourse.pl",
"answerHints.pl"
);
$showPartialCorrectAnswers = 1;
# seed = 2491
$c = Real(-6);
$d = Real(2);
$cc = Real(3);
$liml2 = Real(-3);
$limu2 = Real(3);
BEGIN_TEXT
$BBOLD Definite Integrals of Basic Functions $EBOLD
$PAR
Calculate the following definite integrals
$PAR
$BBOLD b) $EBOLD \( \displaystyle \int_{$liml2}^{$limu2} ($c t^{$cc} + $d)^2 \, dt\) = \{ ans_rule()\}
END_TEXT
$ans2 = "(($c^2)/(2*$cc+1))*($limu2^(2*$cc+1) - $liml2^(2*$cc+1))
+ ($d^2)*($limu2-$liml2) +
((2*$d*$c)/($cc + 1))*($limu2^($cc+1)-$liml2^($cc+1))";
ANS(num_cmp($ans2));
ENDDOCUMENT(); # This should be the last executable line in the problem.
loadMacros(
#"PGbasicmacros.pl",
#"PGanswermacros.pl",
#"PGauxiliaryFunctions.pl",
"PGstandard.pl",
"MathObjects.pl",
"AnswerFormatHelp.pl",
"PGcourse.pl",
"answerHints.pl"
);
$showPartialCorrectAnswers = 1;
# seed = 2491
$c = Real(-6);
$d = Real(2);
$cc = Real(3);
$liml2 = Real(-3);
$limu2 = Real(3);
BEGIN_TEXT
$BBOLD Definite Integrals of Basic Functions $EBOLD
$PAR
Calculate the following definite integrals
$PAR
$BBOLD b) $EBOLD \( \displaystyle \int_{$liml2}^{$limu2} ($c t^{$cc} + $d)^2 \, dt\) = \{ ans_rule()\}
END_TEXT
$ans2 = "(($c^2)/(2*$cc+1))*($limu2^(2*$cc+1) - $liml2^(2*$cc+1))
+ ($d^2)*($limu2-$liml2) +
((2*$d*$c)/($cc + 1))*($limu2^($cc+1)-$liml2^($cc+1))";
ANS(num_cmp($ans2));
ENDDOCUMENT(); # This should be the last executable line in the problem.
−23442.8571428571" role="presentation">
−23442.8571428571" role="presentation">Ma