WeBWorK Problems

Formula not evaluating correctly when it is indentically 0

Formula not evaluating correctly when it is indentically 0

by Paul Seeburger -
Number of replies: 0
I am working on a Diff. Eq. problem involving a Wronskian determinant.

The result is a difference of two terms involving exponentials (see below) that is identically 0 for all x (or should be).  However, credit is not being given when the student enters 0, unless I restrict the test points as I show below.  In fact, it does not even consistently work when in include a [2] in the list of test points.

Can anyone explain why this is happening?

$a = random(2,6,1);
$b = random(1,5,1);

$a11 = Formula("e^($a x)");
$a12 = Formula("e^($a x + $b)");
$a21 = Formula("$a e^($a x)");
$a22 = Formula("$a e^($a x + $b)");

$wronskian = $a11 * $a22 - $a12 * $a21; 
$wronskian->{test_points} = [[-1],[0],[1]];  # Why is this line necessary to make 0 evaluate as the correct answer?

...

WEIGHTED_ANS( $wronskian->cmp(), 40 );

Thanks!

Paul