Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Piecewise function

From Wikipedia, the free encyclopedia
Function defined by multiple sub-functions
"Piecewise" redirects here. For other uses, seePiecewise property.

icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Piecewise function" – news ·newspapers ·books ·scholar ·JSTOR
(March 2017) (Learn how and when to remove this message)
Plot of thepiecewise linear functionf(x)={3xifx3x+3if3x032xif0x30.5x4.5if3x{\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.}

Inmathematics, apiecewise function (also called apiecewise-defined function, ahybrid function, or afunction defined by cases) is afunction whosedomain ispartitioned into severalintervals ("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, 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 likepiecewise linear,piecewise smooth,piecewise continuous, and others are also very common. The meaning of a function being piecewiseP{\displaystyle P}, for a propertyP{\displaystyle P}, is roughly that the domain of the function can be partitioned into pieces on which the propertyP{\displaystyle P} holds, but this term is used slightly differently by different authors.[4][5] 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; seePiecewise linear manifold.

Notation and interpretation

[edit]
Graph of the absolute value function,y=|x|{\displaystyle y=\vert x\vert }
The functionf(x)=min(1,x2){\displaystyle f(x)=\min(1,x^{2})} is piecewisemonotonic (subdomains(,0]{\displaystyle (-\infty ,0]},[0,+){\displaystyle [0,+\infty )}) and piecewisedifferentiable (subdomains(,1]{\displaystyle (-\infty ,-1]},[1,+1]{\displaystyle [-1,+1]}, and[+1,+){\displaystyle [+1,+\infty )}).

Piecewise functions can be defined using the commonfunctional 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.[2] Theif{\displaystyle {\text{if}}} orfor{\displaystyle {\text{for}}} is rarely omitted at the start of the right column.[2]

The subdomains together must cover the wholedomain; sometimes it is also required that they are pairwise disjoint, i.e. form a partition of the domain.[6] 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 theabsolute value function:[2]|x|={x,if x<0+x,if x0.{\displaystyle |x|={\begin{cases}-x,&{\text{if }}x<0\\+x,&{\text{if }}x\geq 0.\end{cases}}}For all values ofx{\displaystyle x} less than zero, the first sub-function (x{\displaystyle -x}) is used, which negates the sign of the input value, making negative numbers positive. For all values ofx{\displaystyle x} greater than or equal to zero, the second sub-function(x{\displaystyle x}) is used, which evaluates trivially to the input value itself.

The following table documents the absolute value function at certain values ofx{\displaystyle x}:

xf(x)Sub-function used
−33x{\displaystyle -x}
−0.10.1x{\displaystyle -x}
00x{\displaystyle x}
1/21/2x{\displaystyle x}
55x{\displaystyle 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

[edit]

Continuity and differentiability of piecewise-defined functions

[edit]
Plot of the piecewise-quadratic functionf(x)={x2ifx<0.7071.5(x1.414)2if0.707x{\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 atx0=0.707{\displaystyle x_{0}=0.707}.

A piecewise-defined function iscontinuous 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 atx0{\displaystyle 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 correspondingopen 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.[7][8][9]

Applications

[edit]

In applied mathematical analysis, "piecewise-regular" functions have been found to be consistent with manymodels of the human visual system, where images are perceived at a first stage as consisting of smooth regions separated by edges (as in acartoon);[10]acartoon-like function is aC2 function, smooth except for the existence of discontinuity curves.[11]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 innearest-neighbor interpolation.

See also

[edit]
Wikibooks has a book on the topic of:Gnuplot#Piecewise-defined functions

References

[edit]
  1. ^"Piecewise Functions".www.mathsisfun.com. Retrieved2020-08-24.
  2. ^abcdWeisstein, Eric W."Piecewise Function".MathWorld.
  3. ^"Piecewise functions".brilliant.org. Retrieved2020-09-29.
  4. ^S. M. Nikolsky (1977).A Course Of Mathematical Analysis Vol 1. p. 178.
  5. ^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 (inactive 2025-08-11).{{cite journal}}: CS1 maint: DOI inactive as of August 2025 (link)
  6. ^A feasible weaker requirement is that all definitions agree on intersecting subdomains.
  7. ^Rehmann, Ulf (2001) [1994]."One-sided derivative".Encyclopedia of Mathematics.EMS Press.
  8. ^Ilyin, V. A.; Poznyak, E. G. (1982).Fundamentals Of Mathematical Analysis. Vol. 1. Translated from Russian by Irene Aleksanova. Mir Publishers Moscow. pp. 146, 177.ISBN 978-93-859-2386-9.
  9. ^Canuto, Claudio; Tabacco, Anita (2008).Mathematical Analysis I. Translated by: Simon G. Chiossi. Milan: Springer-Verlag Italia. pp. 83, 176.ISBN 978-88-470-0875-5.
  10. ^Kutyniok, Gitta; Labate, Demetrio (2012)."Introduction to shearlets"(PDF).Shearlets.Birkhäuser:1–38. Here: p.8
  11. ^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.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Piecewise_function&oldid=1327002560"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp