possible bug involving absolute value of sin function and assume

i like this post (click again to cancel)
0
i dont like this post (click again to cancel)
sage: a=var('a')
sage: assume(a>0)
sage: view(sqrt(a*a).simplify_full())
sage: theta=var('theta')
sage: assume(theta>0)
sage: assume(theta<pi)
sage: view(sqrt(sin(theta)*sin(theta)).simplify_full())

The answer for the first one is $a$ as it should be. However, for the second one I get $|\sin(\theta)|$. Considering that I have already assumed $0<\theta<\pi$, I should not have got the absolute sign. Is this a bug? And is there a way to get around it?

asked Dec 07 '10

Shashank gravatar image Shashank flag of United States
1730 9 30 62

updated Dec 07 '10

Evgeny gravatar image Evgeny
51 1 4 11
i like this answer (click again to cancel)
0
i dont like this answer (click again to cancel)

The Maxima assumption framework is fairly weak:

sage: maxima_console()
<snip>
Maxima 5.22.1 http://maxima.sourceforge.net
using Lisp ECL 10.4.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) assume(theta>0);
(%o1)                             [theta > 0]
(%i2) assume(theta<%pi);
(%o2)                            [theta < %pi]
(%i3) sqrt(sin(theta)*sin(theta));
(%o3)                           abs(sin(theta))

Quoted here: "Maxima's deduction mechanism is not very strong; there are many obvious consequences which cannot be determined by is. This is a known weakness."

Of course,

(%i4) assume(sin(theta)>0);
(%o4)                          [sin(theta) > 0]
(%i5) sqrt(sin(theta)*sin(theta));
(%o5)                             sin(theta)

so

sage: assume(sin(theta)>0)
sage: sqrt(sin(theta)*sin(theta))
sqrt(sin(theta)^2)
sage: _.simplify_full()
sin(theta)

in case that helps.

link

posted Dec 07 '10

kcrisman gravatar image kcrisman
7802 20 78 170

Your answer

Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
Login/Signup to Post

Question tools

Tags:

Stats:

Asked: Dec 07 '10

Seen: 185 times

Last updated: Dec 07 '10

powered by ASKBOT version 0.7.22
Copyright Sage, 2010. Some rights reserved under creative commons license.