## WeBWorK Problems

### Re: Questions about disabling/enabling functions

by Alex Jordan -
Number of replies: 0
Here is a version of the problem you posted before. Notes:

• it uses scaffold.pl for the parts of the problem. If you want to, you can set that so that the first part must be answered correctly before the student can reveal the second part.
• it uses contextForm.pl. I think this may sweep aside the concerns you have about students using sqrt.
• for the second answer, it uses a FormulaUpToConstant. Done this way, the student must type the "+C". Also, while you are expecting the formula to be "x sqrt(4 - x^2)/2 + 2 arcsin(x/2)", imagine somehow a student ends up with "x sqrt(4 - x^2)/2 + 2 arcsin(x/2) + 17". (17 is a little ridiculous but sometimes students legitimately end up with an expression differing from what was expected by some constant.) In the original version you posted, that would not be counted correct. Here, as long as they type the "+C" too, then "x sqrt(4 - x^2)/2 + 2 arcsin(x/2) + 17 + C" is still counted correct.

DOCUMENT();

PGstandard.pl
PGML.pl
contextForm.pl
parserFormulaUpToConstant.pl
scaffold.pl
PGcourse.pl
));

Context()->variables->set(x => {limits => [-2,2]});
Context()->variables->set(t => {limits => [-pi/2,pi/2]});

$f = Formula("sqrt(4-x^2)");$ans3 = Formula("4 cos(t)^2");
$ans4 = FormulaUpToConstant("x sqrt(4 - x^2)/2 + 2 arcsin(x/2)"); BEGIN_PGML The goal of this problem is to evaluate [\int [$f]\;dx] using trig substitution.
END_PGML

Scaffold::Begin(numbered => 1);
Section::Begin("Use substitution");
BEGIN_PGML
Make an appropriate substitution.

[\int\;[$f]\;dx = \int][_]{$ans3}{12}[\;dt]
END_PGML
Section::End();

Section::Begin("Evaluate and back-substitute");
BEGIN_PGML
Evaluate the trig integral and substitute back in terms of [x].

[\int [$f]\;dx] = [_]{$ans4}{12}
END_PGML
Section::End();
Scaffold::End();
ENDDOCUMENT();