Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Piecewise function
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Notation and interpretation == [[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=mathworld/> The <math>\text{if}</math> or <math>\text{for}</math> is rarely omitted at the start of the right column.<ref name=mathworld/> The subdomains together must cover the whole [[Domain of a function|domain]]; sometimes 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> 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]] function:<ref name=mathworld/> <math display="block">|x| = \begin{cases} -x, & \text{if } x < 0 \\ +x, & \text{if } x \ge 0 . \end{cases} </math> For all values of <math>x</math> less than zero, the first sub-function (<math>-x</math>) is used, which negates the sign of the input value, making negative numbers positive. For all values of <math>x</math> greater than or equal to zero, the second sub-function {{nobr|(<math>x</math>)}} is used, which evaluates trivially to the input value itself. The following table documents the absolute value function at certain values of <math>x</math>: {| class="wikitable" ! style="width: 3em" | ''x'' ! style="width: 3em" | ''f''(''x'') !Sub-function used |- |−3 ||3 ||<math>-x</math> |- |−0.1||0.1||<math>-x</math> |- |0 ||0 ||<math>x</math> |- |1/2 ||1/2||<math>x</math> |- |5 ||5 ||<math>x</math> |- |} 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.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)