What is the rationale (not rational :) ) for simplifying asin(sin(x)) to x ?
I suppose one rationale is that you haven't really looked at the consequence
and therefore think it is a good idea. But it is a bad idea.
Also log(exp(x)) --> x is a bad idea. The reason is, asin and log are
multi-valued and if you (or the simplifier) chooses a particular value,
behind the scenes, in the middle of a computation, and it is the wrong
one, then the answer comes out wrong. It's this kind of design that
makes it possible to get a CAS to prove 0=1, or any other false
proposition, using "puzzles"
Actually, choosing the "wrong" sqrt gets you a quick proof, without
even using log or asin.
Now what if you say x is in (-pi, pi] What can you
say about asin(sin(x))? Well, it depends on whether you want to
be mathematically correct, or not. choose x=0, for example.
sin(x) is also 0. No argument.,
asin(0) is ... what? it is any angle whose sine is 0. That includes
n*pi for any integer n. But But ... what if we assume x is in that
interval??
It DOESN'T MATTER. asin(0) is still multi-valued,
If you wanted to say that this particular answer from this particular
asin() was in (-pi,pi], then you might run with that. But that
means that
asin(sin(x+pi)) will come out as x. And in particular,
asin(sin(y))=y is sometimes FALSE, with y=x+pi,
asin(sin(y))= y-pi.
Now all of this is based on the hypothesis that you would
try to have sympy produce the correct answer, as opposed
to the answer that seems "obvious to even a high school student".
Other computer algebra systems may or may not do the right
thing. I just tried Maxima and Mathematica
-- asin(sin(x)) remains. sin(asin(x)) is x,
which is correct. asin(sin(0)) is simplified to 0. yech.
It's a problem if you have no convenient way of dealing with
sets like {n*pi | n in integers} throughout your system. (
those systems can represent such things, but I expect
will not treat them as first class objects.) Sympy can do
the same thing, do worse, or do better. Doing better
is difficult, I think.