Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

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'm trying to study the sign of an expression, having information on some of my parameters. I don't know how to code these conditions. For example, I want to know when this expression:

k (2(a'[x])^2 - a[x]a''[x]) / (a[x]^2) 

is positive given that k > 0, x > 0 and that my function a is positive and increasing for all x > 0 (k is a constant, a is a function)

So basically, since a''[x] is the only term of the equation that I don't know anything about, I want Mathematica to give me:

(* a''[x] < a'[x]^2/a[x] *)
share|improve this question
Elsa, welcome to Mathematica.SE. Please use backticks to format your code so that your question is more readable; see – Mr.Wizard May 2 '14 at 5:50
@Elsa I did not clearly understand, what is your aim. Think about adding an example of a function in question along with the answer in the form you wish it to be. You can do it using the option "edit" below your question. – Alexei Boulbitch May 2 '14 at 7:07
Hello Elsa, my apologies that your edit went unnoticed and you had to wait so long... I've formatted the question a bit and reopened it :) I've also changed " to '' since " is used only for strings and it looks like you meant the second derivative. Please also clarify if k here is a function or just a quantity. Your usage of [], when interpreted as Mathematica syntax indicates that k is a function, but if interpreted purely as a grouping, then perhaps not. – R. M. May 19 '14 at 23:06
Hello, thank you so much for your edit! (indeed, I meant the 2nd derivative and k is just a quantity). Cheers – Elsa May 20 '14 at 0:20
Ok this is good enough actually, thank you. Is there any way I wouldn't have to repeat k>0 in every function but settle it beforehand? (I tried different things on the same idea as testParam = {k -> 3}but it doesn't work with inequalities) – Elsa May 20 '14 at 18:00
up vote 1 down vote accepted

Questions need to be answered, so I guess I will shoot:

Reduce[k (2 (a'[x])^2 - a[x] a''[x])/(a[x]^2) > 0 && k > 0]

$a'(x)\in \mathbb{R}\land \left(\left(a(x)<0\land a''(x)>\frac{2 a'(x)^2}{a(x)}\land k>0\right)\lor \left(a(x)>0\land a''(x)<\frac{2 a'(x)^2}{a(x)}\land k>0\right)\right)$

which is the result that you expected.

Regarding your comment:

Is there any way I wouldn't have to repeat k>0 in every function but settle it beforehand?

You can do:

assum = k > 0;
Reduce[k (2 (a'[x])^2 - a[x] a''[x])/(a[x]^2) > 0 && assum]
share|improve this answer
That's awesome! thank you – Elsa May 20 '14 at 22:51

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.