How to check the positivity function?

2 views (last 30 days)
I can't prove the positivity of the function:
y = x1 - x2 + sin(x1)
such that:
0<x1<0.0001
0<x2<0.0001
x1>x2
My matlab code is:
x = sym('x', [1 2], 'real')
assume(0.0001>x>0 & x(1)>x(2))
y = x(1) - x(2) + sin(x(1))
isAlways(y>=0)
%Below the responde from command window
Warning: Unable to prove '0 <= x1 - x2 + sin(x1)'.
> In symengine
In sym/isAlways (line 42)
Why Matlab can't prove the positivity of the function y?
I can prove that "x(1)-x(2)" and "sin(x(1))" are positive, I don't know why I can't prove the positivity of the sum of positivity term.
Any kind of help is appreciate, I'm stucked on this for hours..

Accepted Answer

Walter Roberson
Walter Roberson on 2 Oct 2021
Eh. So split it up. x1 strictly > x2 impliex x1 - x2 > 0
x1 > 0 and x1 < pi implies sin(x1) > 0
the sum of two positive quantities is positive.
x = sym('x', [1 2], 'real')
x = 
assume(0.0001>x>0 & x(1)>x(2))
y1 = x(1) + x(2)
y1 = 
y2 = sin(x(1))
y2 = 
isAlways(y1 > 0)
ans = logical
1
isAlways(y2 > 0)
ans = logical
1
syms y3 y4 %y3 is the positive quantity y1, y4 is the positive quantity sin(x(1))
assume(y3>0 & y4>0)
isAlways(y3+y4 > 0)
ans = logical
1

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!