# Is there a simple function identify the sign of an expression given constraints

I'm looking to find a simple function that can identify the sign of an expression given a set of constraints. I have looked around and do see that there is a few threads on this but I'm not sure I understand them. As a bit of context (and I'm sure this is clear), I have never really used Mathematica before beyond some basic simplifications.

An example of what I want a function/command for is:

Given that $0<q<1$ and $0<y<x<1$, what is the sign of the expression $\frac{1}{2} - \frac{2q(2q+x^2-y^2)}{(2q(q-2)-x^2+y^2)^2}$ ?

 1/2 - (2 q (2 q + x^2 - y^2))/(2 q (q - 2) - x^2 + y^2)^2

• Hi, welcome to Mathematica.SE, please consider taking the tour so you learn the basics of the site. I have edited your question to include Mathematica Code in addition to you nice $LaTeX$. In the future, please provide formatted code yourself. Read how to ask good questions. Commented Oct 30, 2014 at 11:17

These are the conditions necessary for the expression to be Positive

Assuming[0 < q < 1 && 0 < y < x < 1,
FullSimplify@
Reduce[Positive[
1/2 - (2 q (2 q + x^2 - y^2))/(2 q (q - 2) - x^2 + y^2)^2]]]

Sqrt[2] + q == 2 || [...]


and other more complicated solutions.

If you need to know if that's always true then

Resolve[
ForAll[
{x, y, q},
0 < q < 1 && 0 < y < x < 1,
Positive[1/2 - (2 q (2 q + x^2 - y^2))/(2 q (q - 2) - x^2 + y^2)^2]
]]


False

• Thank you, this is very helpful. Commented Nov 2, 2014 at 0:03