Composition $\left(f \circ g, g \circ f \right)$ of piecewise functions

481 Views Asked by At

I'm trying to solve this problem from my homework a few hours now, I know how to do composition for regular functions, but can't seem to understand the composition of piecewise functions.

I have checked other solutions here, but didn't get it.

Here is the problem: $$ f(x) = \begin{cases} x+1, & \text{if $x<0$} \\ 3x+4, & \text{if $x\ge0$} \end{cases} $$ $$ g(x) = \begin{cases} 3x+2, & \text{if $x<3$} \\ 5x-8, & \text{if $x\ge3$} \end{cases} $$ find $f(g(x))$ and $g(f(x))$? thanks :)

1

There are 1 best solutions below

7
On BEST ANSWER

Here is step-by-step hints to do it:

  1. For the composition of $f(g(x))$, focus on $g(x)$ first, it has a range of $\mathbb R$ and since $f(x)$ has a domain of $\mathbb R$ too, everything is well.
  2. You see that $f(x)$ is a piecewise function with two parts for $x<0$ and $x\ge0$, so you need to solve these inequalities by substituting x with $g(x)$. Now you realize that the composite function has four pieces, with domains determined by solving: $$ \begin{cases} 3x+2<0\\ x<3 \end{cases} $$ $$ \begin{cases} 3x+2\ge0\\ x<3 \end{cases} $$ $$ \begin{cases} 5x-8<0\\ x\ge3 \end{cases} $$ $$ \begin{cases} 5x-8\ge0\\ x\ge3 \end{cases} $$
  3. Finally, put each piece of $g(x)$ into $f(x)$, simplify the expression, and write down the domains that you just found in step 2 for each piece. $$ f(g(x))= \begin{cases} (3x+2)+1, \ ...\\ 3(3x+2)+4, \ ...\\ (5x-8)+1, \ ...\\ 3(5x-8)+4, \ ...\\ \end{cases} $$

Then you have it! In the same way you can find $g(f(x))$ without much effort.