How to prove the positivity if this function?

2 views (last 30 days)
Hi,
I need to prove the positivity of the y:
y = x1 - x2 + sin(x1)
such that:
pi>x1>0, x1>x2, x1,x2 real
The Matlab code is:
x = sym('x', [1 2], 'real');
assume(pi>x(1)>0 & x(1)>x(2));
y = x(1) - x(2) + sin(x(1));
We all know that the sum of "x(1)-x(2)" and "sin(x(1))" ,according to the boundary, is always definite positive.
Checking it in Matlab:
isAlways(y>=0)
I get:
Warning: Unable to prove '0 < x1 - x2 + sin(x1)'.
> In symengine
In sym/isAlways (line 42)
How can I prove the positivity of y?
The whole function is more bigger then y, so I can't simply say "y looks positive", I need to check it using Matlab.
Any kind of help is really appreciated!

Accepted Answer

David Goodmanson
David Goodmanson on 23 Oct 2021
Hi Andrea,
What might constitute a proof using Matlab is a good question. If the answer to isAlways(y>=0) had come out as 1, would that be a proof? I guess maybe it would if the focus is on learning how to use symbolic variables, but it provides zero insight into the inequality itself. It's just the output from a black box. However, rearranging y > 0 gives
sin(x1) > x2 - x1
By the conditions of the problem, the left hand side is positive due to the angle restrictions and the right hand side is negative. So the inequality is correct.
  2 Comments
Andrea Strappato
Andrea Strappato on 23 Oct 2021
Thanks for the answer!
The "real" inequality to check is more complex then this, showed in the topic. Maybe solving an easier inequality could help.
Anyway, I've solved this just replacing a set of value for the symbolic variables and check if it is definite positive.
Best.
David Goodmanson
David Goodmanson on 28 Oct 2021
Hi Andrea,
checking the inequality with a set of values is of course not a mathematical proof, but with enough sets of values it might be considered a 'proof for all practical purposes'.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!