How do you graph y = -2|x-4|+4?

1 Answer
Apr 20, 2018

Try getting rid of the absolute value operator by rewriting it as a piecewise function.
graph{-2abs(x-4)+4 [-10, 10, -5, 5]}

Explanation:

The inner function of the absolute value operator has a single zero at x=4. Thus the output of the absolute value would be linear on ranges (-infty , 4) and (4, infty). Hence it would be possible to define an equivalent piecewise function with no absolute values on the two ranges.

y=-2color(blue)([color(red)(-)color(black)((x-4))])+4=2(x-4)+4=2x-4,
x in (-infty , 4)

y=-2color(blue)([color(black)((x-4))])+4=-2x+12,
x in (4, infty)

Note that you'll need to reverse the sign of the inner function when removing the absolute value operator in case the expression inside the absolute value yields a negative value.

Plotting the two functions on their respective range gives:
Created with MathematicaCreated with Mathematica
Combining the two rays will give the final v-shaped curve.
graph{-2abs(x-4)+4 [-4, 16, -5, 5]}