Definition:Convex Real Function

Let $$f$$ be a real function which is defined on a real interval $$I$$.

Then $$f$$ is convex on $$I$$ iff:

$$\forall \alpha, \beta \in \mathbb{R}: \alpha > 0, \beta > 0, \alpha + \beta = 1: f \left({\alpha x + \beta y}\right) \le \alpha f \left({x}\right) + \beta f \left({y}\right)$$

wherever $$x, y \in I$$.



The geometric interpretation is that any point on the chord drawn on the graph of any convex function always lies on or above the graph.

Alternative Definition
A real function $$f$$ defined on a real interval $$I$$ is convex on $$I$$ iff:

$$\forall x_1, x_2, x_3 \in I: x_1 < x_2< x_3: \frac {f \left({x_2}\right) - f \left({x_1}\right)} {x_2 - x_1} \le \frac {f \left({x_3}\right) - f \left({x_2}\right)} {x_3 - x_2}$$

or:

$$\forall x_1, x_2, x_3 \in I: x_1 < x_2< x_3: \frac {f \left({x_2}\right) - f \left({x_1}\right)} {x_2 - x_1} \le \frac {f \left({x_3}\right) - f \left({x_1}\right)} {x_3 - x_1}$$.



Hence a geometrical interpretation:
 * In the left hand image above, the slope of $$P_1 P_2$$ is less than that of $$P_2 P_3$$.
 * In the right hand image above, the slope of $$P_1 P_2$$ is less than that of $$P_1 P_3$$.

Equivalence of Definitions
These two definitions can be seen to be equivalent from Equivalence of Convex and Concave Definitions.

Note
Compare concave function. It is immediately obvious from the definition that $$f$$ is convex on $$I$$ iff $$-f$$ is concave on $$I$$.