Log in Sign up
Back to Discover
🔢

Piecewise function

math Maturity 11-13

Some math rules change. They work in parts. One part may go up. Another part may go down.

Absolute value.svg
Absolute value.svg
This helps us draw shapes. It is like a path with turns. Can you find a path with turns?

39 words

Some math rules work in parts.

Piecewise linear function gnuplot.svg
Piecewise linear function gnuplot.svg
We can split a big group into smaller pieces. Each piece can have its own rule. One rule might make a line go up. Another rule might make a line go down.
Absolute value.svg
Absolute value.svg
This is like a path with many turns. Some paths have jumps in them. These jumps happen where one piece ends. A rule can also stay the same for a while. This makes a shape like a set of steps. These rules help us draw many different shapes.

92 words

Imagine a path that changes its rule at different spots.

Piecewise linear function gnuplot.svg
Piecewise linear function gnuplot.svg
In math, we call this a piecewise function. This is a function that uses different rules for different parts. We call these parts subdomains. Each subdomain is a small section of the whole group.
Absolute value.svg
Absolute value.svg
One famous example is the absolute value function. It uses one rule for numbers less than zero. It uses a different rule for numbers zero or higher. This makes negative numbers become positive.

Sometimes these parts join together smoothly. Other times, there is a jump. A jump discontinuity is a break where the path skips.

Upper semi.svg
Upper semi.svg
A function can also be piecewise constant. This means the rule stays the same for a while. This can make a shape that looks like steps. These rules help us model how people see. Our eyes often see smooth areas and sharp edges. This is a lot like how a cartoon looks. We can use these pieces to make many shapes.

168 words

Imagine a path that changes its rules at different spots. In math, we call this a piecewise function. This type of function uses different rules for different sections. We call these sections subdomains. Each subdomain is a small part of a larger group.

Piecewise linear function gnuplot.svg
Piecewise linear function gnuplot.svg
A piecewise function is a way to specify how a function works. It can also be a property of the function itself. Some people call these hybrid functions or functions defined by cases. This helps us describe shapes that are not the same all the way through.

To use a piecewise function, you must first pick the right rule. You look at your input value to find its subdomain. Then, you use the specific sub-function for that section.

Absolute value.svg
Absolute value.svg
For example, look at the absolute value function. If a number is less than zero, it uses one rule. This rule makes negative numbers positive. If a number is zero or higher, it uses a different rule. This second rule simply keeps the number the same. For instance, the input -3 gives an output of 3. The input 5 gives an output of 5.

These functions can have many different shapes. A step function is made of constant sub-functions. This makes the graph look like a set of stairs. You might also see a piecewise linear function. This uses straight lines for its parts. Other types include piecewise smooth or piecewise continuous functions. Some use polynomial parts and are called splines. Even power-law parts can be used to build these functions. These different pieces allow for very complex and interesting patterns.

Sometimes the pieces of a function join together perfectly. We call this being continuous.

Upper semi.svg
Upper semi.svg
For a function to be continuous, the parts must meet without any breaks. There should be no jump discontinuity at the endpoints. A jump discontinuity is a spot where the path skips. If the pieces meet smoothly, the function can also be differentiable. This means the slopes of the parts match where they touch. If they do not match, the function might have a sharp corner.

We use these ideas to understand the real world. For example, they help us model the human visual system. Our eyes often see smooth regions separated by sharp edges. This is very much like how a cartoon looks.

Absolute value.svg
Absolute value.svg
Scientists use these models to understand how we see images. We can also use piecewise functions for interpolation. This is a way to fill in gaps between known points. These math tools help us turn many small parts into one big picture.

433 words

A piecewise function is a mathematical rule that changes depending on the input value. You might also hear it called a piecewise-defined function, a hybrid function, or a function defined by cases. In these functions, the domain—the set of all possible input values—is partitioned into several distinct intervals called subdomains.

Piecewise linear function gnuplot.svg
Piecewise linear function gnuplot.svg
Within each subdomain, the function follows its own specific rule, which is known as a sub-function. This method allows mathematicians to describe complex behaviors by breaking them into simpler, manageable parts. While any function can technically be rewritten this way, the term often describes a specific property of a function itself.

To evaluate a piecewise function, you must follow a specific sequence of steps. First, you look at your input value to determine which subdomain it belongs to. Once you identify the correct interval, you select the sub-function associated with that specific part.

Absolute value.svg
Absolute value.svg
For example, consider the absolute value function. This function uses one rule for all values where x is less than zero. This sub-function negates the sign of the input to make negative numbers positive. For all values where x is greater than or equal to zero, it uses a different sub-function. This second rule simply evaluates the input value as it is. Thus, an input of -3 results in 3, while an input of 5 results in 5.

There are many different types of piecewise functions based on the nature of their sub-functions. A step function, or piecewise constant function, uses constant sub-functions to create a shape like stairs. A piecewise linear function is built from straight-line sub-functions. Other versions include piecewise smooth or piecewise continuous functions. You may also encounter splines, which are functions composed of polynomial sub-functions. Some splines are even constrained to be smooth at the joints where the pieces meet. Other complex types include broken power laws and B-splines.

Mathematically, the subdomains must cover the entire domain of the function. They are typically required to be nonempty intervals, which can be single points or unbounded. In many cases, these subdomains are pairwise disjoint, meaning they do not overlap. However, a weaker requirement allows for overlapping subdomains if all the definitions agree at the intersection. For functions with bounded domains, there are usually only a finite number of subdomains. Functions with unbounded domains can have infinitely many subdomains, provided they are spread out appropriately.

Upper semi.svg
Upper semi.svg
The way these pieces connect determines the continuity and differentiability of the function. A piecewise function is continuous on an interval if its sub-functions are continuous and there are no discontinuities at the subdomain endpoints. If a function has a break where one part ends and another begins, it has a jump discontinuity. For a function to be differentiable, it must first be continuous. Additionally, the one-sided derivatives at the endpoints must exist and coincide. This means the slopes of the two neighboring sub-functions must match perfectly where they touch.

These mathematical concepts are highly significant in applied mathematical analysis. For instance, piecewise-regular functions are consistent with models of the human visual system. Our eyes often perceive images as smooth regions separated by distinct edges, much like a cartoon. In these models, the function is smooth except for the existence of discontinuity curves. Researchers have used shearlets to provide sparse approximations for these types of 2D and 3D models. This shows how piecewise math helps us represent how we actually see the world.

Beyond vision, piecewise functions are vital for interpolation. This is a method used to estimate values between known data points, such as in nearest-neighbor interpolation. By using different rules for different segments, mathematicians can create highly accurate models for various scientific fields. Whether describing the sharp turn of an absolute value graph or the smooth curves of a spline, piecewise functions turn many individual parts into a single, coherent mathematical description.

643 words
🖼️ Images & Media (4)
File:Piecewise linear function gnuplot.svg
Piecewise linear function gnuplot.svg
File:Absolute value.svg
Absolute value.svg
File:PiecewiseMonoDiff svg.svg
PiecewiseMonoDiff svg.svg
File:Upper semi.svg
Upper semi.svg
Up Next
🔢
Step function
Math
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.