1

$ f(x) = \begin{cases} -1 && \text{for}-2\le x \le0\\ x-1 && \text{for } 0<x\le2 \end{cases}\\\text{Domain of }f(x) = [-2,2]\\ \text{Let there be be another function g(x),such that}\\ g(x) = f(|x|) + |f(x)| \\ $
$\text{What is function g(x)?}$

I worked the question and got $g(x) = \begin{cases} 0 & \text{for } 0<x<1 \\ -x & \text{for }-2\le x \le 0 \\ 2(x-1) & \text{for } 1\le x \le 2 \end{cases} $
Is there anything wrong with my answer?

1 Answers1

2

There's nothing wrong with your answer.

Case 1. $-2\leq x \leq 0$

\begin{array}{rl} g(x)&=f(-x) + |f(x)| \\ &=(-x)-1 +|-1| & \\ &=-x \end{array}

Case 2. $0< x < 1$

\begin{array}{rl} g(x)&=f(x) + |x-1| \\ &=x-1 + [-(x-1)] & \\ &=x-1-x+1\\ &=0 \end{array}

Case 3. $1 \leq x \leq 2$

\begin{array}{rl} g(x)&=f(x) + |x-1| \\ &= x-1 + (x-1) & \\ &=2(x-1). \end{array}