STACK: Problem with sqrt and sin/cos

STACK: Problem with sqrt and sin/cos

by Mikko Vasko -
Number of replies: 1

Hi,

we are experiencing the following problem with STACK (and with Maxima):

The correct solution of a problem is

sqrt(25-5*sin(x)^2)

The student wrote the answer in the form:

sqrt(5)*sqrt(4+cos(x)^2)

but this is not accepted by STACK.

sqrt(5*(4+cos(x)^2)   is also not accepted.
sqrt(20+5*cos(x)^2)   is, however, accepted.
I tried adding radcan to both sAns and tAns, but it didn't help.

Any ideas?

Cheers,

Mikko

Average of ratings: -
In reply to Mikko Vasko

Re: STACK: Problem with sqrt and sin/cos

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Yes, 

This sort of thing is a problem, and there are already some known things which STACK does not think are equal but which I do.  E.g. sqrt(108)+10)^(1/3)-(sqrt(108)-10)^(1/3) and 2  [Actually this is Cardano's example from Ars Magna...]

I've added your very helpful examples to the list of "known fails" for now, and will try to improve this.  Testing for zero turns out to be very hard in general, when you don't know anything about the expressions.

What you can do in this case is use Maxima's "zeroequiv" function on the difference and test for equality with "true".

However, in general, zeroequiv introduces lots of false positives in my view.  Try

zeroequiv(x-sqrt(x^2),x);
zeroequiv(abs(x)-x,x);

which is why I didn't use this STACK in the first place!  You may have other problems with this approach.