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

Nov 16, 2017

For x>4
y=-2x+8

For x<4
y=(2x-8)

For x=4
y=0

Explanation:

$\left\mid x - 4 \right\mid \ge 0$
$\implies$
$\mathmr{if} x = 4 \implies \left\mid x - 4 \right\mid = 0$
$\mathmr{if} x \ne 4 \implies \left\mid x - 4 \right\mid > 0$
$\implies$
$\left(- 2\right) \cdot \left(\left\mid x - 4 \right\mid\right) \le 0$
$\implies$
$\mathmr{if} x = 4 \implies - 2 \left\mid x - 4 \right\mid = 0$
$\mathmr{if} x \ne 4 \implies - 2 \left\mid x - 4 \right\mid < 0$

So we will separate to 3 cases:
case 1: $x > 4$
case 2: $x = 4 \implies y = 0$
case 3 $x < 4$

case 1 $\left(x > 4\right)$:
$\implies y = \left(- 2\right) \cdot \left(x - 4\right)$
$\implies y = - 2 x + 8$
$\implies m = - 2 , {y}_{0} = 8$

case 3 $\left(x < 4\right)$:
$\implies y = \left(- 2\right) \cdot \left(- 1\right) \left(x - 4\right)$
$\implies y = \left(- 2\right) \left(- x + 4\right)$
$\implies y = \left(2 x - 8\right)$
$\implies m = 2 , {y}_{0} = - 8$

graph:
graph{-2abs(x-4) [-10, 10, -5, 5]}