[LON-CAPA-users] Rationalizing radical expressions to get a positive constant
Seema Ali
sali at vsb.bc.ca
Sun Mar 17 14:08:39 EDT 2013
Hi,
I'm trying to create a question that defines the domain and range of a square root function. The students need to define a square root function with those properties. I have it working for cases like:
sqrt(x-a) + b
c * sqrt(x-a) + b, where c>0
However I can't get it to work for sqrt(cx-ca) + b, where c>0
Below is the Math Response script I'm using. I tried using wrapping the trigsimp() with float(), which worked in Maxima but not in Lon Capa. Any suggestions are greatly appreciated.
<mathresponse cas="maxima" args="@custom" answerdisplay="<m eval='on'>c $answer</m>, where <m>c>0</m>">
<answer>f(x):=RESPONSE[1];
g(x):=LONCAPALIST[1];
b : LONCAPALIST[2];
boolNum : numberp(trigsimp((g(x)-b)/(f(x)-b)));
boolPos : trigsimp(trigreduce(factor(g(x)-b)/(f(x)-b))) > 0;
is(boolNum and boolPos);</answer>
<textline readonly="no" />
</mathresponse>
Thanks.
>From Seema.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.lon-capa.org/pipermail/lon-capa-users/attachments/20130317/13af8dd8/attachment.html>
More information about the LON-CAPA-users
mailing list