Question
Question: If \(f\left( x \right)\) is defined on \(\left[ -2,2 \right]\) and given by \(f\left( x \right)=\lef...
If f(x) is defined on [−2,2] and given by f\left( x \right)=\left\\{ \begin{matrix} -1,\text{ }-2\le x\le 0 \\\ x-1,\text{ }0\le x\le 2 \\\ \end{matrix} \right. and g(x)=f(∣x∣)+∣f(x)∣. Find g(x)
Solution
We will find the values of f(∣x∣) and ∣f(x)∣ by using the function f(x) individually and adding them up to get the value of g(x).
Complete step by step solution:
Given that,
f\left( x \right)=\left\\{ \begin{matrix}
-1,\text{ }-2\le x\le 0 \\\
x-1,\text{ }0\le x\le 2 \\\
\end{matrix} \right.
The function ∣x∣ convert the −ve values into +ve values i.e. the result of the function ∣x∣ should be a +ve value. We get the +ve value from the function ∣x∣ by substituting the appropriate value either +x or −x to get the result of function as +ve. Mathematically
\left| x \right|=\left\\{ \begin{matrix}
+x,\text{ for }x\ge 0 \\\
-x,\text{ for }x<0 \\\
\end{matrix} \right.
Here we have x∈[−2,2] then ∣x∣∈[0,2], so
f(∣x∣)=∣x∣−1 for all x∈[−2,2]
Substitute the function ∣x∣ in above equation,
f\left( \left| x \right| \right)=\left\\{ \begin{matrix}
x-1,\text{ }0\le x\le 2 \\\
-x-1,\text{ }-2\le x<0 \\\
\end{matrix} \right.
Now the value of ∣f(x)∣ is
\begin{aligned}
& \left| f\left( x \right) \right|=\left\\{ \begin{matrix}
\left| -1 \right|,\text{ }-2\le x<0 \\\
\left| x-1 \right|,\text{ }0\le x\le 2 \\\
\end{matrix} \right. \\\
& =\left\\{ \begin{matrix}
1,\text{ }-2\le x<0 \\\
\left| x-1 \right|,\text{ }0\le x\le 2 \\\
\end{matrix} \right.
\end{aligned}
Now we have to change the value of ∣x−1∣ in the range of [0,2] to get a +ve. Hence we will take +(x−1) for 1≤x≤2 and we will take −(x−1) for 0≤x<1. Mathematically we can write it as
\left| x-1 \right|=\left\\{ \begin{matrix}
x-1,\text{ }1\le x\le 2 \\\
1-x,\text{ }0\le x<1 \\\
\end{matrix} \right.
Hence the value of ∣f(x)∣ is
\left| f\left( x \right) \right|=\left\\{ \begin{matrix}
1,\text{ }-2\le x<0 \\\
1-x,\text{ }0\le x<1 \\\
x-1,\text{ }1\le x\le 2 \\\
\end{matrix} \right.
Now we have given that g(x)=f(∣x∣)+∣f(x)∣, so
\begin{aligned}
& g\left( x \right)=\left\\{ \begin{matrix}
-x-1,\text{ }-2\le x\le 0 \\\
x-1,\text{ }0\le x<1 \\\
x-1,\text{ }1\le x\le 2 \\\
\end{matrix} \right.+\left\\{ \begin{matrix}
1,\text{ }-2\le x<0 \\\
1-x,\text{ }0\le x<1 \\\
x-1,\text{ }1\le x\le 2 \\\
\end{matrix} \right. \\\
& =\left\\{ \begin{matrix}
-x-1+1,\text{ }-2\le x\le 0\text{ } \\\
x-1+1-x,\text{ }0\le x<1 \\\
x-1+x-1,\text{ }1\le x\le 2 \\\
\end{matrix} \right. \\\
& =\left\\{ \begin{matrix}
-x,\text{ }-2\le x\le 0 \\\
0,\text{ }0\le x<1 \\\
2\left( x-1 \right),\text{ }1\le x\le 2 \\\
\end{matrix} \right.
\end{aligned}
Note: The value of ∣x∣ in the function f(∣x∣) is modified as +x and −x in the range of x∈[0,2] and −2≤x<0 respectively. While finding the value of ∣f(x)∣ first apply mode function to the variables in the function f(x) and then modify the variables based on the range of that variable in order to get a +ve value.