1. ## Function composition problem

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

$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 $h(x)=f \circ g$

2. Hello, cristian!

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

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

$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: . $h(x)\:=\: f\circ g$

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

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

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

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

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

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

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

Therefore: . $\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:
$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

4. Originally Posted by cristian
I tried that too, but the book says the correct answer is:
$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
The textbbok is correct.
Notice that $g(x)<0$ on $\left(-2,\frac{1}{2}\right)$.
Otherwise it is not negative.
So use the corresponding definitions of $f$ on those three intervals.

5. Thank you.