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
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$$