1. ## Function composition problem

I have two functions $\displaystyle f,g:\Re \rightarrow \Re$
$\displaystyle f(x)=\left\{\begin{array}{cc}1 - x^2,&\mbox{ if } x\geq 0\\5x + 1, & \mbox{ if } x<0\end{array}\right.$
$\displaystyle g(x)=\left\{\begin{array}{cc}x^2,&\mbox{ if } x\leq -2\\2x - 1, & \mbox{ if } x>-2\end{array}\right.$

and I have to find function $\displaystyle h(x)=f \circ g$

2. Hello, cristian!

I have two functions $\displaystyle f,g:\Re \rightarrow \Re$

$\displaystyle f(x)=\left\{\begin{array}{cc}5x+1 & \text{ if } x < 0 \\ 1-x^2 & \text{ if } x\ge 0\end{array}\right.$

$\displaystyle g(x)=\left\{\begin{array}{cc}x^2 & \text{ if } x\leq -2 \\ 2x - 1 & \text{ if } x>-2\end{array}\right.$

and I have to find: .$\displaystyle h(x)\:=\: f\circ g$

We are concerned with three intervals: .$\displaystyle (\text{-}\infty, \text{-}2),\;(\text{-}2,0),\;(0,\infty)$

$\displaystyle \text{On }(\text{-}\infty,\text{-}2): \;\begin{Bmatrix}f(x) &=& 5x-1 \\ g(x) &=& x^2\end{Bmatrix}$

. . Hence: .$\displaystyle f\circ g \;=\;5(x^2)-1 \;=\;5x^2-1$

$\displaystyle \text{On }(\text{-}2,0):\; \begin{Bmatrix}f(x) &=& 5x+1 \\ g(x) &=& 2x-1 \end{Bmatrix}$

. . Hence: .$\displaystyle f\circ g \;=\;5(2x-1) + 1 \;=\;10x - 4$

$\displaystyle \text{On }(0,\infty):\;\begin{Bmatrix}f(x) &=& 1-x^2 \\ g(x) &=& 2x-1 \end{Bmatrix}$

. . Hence: .$\displaystyle f\circ g \;=\;1 - (2x-1)^2 \;=\;4x - 4x^2$

Therefore: .$\displaystyle \left\{ \begin{array}{cc} 5x^2 + 1 & \text{ if }x \leq \text{-}2 \\ 10x-4 & \text{ if }\text{-}2 < x < 0 \\ 4x - 4x^2 & \text{ if }x \ge 0 \end{array}\right.$

3. I tried that too, but the book says the correct answer is:
$\displaystyle f(x) = \left\{ \begin{array}{cc}1 - x^4 & \text{ if }x \leq \text{-}2 \\ 4x(1 - x) & \text{ if } x \geq \frac{1}{2} \\2(5x - 2) & \text{ if } -2<x<\frac{1}{2} \end{array}\right.$

4. Originally Posted by cristian
I tried that too, but the book says the correct answer is:
$\displaystyle f(x) = \left\{ \begin{array}{cc}1 - x^4 & \text{ if }x \leq \text{-}2 \\ 4x(1 - x) & \text{ if } x \geq \frac{1}{2} \\2(5x - 2) & \text{ if } -2<x<\frac{1}{2} \end{array}\right.$
The textbbok is correct.
Notice that $\displaystyle g(x)<0$ on $\displaystyle \left(-2,\frac{1}{2}\right)$.
Otherwise it is not negative.
So use the corresponding definitions of $\displaystyle f$ on those three intervals.

5. Thank you.