## #1556 "assume":problems with fractions or multiples of %pi and %e

closed
nobody
5
2009-10-08
2008-12-30
Anonymous
No

I was trying to bound a variable within 0 and %pi/2, and I have notices that if the assumptions made with "assume" contain a fraction or a multiple of %pi or %e (I've tryed these for now) the results of a query made with "is" are wrong. Example

(%i1) assume(a>0,a<%pi/2);
%pi
(%o1) [a > 0, --- > a]
2
does not give a correct result if a query with "is" is done. In fact:

(%i2) is(a>%pi/2);
(%o2) false
(%i3) is(a>%pi);
(%o3) unknown

the %o3 "unknown" is wrong, it sholud be evaluated to false. The same problem if one, in example, defines a variable bounded within 0 and 2*%pi:

(%i6) assume(b>0,b<2*%pi);
(%o6) [b > 0, 2 %pi > b]
(%i7) is(b>3*%pi);
(%o7) unknown

also this is wrong, it should be false. Nothing wrong happens if:

(%i8) assume(c>0,c<%pi);
(%o8) [c > 0, c < %pi]
(%i9) is(c>2*%pi);
(%o9) false

There are the same problems with "assume" and fractions or multiples of %e.
Please note the different output of Maxima for the above assumptions:

(%i8) assume(c>0,c<%pi);
(%o8) [c > 0, c < %pi]

here is c that is defined as a function of %pi, but...

(%i1) assume(a>0,a<%pi/2);
%pi
(%o1) [a > 0, --- > a]
2
%i6) assume(b>0,b<2*%pi);
(%o6) [b > 0, 2 %pi > b]

here are %pi/2 and 2*%pi that seems to be redefined in function of a and b. Could be here the problem?

If this problem will be solved, could I hope one day to see this answer from "is":

assume(a>0,a<%pi/2);
is(sin(a)>0);
true

instead of the actual "unknown" :-)? It would be very useful if Maxima could understand the sign of trigonometric functions with the proper assumptions.

Stefano
f e r r i s t e a t g m a i l d o t c o m

## Discussion

• Nobody/Anonymous - 2008-12-30

I forgot to say that I am using Maxima 5.17.0, but on the Maxima mailing list Alexey Beshenov told me that also the CVS version has this problem. Sorry also for the bad formatting of %pi/2 in %o1 line, it is not very readable... I pasted a display2d enabled output, it should be read as
(%o1) [a > 0, %pi/2 > a]

• Dieter Kaiser - 2009-10-08

A routine learn-numer has been added with revision 1.58 of compar.lisp.

The examples of this bug report work as expected:

(%i1) assume(a>0,a<%pi/2);
(%o1) [a > 0,%pi/2 > a]

(%i2) is(a>%pi/2);
(%o2) false

(%i3) is(a>%pi);
(%o3) false

(%i4) assume(b>0,b<2*%pi);
(%o4) [b > 0,2*%pi > b]
(%i5) is(b>3*%pi);
(%o5) false

(%i10) assume(abs(x) < sin(1)+%e/2);
(%o10) [sin(1)+%e/2 > abs(x)]
(%i11) is(x<2*%e);
(%o11) true
(%i12) is(x>-2*%e);
(%o12) true

Closing this bug report as fixed.

Dieter Kaiser

• Dieter Kaiser - 2009-10-08
• status: open --> closed