Search code examples
matlablogical-operatorssymbolic-mathinequality

MATLAB symengine fails on a logical statement


I want to make matlab agree with the following simple statement:

(x-a)^b>=0 when x>0, a>0, b<0, x>a

In order to do so I write:

syms x a b
assume(x>0 & a>0 & b<0 & x>a);
isAlways((x-a)^b>=0,'Unknown','error')

And get the following error message:

Error using symengine
Cannot prove '0 <= (x - a)^b'.

Error in sym/isAlways (line 38)
Y = mupadmex('symobj::isAlways',X.s,isMath,['"Unknown' p.Unknown '"'],9);

Why does MATLAB fail to agree with such an evident statement?


Solution

  • I don't know why but instead of using as assumption x>a, use x-a > 0. I think MATLAB doesn't "compute" the difference between x and a and so it doesn't know if x-a is greater than 0 or not. So it must already know that x-a is greater than 0 when you check the condition.