In mathematics, subderivatives (or subgradient) generalizes the derivative to convex functions which are not necessarily differentiable. The set of subderivatives at a point is called the subdifferential at that point. Subderivatives arise in convex analysis, the study of convex functions, often in connection to convex optimization.
Let f : I → R {\displaystyle f:I\to \mathbb {R} } be a real-valued convex function defined on an open interval of the real line. Such a function need not be differentiable at all points: For example, the absolute value function Failed to parse (SVG (MathML can be enabled via browser plugin): Invalid response ("Math extension cannot connect to Restbase.") from server "http://localhost:6011/en.wikipedia.org/v1/":): {\displaystyle f(x)=|x|} is non-differentiable when x = 0 {\displaystyle x=0} . However, as seen in the graph on the right (where f ( x ) {\displaystyle f(x)} in blue has non-differentiable kinks similar to the absolute value function), for any x 0 {\displaystyle x_{0}} in the domain of the function one can draw a line which goes through the point ( x 0 , f ( x 0 ) ) {\displaystyle (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.