[Math] Find the composition of a piecewise function

calculusderivativesfunction-and-relation-compositionfunctions

Let
$$f(x)=
\begin{cases}
5 &\text{, x $\geq$ 0}\\
x^2 &\text{, x < 0}
\end{cases}$$
and
$$g(x)=
\begin{cases}
\sqrt{x} &\text{, x > 3}\\
4 &\text{, x $<$ 3}
\end{cases}$$

I'm asked to find $f(g(x))$.

When I do it, the answer I get is:

$$f(g(x))=
\begin{cases}
5 &\text{, x $>$ 3}\\
5 &\text{,0 $\leq$ x < 3} \\
16 &\text{, x < 0}
\end{cases}$$

My answer is right except the 16 should be a 5 (that's the correct answer), I'm not sure how to get 5, I did this problem a couple of times and I keep getting 16. Also verified with desmos, and it should be 5?

Best Answer

We know that $ g(x) = \sqrt{x} $ when $ x \geq 3 $ and $ g(x) = 4 $ when $ x < 3 $. Clearly, $ g(x) $ is always positive.

Next, we want to substitute $ g(x) $ into $ f(x) $. We know that $ f(x) = 5 $ when $ x \geq 0 $ and $ f(x) = x^2 $ when $ x < 0 $.

The equation $ f(g(x)) $ is similar to $ f(x) $, except that the values of $ x $ in $ f(x) $ are replaced by the values of $ g(x) $. Since $ g(x) $ is always positive, then $ f(g(x)) = f(x>0) = 5 $.

Related Question