Special Functions: Piecewise, Floor and Absolute Value

Three functions that break the single-rule pattern: the piecewise function, the floor function that always rounds down, and absolute value with its V-shaped graph.

--

Most functions follow a single rule everywhere. These three do not. Each one either changes its rule partway along, chops a number downward, or strips away a minus sign — and each leaves a distinctive shape on the graph.

Concept The piecewise function

A piecewise function uses a different rule depending on which interval x falls into.

 f(x) = \begin{cases} x + 2 & x < 0 \\ x & x \geq 0 \end{cases}

Read the conditions carefully. Here  x = 0 belongs to the second rule, because that condition uses "greater than or equal to". Every input must match exactly one case.

Example Evaluating a piecewise function

Using the function above, find  f(-3) and  f(0) .

−3 is less than 0, so use  x + 2 .
 f(-3) = -3 + 2 = -1
0 satisfies  x \geq 0 , so use  x .
 f(0) = 0
⟹ f(−3) = −1 and f(0) = 0
Concept The floor function
a staircase of steps
The floor function  \lfloor x \rfloor gives the largest integer that is less than or equal to x. It always moves down — it never rounds to the nearest whole number.
 \lfloor 1.5 \rfloor = 1
 \lfloor 1.25 \rfloor = 1
 \lfloor 1.9 \rfloor = 1 — note that rounding would give 2.
 \lfloor 2.0 \rfloor = 2

Think of a teacher who simply discards the fractional part of a mark. Each step begins with a filled circle and ends with a hollow one, because the next whole number belongs to the following step.

Concept The absolute value function
f(x) = −x f(x) = x vertex at the origin
The absolute value  |x| turns any negative input positive and leaves positive inputs untouched. The two halves meet at the origin, producing a sharp V.
 |x| = \begin{cases} x & x \geq 0 \\ -x & x < 0 \end{cases}
 |5| = 5 and  |-5| = 5 .

Notice that absolute value is itself a piecewise function — the first idea in this lesson, applied to a particular pair of rules.

Summary
  1. A piecewise function changes its rule from one interval to the next.
  2. Check which case a boundary value like x = 0 belongs to.
  3. The floor function ⌊x⌋ takes the greatest integer not above x — always downward.
  4. Absolute value |x| makes negatives positive and leaves positives alone.
  5. Their graphs are separate pieces, a staircase, and a V.