Piecewise function

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 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. [1] [2] [3] Piecewise definition is actually a way of specifying the function, rather than a characteristic of the resulting function itself.

Contents

Terms like piecewise linear, piecewise smooth, piecewise continuous, and others are very common. The meaning of a function being piecewise , for a property is roughly that the domain of the function can be partitioned into pieces on which the property holds, but is used slightly differently by different authors. Sometimes the term is used in a more global sense involving triangulations; see Piecewise linear manifold.

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:

Some sources only examine the function definition, [6] [ better source needed ] while others acknowledge the property iff the function admits a partition into a piecewise definition that meets the conditions. [7] [8]

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); [9] a cartoon-like function is a C2 function, smooth except for the existence of discontinuity curves. [10] 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.

See also

Related Research Articles

<span class="mw-page-title-main">Antiderivative</span> Indefinite integral

In calculus, an antiderivative, inverse derivative, primitive function, primitive integral or indefinite integral of a continuous function f is a differentiable function F whose derivative is equal to the original function f. This can be stated symbolically as F' = f. The process of solving for antiderivatives is called antidifferentiation, and its opposite operation is called differentiation, which is the process of finding a derivative. Antiderivatives are often denoted by capital Roman letters such as F and G.

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">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">Riemann integral</span> Basic integral in elementary calculus

In the branch of mathematics known as real analysis, the Riemann integral, created by Bernhard Riemann, was the first rigorous definition of the integral of a function on an interval. It was presented to the faculty at the University of Göttingen in 1854, but not published in a journal until 1868. For many functions and practical applications, the Riemann integral can be evaluated by the fundamental theorem of calculus or approximated by numerical integration, or simulated using Monte Carlo integration.

In mathematics, the branch of real analysis studies the behavior of real numbers, sequences and series of real numbers, and real functions. Some particular properties of real-valued sequences and functions that real analysis studies include convergence, limits, continuity, smoothness, differentiability and integrability.

<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">Maximum and minimum</span> Largest and smallest value taken by a function at a given point

In mathematical analysis, the maximum and minimum of a function are, respectively, the greatest and least value taken by the function. Known generically as extremum, they may be defined either within a given range or on the entire domain of a function. Pierre de Fermat was one of the first mathematicians to propose a general technique, adequality, for finding the maxima and minima of functions.

<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">Differentiable function</span> Mathematical function whose derivative exists

In mathematics, a differentiable function of one real variable is a function whose derivative exists at each point in its domain. In other words, the graph of a differentiable function has a non-vertical tangent line at each interior point in its domain. A differentiable function is smooth and does not contain any break, angle, or cusp.

In mathematics, the Riemann–Stieltjes integral is a generalization of the Riemann integral, named after Bernhard Riemann and Thomas Joannes Stieltjes. The definition of this integral was first published in 1894 by Stieltjes. It serves as an instructive and useful precursor of the Lebesgue integral, and an invaluable tool in unifying equivalent forms of statistical theorems that apply to discrete and continuous probability.

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.

<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 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

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. Computers are usually used to perform the calculations required. With high-speed supercomputers, better solutions can be achieved and are often required to solve the largest and most complex problems.

In statistics, multivariate adaptive regression splines (MARS) is a form of regression analysis introduced by Jerome H. Friedman in 1991. It is a non-parametric regression technique and can be seen as an extension of linear models that automatically models nonlinearities and interactions between variables.

The fundamental theorem of calculus is a theorem that links the concept of differentiating a function with the concept of integrating a function. Roughly speaking, the two operations can be thought of as inverses of each other.

<span class="mw-page-title-main">Lebesgue integral</span> Method of integration

In mathematics, the integral of a non-negative function of a single variable can be regarded, in the simplest case, as the area between the graph of that function and the X axis. The Lebesgue integral, named after French mathematician Henri Lebesgue, is one way to make this concept rigorous and to extend it to more general functions.

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 of functions . They are a natural extension of wavelets, to accommodate the fact that multivariate functions are typically governed by anisotropic features such as edges in images, since wavelets, as isotropic objects, are not capable of capturing such phenomena.

References

  1. "Piecewise Functions". www.mathsisfun.com. Retrieved 2020-08-24.
  2. 1 2 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. "Differentiability of Piecewise Defined Functions – AP Central | College Board". apcentral.collegeboard.org. Retrieved 2024-08-26.
  7. S. M. Nikolsky (1977). A Course Of Mathematical Analysis Vol 1. p. 178.
  8. Sofronidis, Nikolaos Efstathiou (2005). "The set of continuous piecewise differentiable functions". Real Analysis Exchange. 31 (1): 13–22. doi:10.14321/realanalexch.31.1.0013. ISSN   0147-1937.
  9. Kutyniok, Gitta; Labate, Demetrio (2012). "Introduction to shearlets" (PDF). Shearlets. Birkhäuser: 1–38. Here: p.8
  10. Kutyniok, Gitta; Lim, Wang-Q (2011). "Compactly supported shearlets are optimally sparse". Journal of Approximation Theory. 163 (11): 1564–1589. arXiv: 1002.2661 . doi:10.1016/j.jat.2011.06.005.