Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store
seo-qna
SearchIcon
banner

If $f\left( x \right)$ is defined on $\left[ -2,2 \right]$ 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\left( x \right)=f\left( \left| x \right| \right)+\left| f\left( x \right) \right|$. Find $g\left( x \right)$

Answer
VerifiedVerified
542.4k+ views
Hint: We will find the values of $f\left( \left| x \right| \right)$ and $\left| f\left( x \right) \right|$ by using the function $f\left( x \right)$ individually and adding them up to get the value of $g\left( x \right)$.

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 $\left| x \right|$ convert the $-ve$ values into $+ve$ values i.e. the result of the function $\left| x \right|$ should be a $+ve$ value. We get the $+ve$ value from the function $\left| x \right|$ 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\in \left[ -2,2 \right]$ then $\left| x \right|\in \left[ 0,2 \right]$, so
$f\left( \left| x \right| \right)=\left| x \right|-1$ for all $x\in \left[ -2,2 \right]$
Substitute the function $\left| x \right|$ 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 $\left| f\left( x \right) \right|$ is
$\begin{align}
  & \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{align}$
Now we have to change the value of $\left| x-1 \right|$ in the range of $\left[ 0,2 \right]$ to get a $+ve$. Hence we will take $+\left( x-1 \right)$ for $1\le x\le 2$ and we will take $-\left( x-1 \right)$ for $0\le 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 $\left| f\left( x \right) \right|$ 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\left( x \right)=f\left( \left| x \right| \right)+\left| f\left( x \right) \right|$, so
$\begin{align}
  & 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{align}$

Note: The value of $\left| x \right|$ in the function $f\left( \left| x \right| \right)$ is modified as $+x$ and $-x$ in the range of $x\in \left[ 0,2 \right]$ and $-2\le x<0$ respectively. While finding the value of $\left| f\left( x \right) \right|$ first apply mode function to the variables in the function $f\left( x \right)$ and then modify the variables based on the range of that variable in order to get a $+ve$ value.