# [LON-CAPA-users] square roots in formula response

Peter Riegler lon-capa-users@mail.lon-capa.org
Mon, 03 Sep 2007 21:21:12 +0200

Hi Justin,

does "elegant" include two seperate input fields, for demoninator and
numerator? Or did you come up with two input fields because otherwise
the lhs (i.e. non-rationalized) would be accepted if using sampling?
If so, I would suggest something like
<formularesponse answer="(m - 4)*(sqrt(m) + 4)/(m-16)">

(I would prefer the students enter sqrt(m) rather than sqrtm).

What the above does is to ask maxima
is( STUDENTSRESPONSE = (m - 4)*(sqrt(m) + 4)/(m-16));

The important point here is that a student's reponse
(m-4)/(sqrt(m)-4)
would return false. The reason is, maxima does not simplify before
comparison.

Hope this will help.

Peter

Justin Gray wrote:

> Does anyone know a more elegant way to write the problem below?
>
> Thanks,
> Justin
>
> <problem>
> <startouttext />Rationalize the denominator and simplify:<p></p><br></br>
> Use sqrtm for <m display = jsmath>$\sqrt{m}</m>.<p></p> > <table> > > <tr> > <td><m display="jsMath">\, \, \, \,$m - 4$</m></td> <td></td> > <td><endouttext /> > <formularesponse samples="m,sqrtm@-3,-3:3,3#5" answer="(m - 4)(sqrtm + > 4)" id="11"> > > <textline readonly="no" size="20" /> > > </formularesponse><startouttext /></td> > </tr> > <tr> > <td><hr width="60"></hr></td> <td><m display="jsMath">$\mbox{ } =
> \mbox{ }$</m></td> <td><hr width="140"></hr></td> > </tr> > <tr> > <td><m display="jsMath">$\sqrt{m} - 4\$</m></td> <td></td>
> <td><endouttext />
> <formularesponse samples="m@-3:3#5" answer="m - 16" id="12">
>
>
> </formularesponse><startouttext /></td>
> </tr>
> </table><p></p><endouttext />
> </problem>
>
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Justin Gray                                                  Tel.
> 778-782-4237
> Dept. of Mathematics                                   Fax. 778-782-4947
> Simon Fraser University
> 8888 University Drive
> Burnaby, B.C. V5A 1S6