# Derivative of Composite Function

1. Dec 7, 2011

### Kenji Liew

1. The problem statement, all variables and given/known data

f(x)=
\begin{cases}
5x+2 &, x \leq 1 \\
3x^2 &, 1<x<2\\
4-x &, x\geq 2
\end{cases}

g(x)=
\begin{cases}
\frac{1}{5}(2+3 cos x) &, x <0 \\
4-sin x &, x \geq 0
\end{cases}

Find $h = f \circ g$ and then by using chain rule to find the derivative of $f \circ g$ .

2. Relevant equations

h(x)=f\circ g =
\begin{cases}
4+3 cos x &, x <0 \\
sin x &, x \geq 0
\end{cases}

3. The attempt at a solution
From $h(x) = f \circ g$ above, I directly differentiate and I get the following

h'(x)=
\begin{cases}
-3 sin x &, x < 0 \\
cos x &, x > 0
\end{cases}

If chain rule are requested in finding the derivative, I know the formula is $h'(x) = f' (g(x)) \cdot g'(x)$. Any idea to find the derivative using chain rule?

Thank you.

2. Dec 7, 2011

### LCKurtz

It seems overly pedantic to do it explicitly with the chain rule, but if you must do so, just write h(x) as a two piece formula like this:

If x ≥ 0, f(x) = 4-x, g(x) = 4 - sin(x) and $h=f\circ g$
If x < 0 f(x) = 5x+2, g(x) = (1/5)(2+3cos(x)) and $h=f\circ g$
Then do the chain rule on each piece.

3. Dec 7, 2011

### Kenji Liew

Thank you for the reply. I got the idea from it. This is because my lecturer want us to compare whether the answer obtained from directly differentiate $h(x)$ is the same
as the answer obtained from the chain rule.