## WeBWorK Main Forum

Number of replies: 0

I have a problem with this code. It does not simplify the fraction and does not multiply radicals. Advice please

Context("Numeric");

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

$c = random(2,7,1);$d = random(3,11,2);

$ans = Compute("(($a-sqrt($d))*($b+sqrt($c)))/($b^2-$c)");; ######################################################################## Context()->texStrings; BEGIN_TEXT Simplify $\frac{a-\sqrt(d)}{b-\sqrt{c}}.$$PAR

\{ ans_rule(30) \}

END_TEXT

Context()->normalStrings;

ANS( \$ans->cmp() );

ENDDOCUMENT()