Skip to content

Piecewise and Absolute Value Functions

In this lesson you’ll learn how to define, evaluate, graph, and analyze piecewise functions and absolute value functions. If you covered piecewise functions in Algebra 2, this is a recap with some new depth, including writing absolute value expressions as piecewise functions and analyzing continuity at the boundary points.

A piecewise function uses different rules for different parts of its domain. It’s written using cases:

f(x)={rule 1if condition 1rule 2if condition 2f(x) = \begin{cases} \text{rule 1} & \text{if condition 1} \\ \text{rule 2} & \text{if condition 2} \end{cases}

To evaluate: check which condition the input satisfies, then use that rule. The key is paying attention to the boundary points and whether they use < or ≤.

The absolute value function is the most common piecewise function:

f(x)=x={xif x0xif x<0f(x) = |x| = \begin{cases} x & \text{if } x \geq 0 \\ -x & \text{if } x < 0 \end{cases}

Its graph is a V-shape with vertex at the origin. Transformations work the same as with other functions: y = a|x - h| + k has vertex at (h, k), opens up if a > 0 and down if a < 0, and is stretched or compressed by |a|.

Example 1: Evaluate a piecewise function

f(x)={2x+5if x<0x23if x0f(x) = \begin{cases} 2x + 5 & \text{if } x < 0 \\ x^2 - 3 & \text{if } x \geq 0 \end{cases}

Find f(-2) and f(3):

For f(-2): since -2 < 0, use the first rule:

f(2)=2(2)+5=4+5=1f(-2) = 2(-2) + 5 = -4 + 5 = 1

For f(3): since 3 ≥ 0, use the second rule:

f(3)=323=93=6f(3) = 3^2 - 3 = 9 - 3 = 6

Example 2: Graph y = |x - 2| + 1

This is the basic V-shape shifted right 2 and up 1. The vertex is at (2, 1). The left arm has slope -1 and the right arm has slope +1.

Example 3: Write |2x - 6| as a piecewise function

First find the critical point where the expression inside equals zero: 2x - 6 = 0, so x = 3.

2x6={2x6if x3(2x6)if x<3={2x6if x32x+6if x<3|2x - 6| = \begin{cases} 2x - 6 & \text{if } x \geq 3 \\ -(2x - 6) & \text{if } x < 3 \end{cases} = \begin{cases} 2x - 6 & \text{if } x \geq 3 \\ -2x + 6 & \text{if } x < 3 \end{cases}

Example 4: Check continuity at a boundary

g(x)={x+4if x<23xif x2g(x) = \begin{cases} x + 4 & \text{if } x < 2 \\ 3x & \text{if } x \geq 2 \end{cases}

At x = 2, check both sides:

  • From the left: x + 4 = 2 + 4 = 6
  • From the right: 3x = 3(2) = 6

Both sides give 6, so g is continuous at x = 2. If they didn’t match, there would be a jump discontinuity.

Piecewise and absolute value functions model many real situations:

  • Tax brackets: different rates apply to different income ranges
  • Shipping costs: base fee plus per-pound charge, with different rates above certain weights
  • Utility pricing: one rate for the first 500 kWh, a higher rate after that
  • Distance and displacement: absolute value gives total distance regardless of direction
  • Temperature control: heating kicks in below a setpoint, cooling above it

Example: a phone plan charges 30/monthforthefirst5GB,then30/month for the first 5 GB, then 10 per additional GB. That’s a piecewise function:

Cost(x)={30if x530+10(x5)if x>5\text{Cost}(x) = \begin{cases} 30 & \text{if } x \leq 5 \\ 30 + 10(x - 5) & \text{if } x > 5 \end{cases}
A piecewise function is defined by:
The graph of $y = |x - 3| + 2$ has its vertex at:
When evaluating a piecewise function, the first step is to:
$|x|$ written as a piecewise function is:
A piecewise function has a jump discontinuity at $x = a$ when: