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}$$.

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$$.