# How do you differentiate f(x)=(lnx+4x)(tanx-e^x) using the product rule?

Oct 30, 2016

$f ' \left(x\right) = \left(\ln x + 4 x\right) \left({\sec}^{2} x - {e}^{x}\right) + \left(\tan x - {e}^{x}\right) \left(\frac{1}{x} + 4\right)$

#### Explanation:

You need to use the product rule; $\frac{d}{\mathrm{dx}} \left(u v\right) = u \frac{\mathrm{dv}}{\mathrm{dx}} + v \frac{\mathrm{du}}{\mathrm{dx}}$

We have $f \left(x\right) = \left(\ln x + 4 x\right) \left(\tan x - {e}^{x}\right)$ with $u = \left(\ln x + 4 x\right)$; $v = \left(\tan x - {e}^{x}\right)$

So, $f ' \left(x\right) = \left(\ln x + 4 x\right) \frac{d}{\mathrm{dx}} \left(\tan x - {e}^{x}\right) + \left(\tan x - {e}^{x}\right) \frac{d}{\mathrm{dx}} \left(\ln x + 4 x\right)$

$\therefore f ' \left(x\right) = \left(\ln x + 4 x\right) \left({\sec}^{2} x - {e}^{x}\right) + \left(\tan x - {e}^{x}\right) \left(\frac{1}{x} + 4\right)$