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

Apr 12, 2016

$\frac{\mathrm{df}}{\mathrm{dx}} = \cos x \left(9 + 2 x\right) - \sin x \left(2 + x\right)$

#### Explanation:

To differentiate $f \left(x\right) = \left(x + 4\right) \left(\cos x + 2 \sin x\right)$, we use product rule, which says that if $f \left(x\right) = g \left(x\right) \cdot h \left(x\right)$, then

$\frac{\mathrm{df}}{\mathrm{dx}}$=$\frac{\mathrm{dg}}{\mathrm{dx}}$$h \left(x\right)$+$\frac{\mathrm{dh}}{\mathrm{dx}}$$g \left(x\right)$ or

As $g \left(x\right) = \left(x + 4\right)$ and $h \left(x\right) = \left(\cos x + 2 \sin x\right)$ or

$\frac{\mathrm{df}}{\mathrm{dx}} = 1 \cdot \left(\cos x + 2 \sin x\right) + \left(- \sin x + 2 \cos x\right) \cdot \left(x + 4\right)$ or

$\frac{\mathrm{df}}{\mathrm{dx}} = \cos x + 2 \sin x - x \sin x + 2 x \cos x - 4 \sin x + 8 \cos x$ or

$\frac{\mathrm{df}}{\mathrm{dx}} = 9 \cos x - 2 \sin x - x \sin x + 2 x \cos x$ or

$\frac{\mathrm{df}}{\mathrm{dx}} = \cos x \left(9 + 2 x\right) - \sin x \left(2 + x\right)$