6.71 Assume problem (15.4.97)

6.71.1 Jaroslav Hajtmar
6.71.2 Robert Israel(21.4.97)
6.71.3 Willard, Daniel (DUSA) (23.4.97)
6.71.4 Robert Israel (24.4.97)

6.71.1 Jaroslav Hajtmar

I am a beginner to Maple V rel. 4 and a novice on Maple User Group. I have two "assume" questions.

1) I think, that "assume(...)" command has no influence on solving equations. Is it true?

for example :

> assume(x,real);assume(m,real); 
> eq:=x^2-m*x+1=0; # quadratic equation with reals coefs. 
 
                              2 
                      eq := x~  - m~ x~ + 1 = 0 
 
> ineqdiscr:=discrim(lhs(eq),x)>0; # for 2 real roots 
 
                                              2 
                      ineqdiscr := 0 < -4 + m~ 
 
> solve(ineqdiscr,m); 
 
     RealRange(-infinity, Open(-2)), RealRange(Open(2), infinity) 
 
> additionally(m,RealRange(Open(-2),Open(2))): 
#discrim < 0  => roots are complex, but it was assume(x,real) ... 
> solve(eq,x); 
 
                             2 1/2                       2 1/2 
        1/2 m~ + 1/2 (-4 + m~ )   , 1/2 m~ - 1/2 (-4 + m~ )
 

Why does Maple compute real roots? Assume(x,real) has no effect ? Or where is the mistake?

2) I want to use "assume" command for variable x from RealRange(-infinity, Open(-2)) or from RealRange(Open(2), infinity) (union intervals)

Is it possible?

6.71.2 Robert Israel(21.4.97)

| 1) I think, that "assume(...)" command has no influence on ...
 

It doesn’t restrict the values that "solve" will find. I wouldn’t quite say it "has no influence", because it may in fact influence transformations of the equations that occur in the process of solving them. For example:

> assume(x > 0); assume(y < 0); 
> solve(sqrt(x^2)=1, x); 
 
                       1 
 
> solve(sqrt(y^2)=1, y); 
 
                      -1
 

This is because sqrt(x^2) is simplified to x while sqrt(y^2) is simplified to -y (actually, before "solve" even starts).

| Why does Maple compute real roots? Assume(x,real) has no effect ?
 

It doesn’t cause Maple to check whether the results satisfy the assumptions.

Actually, Maple doesn’t even know whether or not sqrt(-4+m^2) is real.

> assume(m, RealRange(Open(-2),Open(2))); 
> is(sqrt(-4+m^2),real); 
                                      FAIL
 

although it does know that -4+m^2 < 0:

> is(-4+m^2 < 0); 
                                  true 
> is(-4+m^2 >= 0); 
                                  false
 

But even if it did know, it wouldn’t restrict the values obtained for x.

You can sometimes restrict the output of "solve" by including inequalities. For example:

> solve(x^4=1, x); 
                             1, -1, I, -I 
 
> solve({x^4=1, x < infinity}, x); 
 
                              {x = 1}, {x = -1}
 

However, this usually doesn’t work if there are symbolic parameters.

> assume(m > 0); 
> solve({x^4 = m, x < infinity}, x);
 

(No result is returned)

And, strangely enough (still with the same assumption on m):

> solve({x^4 = m^4, x < infinity}, x); 
 
                              {x = -m~}
 

(Note to Maple developers: this is a bug)

(No result in Maple V Release 5, U. Klein)

| 2) I want to use "assume" command for variable x from ...
 

Yes.

> assume(x, OrProp(RealRange(-infinity, Open(-2)), 
                                RealRange(Open(2),infinity)));
 

6.71.3 Willard, Daniel (DUSA) (23.4.97)

Be aware that "assume" carries no weight with "type". In BesselI(x,y), for example, the Maple routine requires y to be of type integer, and preceding its use with the command "assume(y,integer)" does not get past the typing check early in the program.

Stupid!. I have complained to Maple about it without any observable improvement.

6.71.4 Robert Israel (24.4.97)

Willard, Daniel (DUSA) <WillaD@hqda.army.mil> wrote:

| Be aware that "assume" carries no weight with "type". ...
 

Please clarify your complaint. I would insist that "assume" should _not_ carry any weight with "type": "type" must distinguish between, for example, variables and numbers. A variable is still a variable, not a number, even when you assume its values are integers. If you want to know whether the value of a quantity is an integer, you can use "is", not "type".

As for BesselI, I presume you’re talking about the first argument, not the second, where integers are not particularly special. AFAIK it does not "insist" that the first argument is an integer either: Maple is perfectly happy to calculate, e.g.,

> BesselI(Pi, Pi); 
                              BesselI(Pi, Pi) 
> evalf(%); 
                               1.011423336
 

I guess your complaint may be with some of the automatic simplifications, e.g.

> BesselI(3, 0); 
                               0 
 
> assume(x, posint); BesselI(x,0); 
 
                               BesselI(x~, 0) 
> simplify(%); 
 
                               BesselI(x~, 0)
                                                                                    
                                                                                    
 

In that case, you do have a point.