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

Apr 17, 2017

$f ' \left(x\right) = \left(\cot x - {e}^{x}\right) \left(\frac{1}{x} + 3\right) - \left(\ln x + 3 x\right) \left({\csc}^{2} x + {e}^{x}\right)$

#### Explanation:

$\text{Given " f(x)=g(x)h(x)" then}$

$f ' \left(x\right) = g \left(x\right) h ' \left(x\right) + h \left(x\right) g ' \left(x\right) \leftarrow \text{ product rule}$

$\text{here } g \left(x\right) = \ln x + 3 x \Rightarrow g ' \left(x\right) = \frac{1}{x} + 3$

$\text{and } h \left(x\right) = \cot x - {e}^{x} \Rightarrow h ' \left(x\right) = - {\csc}^{2} x - {e}^{x}$

$\Rightarrow f ' \left(x\right) = \left(\ln + 3 x\right) \left(- {\csc}^{2} x - {e}^{x}\right)$

$\textcolor{w h i t e}{\times \times \times \times} + \left(\cot x - {e}^{x}\right) \left(\frac{1}{x} + 3\right)$

$\textcolor{w h i t e}{\Rightarrow f ' \left(x\right)} = \left(\cot x - {e}^{x}\right) \left(\frac{1}{x} + 3\right)$

$\textcolor{w h i t e}{\times \times \times \times} - \left(\ln x + 3 x\right) \left({\csc}^{2} x + {e}^{x}\right)$