Piecewise

Last updated
Plot of the piecewise linear function
f
(
x
)
=
{
-
3
-
x
if
x
<=
-
3
x
+
3
if
-
3
<=
x
<=
0
3
-
2
x
if
0
<=
x
<=
3
0.5
x
-
4.5
if
3
<=
x
{\displaystyle f(x)=\left\{{\begin{array}{lll}-3-x&{\text{if}}&x\leq -3\\x+3&{\text{if}}&-3\leq x\leq 0\\3-2x&{\text{if}}&0\leq x\leq 3\\0.5x-4.5&{\text{if}}&3\leq x\\\end{array}}\right.} Piecewise linear function gnuplot.svg
Plot of the piecewise linear function

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.

Contents

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

Graph of the absolute value function,
y
=
|
x
|
{\displaystyle y=|x|} Absolute value.svg
Graph of the absolute value function,

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 :

xf(x)Sub-function used
−33
−0.10.1
00
1/21/2
55

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

Continuity and differentiability of piecewise-defined functions

Plot of the piecewise-quadratic function
f
(
x
)
=
{
x
2
if
x
<
0.707
1.5
-
(
x
-
1.414
)
2
if
0.707
<=
x
{\displaystyle f(x)=\left\{{\begin{array}{lll}x^{2}&{\text{if}}&x<0.707\\1.5-(x-1.414)^{2}&{\text{if}}&0.707\leq x\\\end{array}}\right.}
Its only discontinuity is at
x
0
=
0.707
{\displaystyle x_{0}=0.707}
. Upper semi.svg
Plot of the piecewise-quadratic function Its only discontinuity is at .

A piecewise-defined function is continuous on a given interval in its domain if the following conditions are met:

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:

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.

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

Related Research Articles

In mathematics, a continuous function is a function such that a small variation of the argument induces a small variation of the value of the function. This implies there are no abrupt changes in value, known as discontinuities. More precisely, a function is continuous if arbitrarily small changes in its value can be assured by restricting to sufficiently small changes of its argument. A discontinuous function is a function that is not continuous. Until the 19th century, mathematicians largely relied on intuitive notions of continuity and considered only continuous functions. The epsilon–delta definition of a limit was introduced to formalize the definition of continuity.

<span class="mw-page-title-main">Interpolation</span> Method for estimating new data within known data points

In the mathematical field of numerical analysis, interpolation is a type of estimation, a method of constructing (finding) new data points based on the range of a discrete set of known data points.

<span class="mw-page-title-main">Integral</span> Operation in mathematical calculus

In mathematics, an integral is the continuous analog of a sum, which is used to calculate areas, volumes, and their generalizations. Integration, the process of computing an integral, is one of the two fundamental operations of calculus, the other being differentiation. Integration was initially used to solve problems in mathematics and physics, such as finding the area under a curve, or determining displacement from velocity. Usage of integration expanded to a wide variety of scientific fields thereafter.

<span class="mw-page-title-main">B-spline</span> Spline function

In the mathematical subfield of numerical analysis, a B-spline or basis spline is a spline function that has minimal support with respect to a given degree, smoothness, and domain partition. Any spline function of given degree can be expressed as a linear combination of B-splines of that degree. Cardinal B-splines have knots that are equidistant from each other. B-splines can be used for curve-fitting and numerical differentiation of experimental data.

<span class="mw-page-title-main">Differential calculus</span> Area of mathematics; subarea of calculus

In mathematics, differential calculus is a subfield of calculus that studies the rates at which quantities change. It is one of the two traditional divisions of calculus, the other being integral calculus—the study of the area beneath a curve.

In mathematics, a singularity is a point at which a given mathematical object is not defined, or a point where the mathematical object ceases to be well-behaved in some particular way, such as by lacking differentiability or analyticity.

<span class="mw-page-title-main">Curve</span> Mathematical idealization of the trace left by a moving point

In mathematics, a curve is an object similar to a line, but that does not have to be straight.

<span class="mw-page-title-main">Linear interpolation</span> Method of curve fitting to construct new data points within the range of known data points

In mathematics, linear interpolation is a method of curve fitting using linear polynomials to construct new data points within the range of a discrete set of known data points.

<span class="mw-page-title-main">Non-uniform rational B-spline</span> Method of representing curves and surfaces in computer graphics

Non-uniform rational basis spline (NURBS) is a mathematical model using basis splines (B-splines) that is commonly used in computer graphics for representing curves and surfaces. It offers great flexibility and precision for handling both analytic and modeled shapes. It is a type of curve modeling, as opposed to polygonal modeling or digital sculpting. NURBS curves are commonly used in computer-aided design (CAD), manufacturing (CAM), and engineering (CAE). They are part of numerous industry-wide standards, such as IGES, STEP, ACIS, and PHIGS. Tools for creating and editing NURBS surfaces are found in various 3D graphics, rendering, and animation software packages.

<span class="mw-page-title-main">Pathological (mathematics)</span> Mathematical phenomena whose properties are counterintuitive

In mathematics, when a mathematical phenomenon runs counter to some intuition, then the phenomenon is sometimes called pathological. On the other hand, if a phenomenon does not run counter to intuition, it is sometimes called well-behaved or nice. These terms are sometimes useful in mathematical research and teaching, but there is no strict mathematical definition of pathological or well-behaved.

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.

<span class="mw-page-title-main">Spline (mathematics)</span> Mathematical function defined piecewise by polynomials

In mathematics, a spline is a function defined piecewise by polynomials. In interpolating problems, spline interpolation is often preferred to polynomial interpolation because it yields similar results, even when using low degree polynomials, while avoiding Runge's phenomenon for higher degrees.

In the mathematical field of numerical analysis, spline interpolation is a form of interpolation where the interpolant is a special type of piecewise polynomial called a spline. That is, instead of fitting a single, high-degree polynomial to all of the values at once, spline interpolation fits low-degree polynomials to small subsets of the values, for example, fitting nine cubic polynomials between each of the pairs of ten points, instead of fitting a single degree-nine polynomial to all of them. Spline interpolation is often preferred over polynomial interpolation because the interpolation error can be made small even when using low-degree polynomials for the spline. Spline interpolation also avoids the problem of Runge's phenomenon, in which oscillation can occur between points when interpolating using high-degree polynomials.

In numerical analysis, a cubic Hermite spline or cubic Hermite interpolator is a spline where each piece is a third-degree polynomial specified in Hermite form, that is, by its values and first derivatives at the end points of the corresponding domain interval.

<span class="mw-page-title-main">Smoothness</span> Number of derivatives of a function (mathematics)

In mathematical analysis, the smoothness of a function is a property measured by the number, called differentiability class, of continuous derivatives it has over its domain.

<span class="mw-page-title-main">Finite element method</span> Numerical method for solving physical or engineering problems

The finite element method (FEM) is a popular method for numerically solving differential equations arising in engineering and mathematical modeling. Typical problem areas of interest include the traditional fields of structural analysis, heat transfer, fluid flow, mass transport, and electromagnetic potential.

In the mathematical field of numerical analysis, discrete spline interpolation is a form of interpolation where the interpolant is a special type of piecewise polynomial called a discrete spline. A discrete spline is a piecewise polynomial such that its central differences are continuous at the knots whereas a spline is a piecewise polynomial such that its derivatives are continuous at the knots. Discrete cubic splines are discrete splines where the central differences of orders 0, 1, and 2 are required to be continuous.

Most of the terms listed in Wikipedia glossaries are already defined and explained within Wikipedia itself. However, glossaries like this one are useful for looking up, comparing and reviewing large numbers of terms together. You can help enhance this page by adding new terms or writing definitions for existing ones.

References

  1. "Piecewise Functions". www.mathsisfun.com. Retrieved 2020-08-24.
  2. 1 2 3 4 Weisstein, Eric W. "Piecewise Function". mathworld.wolfram.com. Retrieved 2020-08-24.
  3. "Piecewise functions". brilliant.org. Retrieved 2020-09-29.
  4. 1 2 Weisstein, Eric W. "Piecewise Function". mathworld.wolfram.com. Retrieved 2024-07-20.
  5. A feasible weaker requirement is that all definitions agree on intersecting subdomains.
  6. Kutyniok, Gitta; Labate, Demetrio (2012). "Introduction to shearlets" (PDF). Shearlets. Birkhäuser: 1–38. Here: p.8
  7. 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.