WeBWorK Main Forum

Radical Simplify

Radical Simplify

by Adam Z -
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");

Context()->strings->add(none=>{},EmptySet=>{alias=>"none"});


$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()