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

Dec 13, 2016

#### Explanation:

Simplify first

$f \left(x\right) = \frac{1}{3} {e}^{x} - x \cos x$

We do not need the product rule for the first term, although you may use it if you like.

$\frac{d}{\mathrm{dx}} \left(\frac{1}{3} {e}^{x}\right) = \frac{d}{\mathrm{dx}} \left(\frac{1}{3}\right) {e}^{x} + \frac{1}{3} \frac{d}{\mathrm{dx}} \left({e}^{x}\right) = 0 {e}^{x} + \frac{1}{3} {e}^{x} = \frac{1}{3} {e}^{x}$

For the second term, we need the product rule. (unless we do something unusual.)

$\frac{d}{\mathrm{dx}} \left(x \cos x\right) = \frac{d}{\mathrm{dx}} \left(x\right) \cdot \cos x + x \cdot \frac{d}{\mathrm{dx}} \left(\cos x\right)$

$= \cos x - x \sin x$

Putting it all together,

$f ' \left(x\right) = \frac{1}{3} {e}^{x} + \cos x - x \sin x$