# How do you write f(x)=|x-4| as a piecewise function?

Mar 28, 2017

$f \left(x\right) = \left\{\begin{matrix}x - 4 & \textcolor{w h i t e}{\text{XX}} & x > 4 \\ 0 & \null & x = 4 \\ 4 - x & \null & x < 4\end{matrix}\right.$

#### Explanation:

Basic definitions of absolute value and "piecewise function".

Mar 28, 2017

#### Explanation:

Piecewise functions are defined using the common functional notation, where the body of the function is an array of functions and associated subdomains. Crucially, in most settings, there must only be a finite number of subdomains, each of which must be an interval, in order for the overall function to be called "piecewise".
graph{|x-4| [-5, 15, -1.85, 8.15]}