# How do you differentiate f(x)=(cosx+sinx)(lnx-x) using the product rule?

Dec 7, 2017

$\frac{d}{\mathrm{dx}} f \left(x\right) = \left(\cos x + \sin x\right) \left(\frac{1}{x} - 1\right) + \left(\ln x - x\right) \left(- \sin x + \cos x\right)$

#### Explanation:

$f \left(x\right) = \left(\cos x + \sin x\right) \left(\ln x - x\right)$

Here $f \left(x\right)$ is the product of two functions.

Therefore to differentiate $f \left(x\right)$ we will use the product rule

The product rule says that $\to$

$\frac{d}{\mathrm{dx}} U \cdot V = U \frac{d}{\mathrm{dx}} V + V \frac{d}{\mathrm{dx}} U$

Now back to the question, we will differentiate both sides with respect to $x$

$\frac{d}{\mathrm{dx}} f \left(x\right) = \frac{d}{\mathrm{dx}} \left[\left(\cos x + \sin x\right) \left(\ln x - x\right)\right]$

$\frac{d}{\mathrm{dx}} f \left(x\right) = \left(\cos x + \sin x\right) \frac{d}{\mathrm{dx}} \left(\ln x - x\right) + \left(\ln x - x\right) \frac{d}{\mathrm{dx}} \left(\cos x + \sin x\right)$

So therefore,

$\frac{d}{\mathrm{dx}} f \left(x\right) = \left(\cos x + \sin x\right) \left(\frac{1}{x} - 1\right) + \left(\ln x - x\right) \left(- \sin x + \cos x\right)$