Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I tried this code, but not working

Clear[f];
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
add comment

2 Answers

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
add comment

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:

Clear[f,a,b,x1,x2];
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
add comment

Your Answer

 
discard

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.