Piecewise

In mathematics, a piecewise-defined function f(x) of a real variable x is a function whose definition is given differently on disjoint subsets of its domain.

A common example is the absolute value function, given by
 * $$|x| = \begin{cases}

x  & \mbox{if } x \ge 0,  \\ -x & \mbox{if } x < 0. \end{cases} $$

Other examples are the illustrated function, discontinuous at x0, and the Heaviside step function, a piecewise linear function which is discontinuous at 0.

The word piecewise is also used to describe any property of a piecewise-defined function that holds for each piece but may not hold for the whole domain of the function. A function is piecewise differentiable or piecewise continuously differentiable if each piece is differentiable throughout its domain. Although the "pieces" in a piecewise definition need not be intervals, a function is not called "piecewise linear" or "piecewise continuous" or "piecewise differentiable" unless the pieces are intervals.