4
$\begingroup$

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
$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$
    – rhermans
    Commented Oct 30, 2014 at 11:17

1 Answer 1

5
$\begingroup$

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

$\endgroup$
1
  • $\begingroup$ Thank you, this is very helpful. $\endgroup$ Commented Nov 2, 2014 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.