There is certainly an opportunity to write a program that works like this:

to simplify abs(f(x))  test to see if f(x)  is real for all possible values 
of x.
then find some g(x)  such that g(x)^2=f(x).  That is,  f(x) is a perfect 
square.

In such a case abs(f(x)) is equal to f(x).

It has rather little to do with sin(x) --- just that sin(x) is real for 
real x.
and hence sin(x)^2 is real.  So it is an issue with abs, hardly much to do
with  trig simplification in particular.

In many cases the appearance of abs()  is bogus in the first place, being
inserted in places such as    sqrt(x^2)) --> abs(x), which replaces an 
algebraic
function with a non-algebraic one with a discontinuous derivative.

RJF





On Monday, July 1, 2013 12:37:00 PM UTC-7, Joris Vankerschaver wrote:
>
>
>
> On Friday, February 15, 2013 11:31:41 AM UTC, Julius wrote:
>>
>>
>> With sage 5.6
>> sage: assume(x, 'real')              
>> sage: (abs(sin(x))^2).simplify_full()
>> abs(sin(x))^2
>>
>> For trigonometric simplifications, this is very inconvenient. For example
>> sage: (abs(sin(x))^2 + abs(cos(x))^2).simplify_full().simplify_trig()
>> abs(sin(x))^2 + abs(cos(x))^2
>>
>>
> I totally agree that this is very inconvenient. When faced with a trig 
> problem it doesn't take a lot of symbolic manipulations to arrive at 
> something which is full of these expressions, and if we have no way of 
> doing these obvious simplifications then that limits the usefulness of 
> doing symbolic manipulations. For instance, the majority of the docstrings 
> in trac #10132 now fail, for no good mathematical reason.
>
> The behavior is also inconsistent, for reasons that I don't fully get. For 
> instance, this will fail: 
>
> sage: u = var('u')
> sage: assume(u, 'real')
> sage: (abs(cos(u))^2 + abs(sin(u))^2).simplify_trig()
> abs(sin(u))^2 + abs(cos(u))^2
>
> but this will work: 
>
> sage: u = var('u', domain='real')
> sage: (abs(cos(u))^2 + abs(sin(u))^2).simplify_trig()
> 1 
>
> I don't know enough about the Maxima interface and the assumptions that 
> went into changing this behavior from sage 5.5 to 5.6, but is there maybe a 
> way we can set domain to real for symbolic functions over the reals before 
> passing the whole thing to maxima for the simplification?
>
> J.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to