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

May 27, 2016

$= e x \setminus \sin \left(x\right) - 4 e x - x \setminus \sin \left(x\right) + 4 x + \setminus \cos \left(x\right) - e \setminus \cos \left(x\right)$

#### Explanation:

$\setminus \frac{d}{\mathrm{dx}} \left(\left(x - e x\right) \left(\cos \left(x\right) + 2 x\right)\right)$

Applying product rule,
${\left(f \setminus \cdot g\right)}^{'} = {f}^{'} \setminus \cdot g + f \setminus \cdot {g}^{'}$

$f = x - e x , \setminus g = \setminus \cos \left(x\right) + 2 x$

$= \setminus \frac{d}{\mathrm{dx}} \left(x - e x\right) \left(\setminus \cos \left(x\right) + 2 x\right) + \setminus \frac{d}{\mathrm{dx}} \left(\cos \left(x\right) + 2 x\right) \left(x - e x \setminus\right)$

We know,
$\setminus \frac{d}{\mathrm{dx}} \left(x - e x\right) = 1 - e$
$\setminus \frac{d}{\mathrm{dx}} \left(\setminus \cos \setminus \left(x\right) + 2 x\right) = - \setminus \sin \setminus \left(x\right) + 2$

Finally,
$= \left(1 - e\right) \setminus \left(\setminus \cos \left(x \setminus\right) + 2 x \setminus\right) + \setminus \left(\sin \left(x\right) + 2 \setminus\right) \left(x - e x\right)$

Simplifying it,
$= e x \setminus \sin \left(x\right) - 4 e x - x \setminus \sin \left(x\right) + 4 x + \setminus \cos \left(x\right) - e \setminus \cos \left(x\right)$