Question about an absolute value inequality.

66 Views Asked by At

The question states:

Given $g(x) = |x-2| - |x| +2$, express $g(x)$ without absolute value bars if $x$ is in given interval -

$1.$ $[2, +\infty)$

$2.$ $[ -\infty, 0)$

$3.$ $[0,2)$

So I found the correct answers to be: (a) $0$, (b) $4$, (c) $4-2x$.

I have tried this problem multiple times, and the x values always seem to cancel out. Can someone explain to me how to arrive to the correct answers shown?

Thanks

2

There are 2 best solutions below

0
On

When $x > 2$ (i.e. case (a)), then all absolute values are positive. $$g(x) = x - 2 - x + 2 = 0$$ for all $x$

When $x < 0$ (i.e. case (b)), then $$g(x) = -x + 2 + x + 2 = 4$$ as if $x = -n$ for some $n > 0$, then $|-n - 2| = |-(n+2)| = n + 2 = -x + 2$ and $|x| = |-n| = n = -x$.

When $0 \leq x < 2$ (i.e. case (c)), the above argument only applies to the first absolute value, as it becomes negative. Just let $x - 2 = -j$, $|-j| = j = -x + 2$. So $|x - 2| = -x + 2$ while $|x| = x$. $$g(x) = -x + 2 - x + 2 = -2x + 4$$

0
On

The definition of |x| is "x if $x\ge 0$, -x if $x> 0$. From that |x- 2| is $x- 2$ if $x- 2\ge 0$, $-(x- 2)= 2- x$ if $x- 2< 0$. Since there are both |x- 2| and |x| we need to divide the real numbers into three intervals, $x< 0$, $0\le x< 2$ and $2\le x$.
If x< 0 it is also true that x< 2 so |x-2|- |x|+ 2= 2- x- (-x)+ 2=2- x+ x+ 2= 4. If $0\le x< 2$ $|x- 2|- |x|+ 2= 2- x- x+ 2= 4- 2x$. If $2\le x$ 0 is also less than x so |x- 2|- |x|+ 2= x- 2- x+ 2= 0.