Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Mathematica version 7. I have an expression named fd and I took the derivative of fd with respect to t which I will note the outcome as Dexprdt. Basically, I am trying to understand if Dexprdt is negative or positive (Comparative Statics) and in order to do this I have the following set-up which was proposed here by b.gatessucks and it works really well. solPos shows the logical expansion which makes Dexprdt positive. However, as seen in the below code there are 2576 possible combination of solutions and I only want to extract the solutions (inequalites) where Y1, Y2, a, b, d, p are positive reals. I tried to use Pick command and it was not really useful. I really need help with the methodology. Here is the code:

q = 1 - p;
fd = (b d (p - q) Y1 Y2 (p Y1 - q Y2) + a p q t (Y1 + Y2)^2 (p (-1 + Y1^2) Y2 + 
q Y1 (-1 + Y2^2)))/(a p q t (Y1 + Y2)^2 (p (-1 + Y1^2) Y2 + q Y1 (-1 + Y2^2)));
expr = FullSimplify[fd];
Dexprdt = Simplify[D[Numerator[expr], t] Denominator[expr] - 
Numerator[expr] D[Denominator[expr], t]];
(*Normally in Dexprdt we should have D[Denominator[expr]^2 dividing \
but since it is always positive it is enough to check the Numerator \
of the derivative*)

solPos = LogicalExpand[Reduce[Dexprdt > 0, Reals]]
(*solPos is the possible solutions that makes Dexprdt positive*)

solPos // Dimensions;
(*{2576} - number of possible solutions*)

share|improve this question
Your definition of Dexprdt is strange. It seems you have forgotten a D. – Jacob Akkerboom Jun 5 '13 at 14:37
up vote 1 down vote accepted

Temporary: The observations here were made by adding an extra D in the expression for Dexprdt.

Well, you could just do

solPos2 = 
  Reduce[Dexprdt > 0 && Y1 > 0 && Y2 > 0 && a > 0 && b > 0 && d > 0 &&
     p > 0, Reals]]

This gives you a much smaller expression. However, I would guess that there are infinitely many solutions. Note that many (if not all) of the alternatives in solPos contain inequalities, and only one of these alternatives has to be true for your inputs in order for solPos to be true. So there are infinitely many solutions. So you cannot put their numerical values into a list or something like that.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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