# How do you find the derivative of -2e^(xcos(x))?

Jul 24, 2016

$\frac{\mathrm{dy}}{\mathrm{dx}} = - 2 {e}^{x \cdot \cos \left(x\right)} \left(\cos \left(x\right) - x \cdot s e n \left(x\right)\right)$

#### Explanation:

Using implicit differentiation, we have

$y = - 2 {e}^{x \cdot \cos \left(x\right)}$

If we take the natural log of both sides we have

$\ln \left(y\right) = \ln \left(- 2 \cdot {e}^{x \cdot \cos \left(x\right)}\right)$

Using the property of logs $\ln \left(a b\right) = \ln \left(a\right) + \ln \left(b\right)$

$\ln \left(y\right) = \ln \left(- 2\right) + \ln \left({e}^{x \cdot \cos \left(x\right)}\right)$

Don't worry about the negative number in the logarithm, since we're not evaluating it and constants don't affect derivation we can just ignore that for the moment.

Now, using the log property $\ln \left({a}^{b}\right) = b \cdot \ln \left(a\right)$

$\ln \left(y\right) = \ln \left(- 2\right) + x \cdot \cos \left(x\right) \cdot \ln \left(e\right)$

And since $\ln \left(e\right) = 1$

$\ln \left(y\right) = \ln \left(- 2\right) + x \cdot \cos \left(x\right)$

Now we differentiate both sides

$\frac{\mathrm{dy}}{\mathrm{dx}} \cdot {y}^{- 1} = \cos \left(x\right) \cdot \frac{\mathrm{dx}}{\mathrm{dx}} + x \frac{d}{\mathrm{dx}} \cos \left(x\right)$
$\frac{\mathrm{dy}}{\mathrm{dx}} \cdot {y}^{- 1} = \cos \left(x\right) - x \cdot s e n \left(x\right)$
$\frac{\mathrm{dy}}{\mathrm{dx}} = - 2 {e}^{x \cdot \cos \left(x\right)} \left(\cos \left(x\right) - x \cdot s e n \left(x\right)\right)$