Convex function

A convex function $$f:\mathbb R^n \to \mathbb R$$ is a function that satisfies the following inequality for all $$x,y \in \textbf{dom} f$$ and $$0\le \theta \le 1$$

$$f(\theta x + (1-\theta) y) \le \theta f(x) + (1-\theta) f(y)$$.

Convexity is an extremely useful property as it renders optimization problems solvable.

Convexity Criteria
While the above-mentioned inequality is the essential property for convexity, there are other equivalent properties.

For differentiable functions
If $$f$$ is differentiable, then it is convex if and only if $$\textbf{dom} f$$ is convex and

$$f(y) \ge f(x) + \nabla f (x)^T(y-x)$$

holds for all $$x,y \in \textbf{dom} f$$. In other words, $$f$$ is convex iff its first-order Taylor approximation is a global underestimator of $$f$$ at every point of its domain. If $$f$$ is twice differentiable, then it is convex iff its Hessian $$\nabla^2 f$$ is positive definite, i.e.,

$$\nabla^2 f(x) \ge 0$$ for all $$x \in \textbf{dom} f$$.