# How to find monotonically increasing intervals of a function

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

-

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.

-

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) *)

-