# How do you differentiate f(x) = sin(xcos(x)) using the chain rule?

Dec 9, 2015

You need the product rule too. The answer is $f ' \left(x\right) = \cos \left(x \cos \left(x\right)\right) \cdot \left(\cos \left(x\right) - x \sin \left(x\right)\right)$

#### Explanation:

The chain rule says $\frac{d}{\mathrm{dx}} \left(g \left(h \left(x\right)\right)\right) = g ' \left(h \left(x\right)\right) \cdot h ' \left(x\right)$. For the given function $f \left(x\right) = \sin \left(x \cos \left(x\right)\right)$ we have $g \left(x\right) = \sin \left(x\right)$ and $h \left(x\right) = x \cos \left(x\right)$.

The product rule, applied to $h \left(x\right)$, says $h ' \left(x\right) = \frac{d}{\mathrm{dx}} \left(x\right) \cdot \cos \left(x\right) + x \cdot \frac{d}{\mathrm{dx}} \left(\cos \left(x\right)\right) = \cos \left(x\right) - x \sin \left(x\right)$. Also, $g ' \left(x\right) = \cos \left(x\right)$.

Therefore,

$f ' \left(x\right) = g ' \left(h \left(x\right)\right) \cdot h ' \left(x\right) = \cos \left(x \cos \left(x\right)\right) \cdot \left(\cos \left(x\right) - x \sin \left(x\right)\right)$