Find \(g(x)\) if \(g(x)=f(|x|)+|f(x)|\)
Question
If \(f(x)\) be defined on \([-2,2]\) and is given by
\[ f(x)= \begin{cases} -1, & -2 \le x \le 0 \\ x-1, & 0 < x \le 2 \end{cases} \]and
\[ g(x)=f(|x|)+|f(x)| \]Find \(g(x)\).
Solution
Given
\[ f(x)= \begin{cases} -1, & -2 \le x \le 0 \\ x-1, & 0 < x \le 2 \end{cases} \]We need to find
\[ g(x)=f(|x|)+|f(x)| \]Case 1: \(-2 \le x \le 0\)
Since \(x \le 0\),
\[ |x|=-x \]Now \(|x| \in [0,2]\), therefore
\[ f(|x|)=|x|-1=-x-1 \]Also,
\[ f(x)=-1 \]Hence,
\[ |f(x)|=1 \]Therefore,
\[ g(x)=(-x-1)+1=-x \]So,
\[ g(x)=-x \qquad \text{for } -2\le x\le0 \]Case 2: \(0 < x \le 1\)
Since \(x>0\),
\[ |x|=x \]Thus,
\[ f(|x|)=f(x)=x-1 \]Now for \(0 Therefore, Hence, So, Here also, Therefore, Since \(x>1\), Thus, Hence, So,