## WeBWorK Problems

### Re: Passing a root into a fraction

by Gregory Varner -
Number of replies: 0

I figured this out so I thought I would update. It was much easier than I was thinking.

I used the following snippet:

Context("Numeric");

Context()->variables->add(s=>"Real");

Context()->flags->set(reduceConstants=>0,reduceConstantFunctions=>0);

$ans1 = Formula("(-$b+sqrt(s))/(2*$a)")->reduce;$ans1 = $ans1->substitute(s=>$discr);

Worked like a charm!