HOME

TheInfoList



OR:

In
mathematics Mathematics is a field of study that discovers and organizes methods, Mathematical theory, theories and theorems that are developed and Mathematical proof, proved for the needs of empirical sciences and mathematics itself. There are many ar ...
, a piecewise function (also called a piecewise-defined function, a hybrid function, or a function defined by cases) is a function whose domain is partitioned into several intervals ("subdomains") on which the function may be defined differently. Piecewise definition is actually a way of specifying the function, rather than a characteristic of the resulting function itself, as every function whose domain contains at least two points can be rewritten as a piecewise function. The first three paragraphs of this article only deal with this first meaning of "piecewise". Terms like piecewise linear, piecewise smooth, piecewise continuous, and others are also very common. The meaning of a function being piecewise P, for a property P is roughly that the domain of the function can be partitioned into pieces on which the property P holds, but is used slightly differently by different authors. Unlike the first meaning, this is a property of the function itself and not only a way to specify it. Sometimes the term is used in a more global sense involving triangulations; see
Piecewise linear manifold In mathematics, a piecewise linear manifold (PL manifold) is a topological manifold together with a piecewise linear structure on it. Such a structure can be defined by means of an atlas, such that one can pass from chart to chart in it by piecewis ...
.


Notation and interpretation

Piecewise functions can be defined using the common
functional notation In mathematics, a function from a set to a set assigns to each element of exactly one element of .; the words ''map'', ''mapping'', ''transformation'', ''correspondence'', and ''operator'' are sometimes used synonymously. The set is called ...
, where the body of the function is an array of functions and associated subdomains. A semicolon or comma may follow the subfunction or subdomain columns. The \text{if} or \text{for} is rarely omitted at the start of the right column. The subdomains together must cover the whole domain; sometimes it is also required that they are pairwise disjoint, i.e. form a partition of the domain. This is enough for a function to be "defined by cases", but in order for the overall function to be "piecewise", the subdomains are typically required to be nonempty intervals (some may be degenerate intervals, i.e. single points or unbounded intervals) and they are often not allowed to have infinitely many subdomains in any bounded interval. This means that functions with bounded domains will only have finitely many subdomains, while functions with unbounded domains can have infinitely many subdomains, as long as they are appropriately spread out. As an example, consider the piecewise definition of the
absolute value In mathematics, the absolute value or modulus of a real number x, is the non-negative value without regard to its sign. Namely, , x, =x if x is a positive number, and , x, =-x if x is negative (in which case negating x makes -x positive), ...
function: , x, = \begin{cases} -x, & \text{if } x < 0 \\ +x, & \text{if } x \ge 0 . \end{cases} For all values of x less than zero, the first sub-function (-x) is used, which negates the sign of the input value, making negative numbers positive. For all values of x greater than or equal to zero, the second sub-function is used, which evaluates trivially to the input value itself. The following table documents the absolute value function at certain values of x: {, class="wikitable" ! style="width: 3em" , ''x'' ! style="width: 3em" , ''f''(''x'') !Sub-function used , - , −3 , , 3 , , -x , - , −0.1, , 0.1, , -x , - , 0 , , 0 , , x , - , 1/2 , , 1/2, , x , - , 5 , , 5 , , x , - In order to evaluate a piecewise-defined function at a given input value, the appropriate subdomain needs to be chosen in order to select the correct sub-function—and produce the correct output value.


Examples

* A
step function In mathematics, a function on the real numbers is called a step function if it can be written as a finite linear combination of indicator functions of intervals. Informally speaking, a step function is a piecewise constant function having on ...
or piecewise constant function, composed of constant sub-functions *
Piecewise linear function In mathematics, a piecewise linear or segmented function is a real-valued function of a real variable, whose graph is composed of straight-line segments. Definition A piecewise linear function is a function defined on a (possibly unbounded) ...
, composed of
linear In mathematics, the term ''linear'' is used in two distinct senses for two different properties: * linearity of a '' function'' (or '' mapping''); * linearity of a '' polynomial''. An example of a linear function is the function defined by f(x) ...
sub-functions * Broken power law, a function composed of power-law sub-functions * Spline, a function composed of polynomial sub-functions, often constrained to be smooth at the joints between pieces **
B-spline In numerical analysis, a B-spline (short for basis spline) is a type of Spline (mathematics), spline function designed to have minimal Support (mathematics), support (overlap) for a given Degree of a polynomial, degree, smoothness, and set of bre ...
*
PDIFF In geometric topology, PDIFF, for ''p''iecewise ''diff''erentiable, is the category of piecewise- smooth manifolds and piecewise-smooth maps between them. It properly contains DIFF (the category of smooth manifolds and smooth functions between th ...
* f(x)= \begin{cases} \exp\left( -\frac{1}{1 - x^2}\right), & x \in (-1,1) \\ 0, & \text{otherwise} \end{cases}
and some other common
Bump function In mathematical analysis, a bump function (also called a test function) is a function f : \Reals^n \to \Reals on a Euclidean space \Reals^n which is both smooth (in the sense of having continuous derivatives of all orders) and compactly supp ...
s. These are infinitely differentiable, but analyticity holds only piecewise.


Continuity and differentiability of piecewise-defined functions

A piecewise-defined function is
continuous Continuity or continuous may refer to: Mathematics * Continuity (mathematics), the opposing concept to discreteness; common examples include ** Continuous probability distribution or random variable in probability and statistics ** Continuous ...
on a given interval in its domain if the following conditions are met: * its sub-functions are continuous on the corresponding intervals (subdomains), * there is no discontinuity at an endpoint of any subdomain within that interval. The pictured function, for example, is piecewise-continuous throughout its subdomains, but is not continuous on the entire domain, as it contains a jump discontinuity at x_0. The filled circle indicates that the value of the right sub-function is used in this position. For a piecewise-defined function to be differentiable on a given interval in its domain, the following conditions have to fulfilled in addition to those for continuity above: * its sub-functions are differentiable on the corresponding ''open'' intervals, * the one-sided derivatives exist at all intervals' endpoints, * at the points where two subintervals touch, the corresponding one-sided derivatives of the two neighboring subintervals coincide.


Applications

In applied mathematical analysis, "piecewise-regular" functions have been found to be consistent with many models of the human visual system, where images are perceived at a first stage as consisting of smooth regions separated by edges (as in a
cartoon A cartoon is a type of visual art that is typically drawn, frequently Animation, animated, in an realism (arts), unrealistic or semi-realistic style. The specific meaning has evolved, but the modern usage usually refers to either: an image or s ...
); Here: p.8 a cartoon-like function is a C2 function, smooth except for the existence of discontinuity curves. In particular,
shearlet In applied mathematical analysis, shearlets are a multiscale framework which allows efficient encoding of anisotropic features in multivariate problem classes. Originally, shearlets were introduced in 2006 for the analysis and sparse approximation ...
s have been used as a representation system to provide sparse approximations of this model class in 2D and 3D. Piecewise defined functions are also commonly used for interpolation, such as in
nearest-neighbor interpolation Nearest-neighbor interpolation (also known as proximal interpolation or, in some contexts, point sampling) is a simple method of multivariate interpolation in one or more dimensions. Interpolation is the problem of approximating the value of a ...
.


See also

*
Piecewise linear continuation Simplicial continuation, or piecewise linear continuation (Allgower and Georg),Eugene L. Allgower, K. Georg, "Introduction to Numerical Continuation Methods", ''SIAM Classics in Applied Mathematics'' 45, 2003.E. L. Allgower, K. Georg, "Simplicial an ...
*


References

{{Reflist Functions and mappings