# How do you differentiate f(x)=xsinx-e^x*cosx using the product rule?

Dec 30, 2015

I found: $\sin \left(x\right) \left[1 + {e}^{x}\right] + \cos \left(x\right) \left[x - {e}^{x}\right]$

#### Explanation:

The Product Rule tells us that given:
$f \left(x\right) = g \left(x\right) h \left(x\right)$
Tge derivative will be:
$f ' \left(x\right) = g ' \left(x\right) h \left(x\right) + g \left(x\right) h ' \left(x\right)$
$f ' \left(x\right) = 1 \cdot \sin \left(x\right) + x \cdot \cos \left(x\right) - {e}^{x} \cdot \cos \left(x\right) + {e}^{x} \cdot \sin \left(x\right) =$
$= \sin \left(x\right) \left[1 + {e}^{x}\right] + \cos \left(x\right) \left[x - {e}^{x}\right]$