Absolute Value as Piecewise Function

Given an expression like |x−a||x - a|, its piecewise form is:

|x−a|={x−a,if x≥a−(x−a),if x<a|x - a| = \begin{cases} x - a, & \text{if } x \geq a \\ -(x - a), & \text{if } x < a \end{cases}

Example

Rewrite f(x)=|x−2|f(x) = |x - 2| as a piecewise function:

f(x)={x−2,if x≥2−(x−2),if x<2={x−2,x≥2−x+2,x<2f(x) = \begin{cases} x - 2, & \text{if } x \geq 2 \\ - (x - 2), & \text{if } x < 2 \end{cases} = \begin{cases} x - 2, & x \geq 2 \\ - x + 2, & x < 2 \end{cases}

This representation is useful when:

  • Solving equations involving |x−a||x - a|
  • Graphing the function
  • Performing algebraic analysis
Last updated