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

2 Answers
Oct 20, 2017

Start with the piecewise definition of the absolute value function:

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

Substitute x - 5 for f(x)

|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<=5
y=x-9 for x>5

Explanation:

First let's look at the graph or the original function y=abs(x-5)

![desmos.com](useruploads.socratic.orguseruploads.socratic.org)

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

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

The right half of the graph where x>=5 has a slope of m=1 and passes through the point (5,-4), 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(x-x_1) where m=1 and (x_1,y_1) = (5,-4) gives the equation

y- -4 = 1 (x-5)
y+4= x-5
y=x-9 for x<=5

Written in piecewise form

y=-x+1 for x<=5
y=x-9 for x>5

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