sursumCorda

1109 Reputation

13 Badges

2 years, 10 days

MaplePrimes Activity


These are questions asked by sursumCorda

The output RealDomain:-solve(x**2 + 2*cos(x) = (Pi/3)**2 + 1, [x]) means that there is no real solution, but clearly, both x = -Pi/3 and x = +Pi/3 satisfy the original equation: 

So, why does `solve` lose the real solutions without any warning messages? 
Code: 

restart;
eq := 9*(x^2 + 2*cos(x)) = Pi^2 + 9;
RealDomain:-solve(eq, [x]);
                               []

:-solve({eq, x >= 0}, [x]); # as (lhs - rhs)(eq) is an even function 
                               []


Here are two systems over the reals:

sys__1:=And(r*(387*r+52)+2<r*(226*q+121*s)+9*q*(q*(2*q-5)-3*s+2)+6*s,4*q^3+r*(27*r+4)+s^2=q*(q+18*r),q>=0,r>=0):
sys__2:=And((392-1739*q)*r+4*(2-9*q)**2+2151*r**2<75*r*s,4*q**3+r*(27*r+4)+s**2=q*(q+18*r),q>=0,r>=0):

The following results indicate that both and are satisfiable 

QuantifierElimination:-QuantifierEliminate(exists([s,q,r],sys__1));
                              true
QuantifierElimination:-QuantifierEliminate(exists([s,q,r],sys__1));
                              true

but RealDomain:-solve simply returns an empty list (that is, no solution exists) in both cases

RealDomain:-solve(sys__1,[q,s,r]); # ⟹ sys1 cannot be satisfied
                               []
RealDomain:-solve(sys__2,[q,s,r]); # ⟹ sys2 cannot be satisfied
                               []

As discussed in the previous problem, in contrast to using QuantifierElimination:-QuantifierEliminate, the use of RealDomain:-solve is unsafe. Nevertheless, the above output suggests that even the much-more-sophisticated QuantifierElimination:-QuantifierEliminate is still not always reliable (since the correct returnedvalue appears to be in lieu of ). So, what is the right command to handle polynomial systems over real domains in Maple? 

The first time they are evaluated, some aborts can occur; the second time they are evaluated, no exception is thrown: 
 

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1806 and is the same as the version installed in this computer, created 2024, September 11, 11:27 hours Pacific Time.`

(1)

restart;

RootOf(
        9*x1-5+RootOf(8*_Z**2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808), x1, 171590466306199/562949953421312 .. 343180932612401/1125899906842624
);

Error, (in property/ProbablyNonZero) cannot determine if this expression is true or false: ln(.1e11*abs(-.304805898398896+1.*RealRange(.304805898398895,.304805898398897)))/ln(10) < -6

 

RootOf(
        9*x1-5+RootOf(8*_Z**2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808), x1, 171590466306199/562949953421312 .. 343180932612401/1125899906842624
);

5/9-(1/9)*RootOf(8*_Z^2+_Z-43, 41629632769253767815/18446744073709551616 .. 20814816384626883921/9223372036854775808)

(2)

RootOf(
        2*x1-3+RootOf(_Z**2+2*_Z-11, 181818607464242035159/73786976294838206464 .. 363637214928484070345/147573952589676412928), x1, 301683970796757/1125899906842624 .. 150841985398379/562949953421312
);

Error, (in property/ProbablyNonZero) cannot determine if this expression is true or false: ln(2500000000.*abs(-.267949192431123+1.*RealRange(.267949192431122,.267949192431123)))/ln(10) < -6

 

RootOf(
        2*x1-3+RootOf(_Z**2+2*_Z-11, 181818607464242035159/73786976294838206464 .. 363637214928484070345/147573952589676412928), x1, 301683970796757/1125899906842624 .. 150841985398379/562949953421312
);

3/2-(1/2)*RootOf(_Z^2+2*_Z-11, 181818607464242035159/73786976294838206464 .. 363637214928484070345/147573952589676412928)

(3)


 

Download run__twice.mw

Why does (the outer) RootOf have to be evaluated twice? 
Note. There are other similar examples, but they are less concise (so they are omitted here).

I have a quite complex expression (where and are real numbers): 

expr := Or(And(-p^2 + 3*q < 0, p < 0, p^2 - 4*q < 0, Or(And(p < 0, -q < 0), p < 0, q < 0), Or(And(-2*p^2 + 3*q < 0, -q^2 < 0), And(p <= 0, Or(-2*p^2 + 3*q < 0, q^2 < 0))), Or(And(Or(And(p < 0, -q < 0), p < 0, q < 0), Or(And(-2*p^2 + 3*q < 0, -q^2 < 0), And(p <= 0, Or(-2*p^2 + 3*q < 0, q^2 < 0)))), And(p < 0, -q < 0), p < 0, q < 0, And(2*p^2 - 3*q < 0, -q^2 < 0), And(-p <= 0, Or(2*p^2 - 3*q < 0, q^2 < 0))), -2*p^5 + 15*p^3*q - 27*p*q^2 <= 0, p^2*q^2 - 4*q^3 = 0), And(p^2 - 3*q = 0, p < 0, -2*p^2 + 3*q < 0, Or(And(p < 0, -2*p^2 + 3*q < 0), p < 0, 2*p^2 - 3*q < 0), 2*p^3 - 9*p*q = 0), And(-p^2 + 3*q < 0, Or(And(p < 0, p^2 - 4*q < 0), p < 0, -p^2 + 4*q < 0), p < 0, -q < 0, Or(And(-2*p^2 + 3*q < 0, -q^2 < 0), And(-p <= 0, Or(-2*p^2 + 3*q < 0, q^2 < 0))), Or(And(p < 0, -q < 0, Or(And(-2*p^2 + 3*q < 0, -q^2 < 0), And(-p <= 0, Or(-2*p^2 + 3*q < 0, q^2 < 0)))), And(p < 0, -q < 0), And(2*p^2 - 3*q < 0, -q^2 < 0), And(p <= 0, Or(2*p^2 - 3*q < 0, q^2 < 0))), 2*p^5 - 15*p^3*q + 27*p*q^2 <= 0, p^2*q^2 - 4*q^3 = 0)):

According to coulditbe, is satisfiable: 

_EnvTry := 'hard':
coulditbe(expr) assuming real;
 = 
                              true

But according to SMTLIB:-Satisfiable, is not satisfiable: 

SMTLIB:-Satisfiable(expr) assuming real;
 = 
                             false

Why are the two results opposite

For reference, below is the output from RealDomain:-solve

RealDomain:-solve(expr);
 = 
               /           1  2\                 
              { p = p, q = - p  }, {p = p, q = 0}
               \           4   /                 

I also tried using RealDomain:-simplify, yet the output remains almost unchanged (Why?). 

A classic result states that the equation x3px2qxr=0 with real coefficients p, q, r has positive roots iff p<0, q>0, r<0 and -27r2 - 2p(2p2 - 9q)r + q2(p2 - 4q) ⩾ 0 (see for example this question). 
However, Maple appears unable to find the condition: 

a, b, c := allvalues(RootOf(x^3 + p*x^2 + q*x + r, x), 'implicit'):
RealDomain:-solve({a, b, c} >~ 0, [p, q, r]);
 = 
Warning, solutions may have been lost
                               []

Is there a way to get the above conditions in Maple with as little human intervention as possible (I mean, without a priori knowledge of the theory of polynomials)? 

Edit. An interesting problem is when these three positive roots can further be the lengths of sides of a triangle. For reference, here are some (unenlightening) results from some other software: 

1 2 3 4 5 6 7 Last Page 1 of 22