6
$\begingroup$

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

$\endgroup$
8
$\begingroup$

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.

| improve this answer | |
$\endgroup$
5
$\begingroup$

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) *)
| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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