The two expression should be equal but when I write bool(arcsin(x) == 2*arctan(x/(1+sqrt(1-x^2)))) it returns false.
Any clue - Why it does that? Any get around?
asked Nov 12 '10Shu
143 ● 3 ● 9 ● 18
I can answer the "why it does that" question, anyway: Sage follows Maxima's conventions on equality testing. That is, it only returns True if it's convinced the equality holds. "False" here translates as "False or unknown".
I actually couldn't find a good workaround-- I'm not sure what the right way to fake new rewrite rules is. I guess you could confirm that the lhs and rhs agree via something like this:
And if you had several cases where the "agree at one point and derivatives equal" trick works, you could put it in a function, maybe with something like this:
Warning: untested code! Will probably break when given unexpected input!
For some of the other cases mentioned in the comments, playing around with the trig_* functions and/or converting to exponential form works:
Asked: Nov 12 '10
Seen: 482 times
Last updated: Nov 16 '10
powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.