Skip to main content

Absolute-Value and Piecewise Functions

A distance is positive on either side of a reference point, even when the signed difference changes. How can one function express both sides? We will read absolute value as distance and draw a function with separate rules on different intervals.

  • Absolute value and piecewise rule: Absolute value is distance from zero. A piecewise rule selects a formula by the input interval.

Core ideas​

Absolute value​

The absolute value of x−2x-2 is the distance from xx to 22. Its graph has vertex (2,0)(2,0) and equal outputs at equal distances on either side.

Piecewise rules​

First check which interval contains the input, then apply its rule. The absolute value of xx uses −x-x for x<0x<0 and xx for x≥0x\ge0.

Endpoints​

If one rule gives 00 for x<2x<2 and another gives 11 for x≥2x\ge2, draw an open point at (2,0)(2,0) and a filled point at (2,1)(2,1).

Essential example​

On a number line, ∣x−2∣\lvert x-2\rvert measures distance from 22. For x<2x<2, the distance is 2−x2-x. For x≥2x\ge2, it is x−2x-2. Both sides reach zero at the boundary. In unitless graph coordinates, the horizontal axis is the input xx and the vertical axis is the distance.

∣x−2∣={2−x,x<2,x−2,x≥2.\lvert x-2\rvert= \begin{cases} 2-x, & x<2,\\ x-2, & x\ge2. \end{cases}

The graph has a corner at (2,0)(2,0) because the slope changes from −1-1 to 11. The inputs 00 and 44 each give distance 22. Solving ∣x−2∣=3\lvert x-2\rvert=3 means finding the inputs three units from 22, namely −1-1 and 55. The inequality ∣x−2∣≤3\lvert x-2\rvert\le3 describes every input between those two endpoints.

Graph a jump​

Suppose a parking model charges 4 dollars for a stay of at most one hour and 7 dollars for a stay longer than one hour and at most two hours. Let tt be the duration in hours. For positive tt the rule is P(t)=4P(t)=4 on (0,1](0,1] and P(t)=7P(t)=7 on (1,2](1,2]. A stay of exactly one hour belongs to the first interval.

Two horizontal parking-price segments with distinct included and excluded endpoints at one hour
At the pricing boundary, the filled point gives the actual charge and the open point marks the excluded value.

Check coverage​

A piecewise definition needs one output for every input in its domain. If two rules both include an endpoint, their outputs must agree there. The parking prices do not agree at t=1t=1, so only one interval may include that input. Inputs longer than two hours are outside the stated model.

Join two rules without a jump​

Suppose a garage instead charges 4 dollars up to one hour and adds 3 dollars per hour of time beyond that first hour. The second rule is 4+3(t−1)4+3(t-1) for 1<t≤21<t\le2. As tt approaches 11 from above, this expression approaches 44, which matches the actual price at t=1t=1. At t=1.5t=1.5, the model gives 5.505.50 dollars. The boundary still changes which rule to use, but the two pieces meet at the same height.

Keep and continue​

Keep the habit of checking the input before using a rule. Next, check an input twice when the output of one function becomes the input of another.

Course outline

Previous: Graph Transformations

Next: Composition and Inverse Functions