# How do you write  y= |x-5| -4 as a piecewise function?

Oct 20, 2017

|f(x)| = {(f(x); f(x) >= 0),(-f(x); f(x) < 0):}

Substitute $x - 5$ for $f \left(x\right)$

|x - 5| = {(x - 5; x - 5 >= 0),(-(x - 5); x - 5 < 0):}

Simplify the inequalities:

|x - 5| = {(x - 5; x >= 5),(-(x - 5); x < 5):}

Distribute the -1:

|x - 5| = {(x - 5; x >= 5),(5-x; x < 5):}

Make two separate equation of the original:

y = {((x-5)-4;x>=5),((5-x)-4; x < 5):}

Simplify:

y = {(x-9;x>=5),(1-x; x < 5):}

Oct 20, 2017

$y = - x + 1$ for $x \le 5$
$y = x - 9$ for $x > 5$

#### Explanation:

First let's look at the graph or the original function $y = \left\mid x - 5 \right\mid$

The left half of the graph where $x \le 5$ has a slope of $m = - 1$ and a y intercept of $\left(0 , 1\right)$.

Using the slope intercept form of a line $y = m x + b$ where $m = - 1$ and $b = 1$ gives the equation is $y = - 1 x + 1$ or $y = - x + 1$

The right half of the graph where $x \ge 5$ has a slope of $m = 1$ and passes through the point $\left(5 , - 4\right)$, which is the vertex of the graph as shown in the original equation.

Using the slope intercept form of the line $y - {y}_{1} = m \left(x - {x}_{1}\right)$ where $m = 1$ and $\left({x}_{1} , {y}_{1}\right) = \left(5 , - 4\right)$ gives the equation

$y - - 4 = 1 \left(x - 5\right)$
$y + 4 = x - 5$
$y = x - 9$ for $x \le 5$

Written in piecewise form

$y = - x + 1$ for $x \le 5$
$y = x - 9$ for $x > 5$

Note that I arbitrarily assigned $x = 5$ to the first equation.