In mathematics, the concepts of subderivative, subgradient, and subdifferential arise in convex analysis, that is, in the study of convex functions, often in connection to convex optimization.
Let f:I→R be a realvalued convex function defined on an open interval of the real line. Such a function may not necessarily be differentiable at all points, as for example, the absolute value, f(x)=x. However, as seen in the picture on the right (and which can be proved rigorously), for any x_{0} in the domain of the function one can draw a line which goes through the point (x_{0}, f(x_{0})) and which is everywhere either touching or below the graph of f. The slope of such a line is called a subderivative (because the line is under the graph of f).
Contents 
Rigorously, a subderivative of a convex function f:I→R at a point x_{0} in the open interval I is a real number c such that
for all x in I. One may show that the set of subderivatives at x_{0} is a nonempty closed interval [a, b], where a and b are the onesided limits
which are guaranteed to exist and satisfy a ≤ b.
The set [a, b] of all subderivatives is called the subdifferential of the function f at x_{0}.
Consider the function f(x)=x which is convex. Then, the subdifferential at the origin is the interval [−1, 1]. The subdifferential at any point x_{0}<0 is the singleton set {−1}, while the subdifferential at any point x_{0}>0 is the singleton {1}.
The concepts of subderivative and subdifferential can be generalized to functions of several variables. If f:U→ R is a realvalued convex function defined on a convex open set in the Euclidean space R^{n}, a vector v in that space is called a subgradient at a point x_{0} in U if for any x in U one has
where the dot denotes the dot product. The set of all subgradients at x_{0} is called the subdifferential at x_{0} and is denoted ∂f(x_{0}). The subdifferential is always a nonempty convex compact set.
These concepts generalize further to convex functions f:U→ R on a convex set in a locally convex space V. A functional v^{∗} in the dual space V^{∗} is called subgradient at x_{0} in U if
The set of all subgradients at x_{0} is called the subdifferential at x_{0} and is again denoted ∂f(x_{0}). The subdifferential is always a convex closed set. It can be an empty set; consider for example an unbounded operator, which is convex, but has no subgradient. If f is continuous, the subdifferential is nonempty.
