Piecewise function: Difference between revisions
Fgnievinski (talk | contribs) |
→Notation and interpretation: wording |
||
Line 11: | Line 11: | ||
[[Image:Absolute value.svg|thumb|280px|right|Graph of the absolute value function, <math>y=|x|</math>]] |
[[Image:Absolute value.svg|thumb|280px|right|Graph of the absolute value function, <math>y=|x|</math>]] |
||
Piecewise functions can be defined using the common [[functional notation]], 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.<ref name=":1">{{Cite web |last=Weisstein |first=Eric W. |title=Piecewise Function |url=https://mathworld.wolfram.com/ |access-date=2024-07-20 |website=mathworld.wolfram.com |language=en}}</ref> The <math>\text{if}</math> or <math>\text{for}</math> |
Piecewise functions can be defined using the common [[functional notation]], 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.<ref name=":1">{{Cite web |last=Weisstein |first=Eric W. |title=Piecewise Function |url=https://mathworld.wolfram.com/ |access-date=2024-07-20 |website=mathworld.wolfram.com |language=en}}</ref> The <math>\text{if}</math> or <math>\text{for}</math> is rarely omitted at the start of the right column.<ref name=":1" /> |
||
The subdomains together must cover the whole [[Domain of a function|domain]]; often it is also required that they are pairwise disjoint, i.e. form a partition of the domain.<ref>A feasible weaker requirement is that all definitions agree on intersecting subdomains.</ref> In order for the overall function to be called "piecewise", the subdomains are usually required to be intervals (some may be degenerated intervals, i.e. single points or unbounded intervals). For bounded intervals, the number of subdomains is required to be finite, for unbounded intervals it is often only required to be locally finite. For example, consider the piecewise definition of the [[absolute value]] function:<ref name=":0" /> |
The subdomains together must cover the whole [[Domain of a function|domain]]; often it is also required that they are pairwise disjoint, i.e. form a partition of the domain.<ref>A feasible weaker requirement is that all definitions agree on intersecting subdomains.</ref> In order for the overall function to be called "piecewise", the subdomains are usually required to be intervals (some may be degenerated intervals, i.e. single points or unbounded intervals). For bounded intervals, the number of subdomains is required to be finite, for unbounded intervals it is often only required to be locally finite. For example, consider the piecewise definition of the [[absolute value]] function:<ref name=":0" /> |
Revision as of 11:03, 22 July 2024
A request that this article title be changed to Piecewise mathematical object is under discussion. Please do not move this article until the discussion is closed. |
This article needs additional citations for verification. (March 2017) |
In mathematics, a piecewise-defined function (also called a piecewise function, a hybrid function, or definition by cases) is a function whose domain is partitioned into several intervals ("subdomains") on which the function may be defined differently.[1][2][3] Piecewise definition is actually a way of specifying the function, rather than a characteristic of the resulting function itself.
A function property holds piecewise for a function, if the function can be piecewise defined in a way that the property holds for every subdomain. Examples of functions with such piecewise properties are piecewise constant functions, piecewise linear functions (see the figure), piecewise continuous functions, piecewise smooth functions, and piecewise differentiable functions.
Notation and interpretation
Piecewise functions can be defined using the common functional notation, 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.[4] The or is rarely omitted at the start of the right column.[4]
The subdomains together must cover the whole domain; often it is also required that they are pairwise disjoint, i.e. form a partition of the domain.[5] In order for the overall function to be called "piecewise", the subdomains are usually required to be intervals (some may be degenerated intervals, i.e. single points or unbounded intervals). For bounded intervals, the number of subdomains is required to be finite, for unbounded intervals it is often only required to be locally finite. For example, consider the piecewise definition of the absolute value function:[2]
For all values of less than zero, the first sub-function () is used, which negates the sign of the input value, making negative numbers positive. For all values of 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 | f(x) | Sub-function used |
---|---|---|
−3 | 3 | |
−0.1 | 0.1 | |
0 | 0 | |
1/2 | 1/2 | |
5 | 5 |
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
- Piecewise linear function, a function composed of line segments
- Step function, a function composed of constant sub-functions
- Absolute value[2]
- Triangular function
- Broken power law, a function composed of power-law sub-functions
- Spline, a function composed of polynomial sub-functions, possessing a high degree of smoothness at the places where the polynomial pieces connect
- PDIFF
and some other common Bump functions. These are infinitely differentiable, but analyticity holds only piecewise.
Continuity and differentiability of piecewise-defined functions
A piecewise-defined function is 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 . 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);[6] a cartoon-like function is a C2 function, smooth except for the existence of discontinuity curves.[7] In particular, shearlets 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.
Related concepts
The concept of piecewise-defined functions is often generalized to curves, such as piecewise linear curves and piecewise polynomial curves. The concept may also be extended into more abstract constructs, such as piecewise linear manifolds.
See also
References
- ^ "Piecewise Functions". www.mathsisfun.com. Retrieved 2020-08-24.
- ^ a b c d Weisstein, Eric W. "Piecewise Function". mathworld.wolfram.com. Retrieved 2020-08-24.
- ^ "Piecewise functions". brilliant.org. Retrieved 2020-09-29.
- ^ a b Weisstein, Eric W. "Piecewise Function". mathworld.wolfram.com. Retrieved 2024-07-20.
- ^ A feasible weaker requirement is that all definitions agree on intersecting subdomains.
- ^ Kutyniok, Gitta; Labate, Demetrio (2012). "Introduction to shearlets" (PDF). Shearlets. Birkhäuser: 1–38. Here: p.8
- ^ Kutyniok, Gitta; Lim, Wang-Q (2011). "Compactly supported shearlets are optimally sparse". Journal of Approximation Theory. 163 (11): 1564–1589. doi:10.1016/j.jat.2011.06.005.