math.wiki
Functions › Piecewise and absolute value functions
Sign in

Piecewise and absolute value functions

A phone plan charges one rate up to a limit and another rate past it. How can a single function follow different rules on different stretches of its input?

Where you are 4 inside

What this area is about

Not every function is one formula. A piecewise function pairs several formulas with conditions on the input, such as x < 0 and x \ge 0. As long as the conditions do not overlap, each input in the domain meets exactly one formula and gets exactly one output. Two famous functions are built this way: the absolute value |x|, and the staircase that rounds every input down to an integer.

How these fit together

The general tool. Piecewise functions is an area of its own: evaluating, graphing, writing the formulas from a graph, and building one from a threshold in words.

Two special cases. The absolute value graph writes |x| as x for x \ge 0 and -x for x < 0, which draws a V with its corner at the origin. Step functions and the greatest integer function give a staircase that stays flat and jumps by 1 at every integer, the shape of a charge for every started unit.

A procedure. Transforming the absolute value graph shifts, flips and stretches the V into y = a|x - h| + k (with a \ne 0), with its corner at (h, k).

A path through it

Piecewise functions come first. Then the absolute value graph and step functions, in either order, and transforming the V after the absolute value graph (it also needs the general moves of graphing with transformations).

Next, making a piecewise function continuous chooses a parameter so two pieces meet, once you have limits and continuity.

math.wiki · updated 2026-11-08 · CC-BY-SA-4.0