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 tried this code, but not working

f[x_] := x^3 - 3 x + 2;
ForAll[{x1, x2}, x1 < x2, f[x1] < f[x2]]
Reduce[%, {x1, x2}, Reals]

I expected the result is x<=-1 || x>=1

share|improve this question
up vote 8 down vote accepted

For almost everywhere differentiable functions:

Reduce[ D[ f[x], x] > 0, x]
x < -1 || x > 1

In fact it is sufficient for almost all purposes, your example is just a polynomial, no need for other conditions.

share|improve this answer

I prefer @Artes way of doing it, but here is one way to do it with ForAll and Reduce:

Since you want to find intervals $[a,b]$ s.t. $\forall x_1,x_2 \in [a,b]\quad s.t.\ x_1<x_2: f(x_1)<f(x_2) $ You can specify the ForAll statement like:

f[x_] := x^3 - 3 x + 2;
ForAll[{x1, x2}, a < x1 < x2 < b, f[x1] < f[x2]]
Reduce[% && a < b, {a, b}, Reals]

(* (a < -1 && a < b <= -1) || (a >= 1 && b > a) *)
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.