DOCUMENT();

loadMacros('PGstandard.pl', 'PGML.pl', 'PGcourse.pl');

Context()->variables->add(k => 'Real');
Context()->flags->set(
    reduceConstants         => 0,
    reduceConstantFunctions => 0,
    formatStudentAnswer     => 'parsed',
);

$a = random(6, 9);
$k = random(3, 5);

$f  = Formula('k x^2');
$fx = $f->D('x');

$ans1 = $fx;
$ans2 = $fx->substitute(k => $k);
$ans3 = $fx->substitute(x => $a * pi, k => $k);

BEGIN_PGML
Suppose [`f(x) = [$f]`] where [`k`] is a constant.

a. [`f'(x) =`] [_____]{$ans1}

b. If [`k = [$k]`] then [`f'(x) =`] [_____]{$ans2}

c. If [`k = [$k]`] then [`f'([$a]\pi) =`] [_____]{$ans3}
END_PGML

BEGIN_PGML_SOLUTION
Solution explanation goes here.
END_PGML_SOLUTION

ENDDOCUMENT();